bazelbuild / bazelbuild/bazel

`--override_repo` flag for injecting `override_repo`

Open
#23,879 4 comments 0 reactions 0 assignees View on GitHub
P3 team-ExternalDeps type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the feature request:

[override_repo](https://bazel.build/rules/lib/globals/module#override_repo) allows overriding a repository created by a module extension. The FR is for a flag exposing this functionality, analogous to `--override_module` and `--override_repository`.

Actually, I thought something like `--override_repository=module_repo_canonical_name+extension_name+repo_name=path` might "just work", but if it does then I could not spell it right!

@wyv

### Which category does this issue belong to?

External Dependency

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

The use cases for this are basically the same as for `--override_module`: just like developers want to be able to override a module from the command line, they want to be able to override repos created by module extensions.

A specific use case I have in mind are CI builders that use a different version of a [CIPD package](https://chromium.googlesource.com/chromium/src/+/89.0.4389.114/docs/cipd.md).

### Which operating system are you running Bazel on?

_No response_

### What is the output of `bazel info release`?

_No response_

### 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?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by tracing the existing --override_module and --override_repository flag implementations, then compare them with the override_repo module-extension behavior described in the issue. Define the supported command-line syntax and verify it with tests covering replacement of a repository created by a module extension.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.