Add support for CI_JOB_TOKEN to GitLab fetcher #12598
Open
+6
−0
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.
Motivation
The motivation is laid out in #12579 but the summary is: GitLab can be configured to provide a token to each build which is only valid for the life of the job, which allows access to git repositories and the GitLab API. Currently this isn't well supported by Nix, it can be hacked into an
Authorization
header by using something like:but it would be nicer to support users who're using GitLab CI.
This is my first Nix contribution (and my first C++), so any suggestions are humbly appreciated. I have a couple of questions:
--impure
sense), the result of the fetcher doesn't only differs in whether it works or not, not the content of its result. This would mean users can bake this into their docker images used for CI once.src/libfetchers-tests/access-tokens.cc
but couldn't see how to actually test the code I've written; none of the methods appear to be visible as far as I can tell.Context
See #12579.
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.