feat: add support for cloning GitLab repositories#316
Merged
Conversation
behnazh-w
reviewed
Jun 15, 2023
tromai
reviewed
Jun 16, 2023
tromai
reviewed
Jun 16, 2023
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
c6a0db9 to
b90e44c
Compare
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
b90e44c to
2b5f2e1
Compare
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
This was referenced Jun 20, 2023
behnazh-w
reviewed
Jun 20, 2023
Member
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
f950063 to
b42a9e3
Compare
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
tromai
reviewed
Jun 21, 2023
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
Member
Author
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
behnazh-w
reviewed
Jun 22, 2023
| tmp_path: Path, | ||
| ) -> None: | ||
| """Test the get allowed git service domains function, in multi-config files scenario.""" | ||
| default_filepath = tmp_path / "default.ini" |
Member
There was a problem hiding this comment.
Please use os.path.join here and for all the path constructions.
Contributor
There was a problem hiding this comment.
I wonder why couldn't we use the slash operator here as it is supported by pathlib - https://docs.python.org/3/library/pathlib.html#operators. The tmp_path is of type pathlib.Path so I think it's okay to use.
Member
There was a problem hiding this comment.
It's to be consistent with the rest of the codebase and to be more explicit by using a function signature.
…ults config object Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
behnazh-w
reviewed
Jun 22, 2023
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
behnazh-w
approved these changes
Jun 22, 2023
art1f1c3R
pushed a commit
that referenced
this pull request
Nov 29, 2024
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #301.
Description
This PR adds support for cloning GitLab repositories in Macaron. Specifically, GitLab repositories can now be cloned as either main targets or dependencies in a
macaron analyzerun.This feature comes with the following additions/changes:
.iniconfiguration[git]section in the.iniconfiguration will now be replaced by the new[git_service.*]sections.[git_service]section corresponds to a different git service with adomainkey. This domain is used to determine if a Git service hosts a repo given the repo's Git URL.domainkey is not found in any[git_service.*]section, the commandmacaron analyzewill error right away before any analysis is done.[git_service.gitlab.*]sections: a public one and a private one. The domain of the public GitLab service isgitlab.comby default.Access Token Environment Variables
An access token for the public GitLab service is not required when it is enabled. However, an access token for the private GitLab service is always required when it is enabled.
We accept two environment variables storing the access tokens that correspond to the two GitLab services:
MCN_PUBLIC_GITLAB_TOKENfor the public GitLab service.MCN_PRIVATE_GITLAB_TOKENfor the private GitLab service.The
MCN_PRIVATE_GITLAB_TOKENenvironment variable must be set when the[git_service.gitlab.private]section is enabled in the.iniconfig. If this is not the case, the commandmacaron analyzewill error right away before any analysis is done.