Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command line flag to solve GitHub/GitLab ambiguity #79

Closed
2 tasks
cdboer opened this issue Jan 9, 2023 · 2 comments
Closed
2 tasks

Command line flag to solve GitHub/GitLab ambiguity #79

cdboer opened this issue Jan 9, 2023 · 2 comments
Assignees
Labels
feature Implement this feature
Milestone

Comments

@cdboer
Copy link
Collaborator

cdboer commented Jan 9, 2023

Is your feature request related to a problem? Please describe.
GitHub/GitLab detection is really naiive. It only tests for occurence of "github" or "gitlab" strings in the given extraction url. GitLab projects can be called r'.*github.*' which would lead gitlab2prov to try to use the GitHub API for a project hosted on gitlab.

Describe the solution you'd like
Users should be able to declare which platform the project is hosted on by declaring a command line flag/argument such as --platform for the extraction subcommand. Additionally we should think about making a test request to the project url to find out whether its hosted on gitlab or github.

  • Command line flag
  • HTTP request to find automatically resolve the platform
@cdboer cdboer added the feature Implement this feature label Jan 9, 2023
@cdboer cdboer self-assigned this Jan 9, 2023
@cdboer cdboer added this to the github2prov milestone Jan 25, 2023
@cdboer
Copy link
Collaborator Author

cdboer commented Jan 25, 2023

Maybe it would be better to split gitlab2prov & github2prov into two seperate cli tools. E.g.

github2prov

and

gitlab2prov

they could share commands like load, save, combine, etc. and have their own subset of commands with gitlab/github specific behaviour such as merge-duplicated-agents etc.

@click.group()
def gitlab2prov(): 
    pass

@click.group()
def github2prov():
    pass

@click.command()
def example():
    pass

# add gitlab specific cmds
gitlab2prov.add_command(example)
gitlab2prov.add_command(example)
# add github specific cmds
github2prov.add_command(example)
github2prov.add_command(example)

@cdboer
Copy link
Collaborator Author

cdboer commented Jan 29, 2023

Note: If you split github & gitlab behaviour into seperate cli's you can't use a single config file containing github & gitlab urls. This should be noted in the README

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Implement this feature
Projects
None yet
Development

No branches or pull requests

1 participant