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

Add support for git SSH registry URL #22456

Open
Annrtl opened this issue May 20, 2024 · 3 comments
Open

Add support for git SSH registry URL #22456

Annrtl opened this issue May 20, 2024 · 3 comments
Labels
area-Bzlmod Bzlmod-specific PRs, issues, and feature requests help wanted Someone outside the Bazel team could own this P3 We're not considering working on this, but happy to review a PR. (No assignee) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: feature request

Comments

@Annrtl
Copy link

Annrtl commented May 20, 2024

Description of the feature request:

Be able to use a git SSH registry URL
Example in .bazelrc:

common --registry=git@github.com:bazelbuild/bazel-central-registry.git

Which category does this issue belong to?

No response

What underlying problem are you trying to solve with this feature?

Add a private git repository protected by ssh key as Bazel register

Which operating system are you running Bazel on?

Rocky Linux 9.4 (Blue Onyx)

What is the output of bazel info release?

release 7.1.1

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

Using a git SSH registry URL gives me the following error message

Invalid registry URL: Unrecognized registry URL protocol
@Wyverald Wyverald added P3 We're not considering working on this, but happy to review a PR. (No assignee) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. help wanted Someone outside the Bazel team could own this area-Bzlmod Bzlmod-specific PRs, issues, and feature requests and removed untriaged labels May 20, 2024
@BalestraPatrick
Copy link
Member

@fmeum Do you have any instructions/ideas on how to achieve this? I see this as a blocker for us to adopt bzlmod since we don't want to use the credentials helper to distribute personal access tokens (but rather rely on the already configured ssh key) to access a private git repository.

@fmeum
Copy link
Collaborator

fmeum commented Jul 18, 2024

Since the registry model is heavy on random access to specific paths, I'm not sure Bazel could do better than checking out the repo completely to some local path and then using that as the registry. This poses the non-trivial problem of when to fetch and check for updates to the remote repo.

Could you include this logic into your tools/bazel wrapper and just point Bazel to the local path to which your wrapper clones it? That should give you essentially the same user experience today, plus you would have full control over when to git fetch.

@BalestraPatrick
Copy link
Member

@fmeum I can see how that would work, but it's also extra logic that every user of Bazel now has to take care of implementing. Even if there was a way to just create a git_repository and hook that up to be a registry, that would be much more ideal. Or possibly a way to adopt a registry via a downloaded zip file that we could produce by packaging up the internal repo and make that even more cacheable and reproducible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Bzlmod Bzlmod-specific PRs, issues, and feature requests help wanted Someone outside the Bazel team could own this P3 We're not considering working on this, but happy to review a PR. (No assignee) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: feature request
Projects
None yet
Development

No branches or pull requests

7 participants