Skip to content

Commit 59c4a3e

Browse files
authored
Fix bazel:mod-tidy job to ignore lockfile changes (#45129)
### Motivation The `bazel:mod-tidy` job is meant to ensure `MODULE.bazel` remains in an optimal state (not only in `bazel`'s opinionated format, but first and foremost to help maintain the `use_repo` directives that Gazelle will update). The problem is that I added it without thinking it could fail due to `MODULE.bazel.lock` being updated by side effect, which is already (and better) guarded by the sibling `bazel:mod-deps` job, misleadingly causing [both to fail](https://gitlab.ddbuild.io/DataDog/datadog-agent/-/pipelines/90857566) on inadvertent changes in the lockfile: <img width="337" height="159" alt="image" src="https://github.com/user-attachments/assets/c6a3f998-29ef-4286-a561-2a48f3555a61" /> ### What does this PR do? Adding `--lockfile_mode=off` to `bazel mod tidy` is therefore meant to prevent `bazel:mod-tidy` from failing on lockfile changes for a proper separation of concerns, distinct hints being provided: ```diff -💡 bazel mod tidy +💡 bazel mod deps ```
1 parent 532bd4e commit 59c4a3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.gitlab/build/bazel/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ bazel:mod-tidy:
1919
extends: .bazel:runner:linux-amd64
2020
stage: lint
2121
script:
22-
- bazel mod tidy
22+
- bazel mod tidy --lockfile_mode=off
2323
- git diff --exit-code
2424
after_script:
2525
- |-

0 commit comments

Comments
 (0)