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

feat(bzlmod): add module_override tag to allow patching in go_deps #1500

Merged
merged 1 commit into from
Apr 7, 2023

Conversation

tyler-french
Copy link
Contributor

@tyler-french tyler-french commented Apr 6, 2023

What type of PR is this?

Feature

What package or component does this PR mostly affect?

internal/bzlmod/go_deps

What does this PR do? Why is it needed?

This adds a new module_override tag which allows a user to apply patches to a go_deps module.

Which issues(s) does this PR fix?

Fixes #1499

Other notes for review

Added a test which applies a patch and asserts on contents from the patched repo.

@tyler-french tyler-french force-pushed the patch branch 7 times, most recently from 1800569 to 6545901 Compare April 7, 2023 14:51
@tyler-french tyler-french changed the title allow patching in go_deps feat'bzlmodadd module_override tag to allow patching in go_deps Apr 7, 2023
@tyler-french tyler-french changed the title feat'bzlmodadd module_override tag to allow patching in go_deps feat(bzlmod): add module_override tag to allow patching in go_deps Apr 7, 2023
@tyler-french tyler-french marked this pull request as ready for review April 7, 2023 14:52
@fmeum fmeum merged commit 1314e56 into bazel-contrib:master Apr 7, 2023
renovate bot referenced this pull request in kreempuff/rules_unreal_engine May 27, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [bazel_gazelle](https://togithub.com/bazelbuild/bazel-gazelle) |
http_archive | minor | `v0.30.0` -> `v0.31.0` |

---

### ⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the
Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>bazelbuild/bazel-gazelle</summary>

###
[`v0.31.0`](https://togithub.com/bazelbuild/bazel-gazelle/releases/tag/v0.31.0)

[Compare
Source](https://togithub.com/bazelbuild/bazel-gazelle/compare/v0.30.0...v0.31.0)

#### What's Changed

- feat: allow passing GIT_CONFIG_COUNT and it's related configs by
[@&#8203;manuelnaranjo](https://togithub.com/manuelnaranjo) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1462](https://togithub.com/bazelbuild/bazel-gazelle/pull/1462)
- feat(bzlmod): add `module_override` tag to allow patching in go_deps
by [@&#8203;tyler-french](https://togithub.com/tyler-french) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1500](https://togithub.com/bazelbuild/bazel-gazelle/pull/1500)
- fix typo `build_proto_file_mode` in message by
[@&#8203;tyler-french](https://togithub.com/tyler-french) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1504](https://togithub.com/bazelbuild/bazel-gazelle/pull/1504)
- fix: support running within a dir named workspace by
[@&#8203;jbedard](https://togithub.com/jbedard) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1498](https://togithub.com/bazelbuild/bazel-gazelle/pull/1498)
- fix: check for gazelle command before adding -repo_config flag by
[@&#8203;cgrindel](https://togithub.com/cgrindel) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1501](https://togithub.com/bazelbuild/bazel-gazelle/pull/1501)
- language/go: Infer prefix from go.mod by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1497](https://togithub.com/bazelbuild/bazel-gazelle/pull/1497)
- don't overwrite directives by
[@&#8203;tyler-french](https://togithub.com/tyler-french) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1503](https://togithub.com/bazelbuild/bazel-gazelle/pull/1503)
- Support Bzlmod for gazelle itself by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1509](https://togithub.com/bazelbuild/bazel-gazelle/pull/1509)
- language/go: Add windows arm64 as a known platform. by
[@&#8203;connyay](https://togithub.com/connyay) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1507](https://togithub.com/bazelbuild/bazel-gazelle/pull/1507)
- Adding lifecycle manager by
[@&#8203;linzhp](https://togithub.com/linzhp) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1475](https://togithub.com/bazelbuild/bazel-gazelle/pull/1475)
- Disable protobuf generation for more modules by
[@&#8203;seh](https://togithub.com/seh) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1514](https://togithub.com/bazelbuild/bazel-gazelle/pull/1514)
- Support '~' in label repo by
[@&#8203;mark-thm](https://togithub.com/mark-thm) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1518](https://togithub.com/bazelbuild/bazel-gazelle/pull/1518)
- language/go: Handle `unix` build tag. by
[@&#8203;connyay](https://togithub.com/connyay) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1512](https://togithub.com/bazelbuild/bazel-gazelle/pull/1512)
- Pass data arg through to sh_binary if defined by
[@&#8203;Preston4tw](https://togithub.com/Preston4tw) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1483](https://togithub.com/bazelbuild/bazel-gazelle/pull/1483)
- remove circular override hack by
[@&#8203;tyler-french](https://togithub.com/tyler-french) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1515](https://togithub.com/bazelbuild/bazel-gazelle/pull/1515)
- Add major version suffix download example by
[@&#8203;kriswuollett](https://togithub.com/kriswuollett) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1453](https://togithub.com/bazelbuild/bazel-gazelle/pull/1453)
- Relax parsing of labels by
[@&#8203;purkhusid](https://togithub.com/purkhusid) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1508](https://togithub.com/bazelbuild/bazel-gazelle/pull/1508)
- bzlmod: Add `build_file_generation` to `gazelle_override` by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1522](https://togithub.com/bazelbuild/bazel-gazelle/pull/1522)
- Fix incremental build of to bootstrap Gazelle by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1529](https://togithub.com/bazelbuild/bazel-gazelle/pull/1529)
- Support macros/rules packed within bazel `struct` by
[@&#8203;birunts](https://togithub.com/birunts) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1524](https://togithub.com/bazelbuild/bazel-gazelle/pull/1524)
- Prefer non-proto over proto deps in external repos by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1537](https://togithub.com/bazelbuild/bazel-gazelle/pull/1537)
- bzlmod: Return `extension_metadata` to automate `use_repo` fixes by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1511](https://togithub.com/bazelbuild/bazel-gazelle/pull/1511)
- Fix `go:embed` failing to add `embedsrcs` for subdirectories named
build by [@&#8203;sgavinio](https://togithub.com/sgavinio) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1539](https://togithub.com/bazelbuild/bazel-gazelle/pull/1539)
- Remove support for godep and dep by
[@&#8203;sluongng](https://togithub.com/sluongng) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1541](https://togithub.com/bazelbuild/bazel-gazelle/pull/1541)
- Avoid putting -repo_config after directories by
[@&#8203;linzhp](https://togithub.com/linzhp) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1544](https://togithub.com/bazelbuild/bazel-gazelle/pull/1544)
- Dropping -args by [@&#8203;linzhp](https://togithub.com/linzhp) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1546](https://togithub.com/bazelbuild/bazel-gazelle/pull/1546)

#### New Contributors

- [@&#8203;connyay](https://togithub.com/connyay) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1507](https://togithub.com/bazelbuild/bazel-gazelle/pull/1507)
- [@&#8203;mark-thm](https://togithub.com/mark-thm) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1518](https://togithub.com/bazelbuild/bazel-gazelle/pull/1518)
- [@&#8203;Preston4tw](https://togithub.com/Preston4tw) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1483](https://togithub.com/bazelbuild/bazel-gazelle/pull/1483)
- [@&#8203;kriswuollett](https://togithub.com/kriswuollett) made their
first contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1453](https://togithub.com/bazelbuild/bazel-gazelle/pull/1453)
- [@&#8203;purkhusid](https://togithub.com/purkhusid) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1508](https://togithub.com/bazelbuild/bazel-gazelle/pull/1508)
- [@&#8203;birunts](https://togithub.com/birunts) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1524](https://togithub.com/bazelbuild/bazel-gazelle/pull/1524)
- [@&#8203;sgavinio](https://togithub.com/sgavinio) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1539](https://togithub.com/bazelbuild/bazel-gazelle/pull/1539)

**Full Changelog**:
bazel-contrib/bazel-gazelle@v0.30.0...v0.31.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/kreempuff/rules_unreal_engine).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMDIuNCIsInVwZGF0ZWRJblZlciI6IjM1LjEwMi40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
renovate bot referenced this pull request in cgrindel/bazel-starlib May 27, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [bazel_gazelle](https://togithub.com/bazelbuild/bazel-gazelle) |
http_archive | minor | `v0.30.0` -> `v0.31.0` |

---

### Release Notes

<details>
<summary>bazelbuild/bazel-gazelle</summary>

###
[`v0.31.0`](https://togithub.com/bazelbuild/bazel-gazelle/releases/tag/v0.31.0)

[Compare
Source](https://togithub.com/bazelbuild/bazel-gazelle/compare/v0.30.0...v0.31.0)

#### What's Changed

- feat: allow passing GIT_CONFIG_COUNT and it's related configs by
[@&#8203;manuelnaranjo](https://togithub.com/manuelnaranjo) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1462](https://togithub.com/bazelbuild/bazel-gazelle/pull/1462)
- feat(bzlmod): add `module_override` tag to allow patching in go_deps
by [@&#8203;tyler-french](https://togithub.com/tyler-french) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1500](https://togithub.com/bazelbuild/bazel-gazelle/pull/1500)
- fix typo `build_proto_file_mode` in message by
[@&#8203;tyler-french](https://togithub.com/tyler-french) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1504](https://togithub.com/bazelbuild/bazel-gazelle/pull/1504)
- fix: support running within a dir named workspace by
[@&#8203;jbedard](https://togithub.com/jbedard) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1498](https://togithub.com/bazelbuild/bazel-gazelle/pull/1498)
- fix: check for gazelle command before adding -repo_config flag by
[@&#8203;cgrindel](https://togithub.com/cgrindel) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1501](https://togithub.com/bazelbuild/bazel-gazelle/pull/1501)
- language/go: Infer prefix from go.mod by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1497](https://togithub.com/bazelbuild/bazel-gazelle/pull/1497)
- don't overwrite directives by
[@&#8203;tyler-french](https://togithub.com/tyler-french) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1503](https://togithub.com/bazelbuild/bazel-gazelle/pull/1503)
- Support Bzlmod for gazelle itself by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1509](https://togithub.com/bazelbuild/bazel-gazelle/pull/1509)
- language/go: Add windows arm64 as a known platform. by
[@&#8203;connyay](https://togithub.com/connyay) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1507](https://togithub.com/bazelbuild/bazel-gazelle/pull/1507)
- Adding lifecycle manager by
[@&#8203;linzhp](https://togithub.com/linzhp) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1475](https://togithub.com/bazelbuild/bazel-gazelle/pull/1475)
- Disable protobuf generation for more modules by
[@&#8203;seh](https://togithub.com/seh) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1514](https://togithub.com/bazelbuild/bazel-gazelle/pull/1514)
- Support '~' in label repo by
[@&#8203;mark-thm](https://togithub.com/mark-thm) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1518](https://togithub.com/bazelbuild/bazel-gazelle/pull/1518)
- language/go: Handle `unix` build tag. by
[@&#8203;connyay](https://togithub.com/connyay) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1512](https://togithub.com/bazelbuild/bazel-gazelle/pull/1512)
- Pass data arg through to sh_binary if defined by
[@&#8203;Preston4tw](https://togithub.com/Preston4tw) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1483](https://togithub.com/bazelbuild/bazel-gazelle/pull/1483)
- remove circular override hack by
[@&#8203;tyler-french](https://togithub.com/tyler-french) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1515](https://togithub.com/bazelbuild/bazel-gazelle/pull/1515)
- Add major version suffix download example by
[@&#8203;kriswuollett](https://togithub.com/kriswuollett) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1453](https://togithub.com/bazelbuild/bazel-gazelle/pull/1453)
- Relax parsing of labels by
[@&#8203;purkhusid](https://togithub.com/purkhusid) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1508](https://togithub.com/bazelbuild/bazel-gazelle/pull/1508)
- bzlmod: Add `build_file_generation` to `gazelle_override` by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1522](https://togithub.com/bazelbuild/bazel-gazelle/pull/1522)
- Fix incremental build of to bootstrap Gazelle by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1529](https://togithub.com/bazelbuild/bazel-gazelle/pull/1529)
- Support macros/rules packed within bazel `struct` by
[@&#8203;birunts](https://togithub.com/birunts) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1524](https://togithub.com/bazelbuild/bazel-gazelle/pull/1524)
- Prefer non-proto over proto deps in external repos by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1537](https://togithub.com/bazelbuild/bazel-gazelle/pull/1537)
- bzlmod: Return `extension_metadata` to automate `use_repo` fixes by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1511](https://togithub.com/bazelbuild/bazel-gazelle/pull/1511)
- Fix `go:embed` failing to add `embedsrcs` for subdirectories named
build by [@&#8203;sgavinio](https://togithub.com/sgavinio) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1539](https://togithub.com/bazelbuild/bazel-gazelle/pull/1539)
- Remove support for godep and dep by
[@&#8203;sluongng](https://togithub.com/sluongng) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1541](https://togithub.com/bazelbuild/bazel-gazelle/pull/1541)
- Avoid putting -repo_config after directories by
[@&#8203;linzhp](https://togithub.com/linzhp) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1544](https://togithub.com/bazelbuild/bazel-gazelle/pull/1544)
- Dropping -args by [@&#8203;linzhp](https://togithub.com/linzhp) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1546](https://togithub.com/bazelbuild/bazel-gazelle/pull/1546)

#### New Contributors

- [@&#8203;connyay](https://togithub.com/connyay) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1507](https://togithub.com/bazelbuild/bazel-gazelle/pull/1507)
- [@&#8203;mark-thm](https://togithub.com/mark-thm) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1518](https://togithub.com/bazelbuild/bazel-gazelle/pull/1518)
- [@&#8203;Preston4tw](https://togithub.com/Preston4tw) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1483](https://togithub.com/bazelbuild/bazel-gazelle/pull/1483)
- [@&#8203;kriswuollett](https://togithub.com/kriswuollett) made their
first contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1453](https://togithub.com/bazelbuild/bazel-gazelle/pull/1453)
- [@&#8203;purkhusid](https://togithub.com/purkhusid) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1508](https://togithub.com/bazelbuild/bazel-gazelle/pull/1508)
- [@&#8203;birunts](https://togithub.com/birunts) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1524](https://togithub.com/bazelbuild/bazel-gazelle/pull/1524)
- [@&#8203;sgavinio](https://togithub.com/sgavinio) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1539](https://togithub.com/bazelbuild/bazel-gazelle/pull/1539)

**Full Changelog**:
bazel-contrib/bazel-gazelle@v0.30.0...v0.31.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/cgrindel/bazel-starlib).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMDIuNCIsInVwZGF0ZWRJblZlciI6IjM1LjEwMi40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bzlmod: go_deps doesn't support patching
2 participants