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
Use http_archive
with private Gitlab repo
#16659
Comments
Sending a custom HTTP header is a highly uncommon use case. For GitLab specifically, you can use the standard Authentication header instead: https://docs.gitlab.com/ee/api/#personalprojectgroup-access-tokens |
@Wyverald I am hitting the same exact problem with the Is there a way to do this under bazel? |
any links for context? |
https://github.com/opencontainers/distribution-spec/blob/main/spec.md#workflow-categories Part that starts with Which is currently can't be set; bazel automatically sets it to |
@thesayyn I'm much more sympathetic towards adding an "Accept" header than a completely random one called "PRIVATE-TOKEN". Could you file a separate issue about this? Thanks. |
FYI - you should be able to do this using a credential helper in Bazel 6.3.0 (soon to be released) or later. |
The problem with credential_helper is that I have to tell my ruleset users to either put a bash script into their workspace or download a binary from the internet for every CI/Dev machine just to add a header. it's not bazel-like |
I recently ran into this issue, but found out a solution. I'm responding here just to go ahead and document it (hopefully also helping anyone else who happens to stumble upon this in the future). It is true that gitlab has historically used This can be shown working using This can be used with Bazel with:
(one could also use the Note: the netrc file must be given in an absolute path. Relative paths are not supported; they resolve to the Unfortunately, I believe none of this works with Hope this helps! |
Description of the feature request:
I would like to use this in my WORKSPACE file:
where
test_project
is a private repository.What underlying problem are you trying to solve with this feature?
The tarball containing the repo can be downloaded on the command line with:
Unfortunately the
http_archive
rule results in something equivalent to:Therefore,
http_archive
is not compatible with gitlab.com for private repos, since it does not let the user customize the authentication header in the required way.http_archive
is making too many assumptions on how an authentication header should look like.Which operating system are you running Bazel on?
Linux, Ubuntu
What is the output of
bazel info release
?release 5.3.2
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?Have you found anything relevant by searching the web?
no
Any other information, logs, or outputs that you want to share?
The text was updated successfully, but these errors were encountered: