-
Notifications
You must be signed in to change notification settings - Fork 28
feat: add support for cloning GitLab repositories #316
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
Conversation
Signed-off-by: Nathan Nguyen <[email protected]>
Signed-off-by: Nathan Nguyen <[email protected]>
Signed-off-by: Nathan Nguyen <[email protected]>
Signed-off-by: Nathan Nguyen <[email protected]>
c6a0db9
to
b90e44c
Compare
Signed-off-by: Nathan Nguyen <[email protected]>
Signed-off-by: Nathan Nguyen <[email protected]>
Signed-off-by: Nathan Nguyen <[email protected]>
b90e44c
to
2b5f2e1
Compare
Signed-off-by: Nathan Nguyen <[email protected]>
Signed-off-by: Nathan Nguyen <[email protected]>
Signed-off-by: Nathan Nguyen <[email protected]>
f950063
to
b42a9e3
Compare
Signed-off-by: Nathan Nguyen <[email protected]>
Signed-off-by: Nathan Nguyen <[email protected]>
Signed-off-by: Nathan Nguyen <[email protected]>
Signed-off-by: Nathan Nguyen <[email protected]>
Signed-off-by: Nathan Nguyen <[email protected]>
Signed-off-by: Nathan Nguyen <[email protected]>
Signed-off-by: Nathan Nguyen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
tests/slsa_analyzer/test_git_url.py
Outdated
tmp_path: Path, | ||
) -> None: | ||
"""Test the get allowed git service domains function, in multi-config files scenario.""" | ||
default_filepath = tmp_path / "default.ini" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use os.path.join
here and for all the path constructions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's to be consistent with the rest of the codebase and to be more explicit by using a function signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed in 9425dfe.
…ults config object Signed-off-by: Nathan Nguyen <[email protected]>
Signed-off-by: Nathan Nguyen <[email protected]>
Signed-off-by: Nathan Nguyen <[email protected]>
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 analyze
run.This feature comes with the following additions/changes:
.ini
configuration[git]
section in the.ini
configuration will now be replaced by the new[git_service.*]
sections.[git_service]
section corresponds to a different git service with adomain
key. This domain is used to determine if a Git service hosts a repo given the repo's Git URL.domain
key is not found in any[git_service.*]
section, the commandmacaron analyze
will 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.com
by 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_TOKEN
for the public GitLab service.MCN_PRIVATE_GITLAB_TOKEN
for the private GitLab service.The
MCN_PRIVATE_GITLAB_TOKEN
environment variable must be set when the[git_service.gitlab.private]
section is enabled in the.ini
config. If this is not the case, the commandmacaron analyze
will error right away before any analysis is done.