Skip to content

Commit 8cd9d82

Browse files
locking: enforce Bzlmod lockfile consistency (#435)
* locking: enforce Bzlmod lockfile consistency add reusable lockfile check workflow track MODULE.bazel.lock (remove from .gitignore) enforce --lockfile_mode=error in CI and scripts Addresses eclipse-score/score#2628 * lock: updated updated lock file Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> --------- Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com>
1 parent 0b505e3 commit 8cd9d82

10 files changed

Lines changed: 1080 additions & 10 deletions

File tree

.github/workflows/bzlmod-lock.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
name: Bzlmod Lockfile Check
14+
permissions:
15+
contents: read
16+
on:
17+
pull_request:
18+
types: [opened, reopened, synchronize]
19+
merge_group:
20+
types: [checks_requested]
21+
push:
22+
branches:
23+
- main
24+
jobs:
25+
bzlmod-lock:
26+
uses: eclipse-score/cicd-workflows/.github/workflows/bzlmod-lock-check.yml@main
27+
with:
28+
working-directory: .

.github/workflows/consumer_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
- name: Prepare Python
3535
run: |
36-
bazel run //:ide_support
36+
bazel run --lockfile_mode=error //:ide_support
3737
3838
- name: Prepare report directory
3939
run: |

.github/workflows/copyright.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
copyright-check:
2222
uses: eclipse-score/cicd-workflows/.github/workflows/copyright.yml@main
2323
with:
24-
bazel-target: "run //:copyright.check"
24+
bazel-target: "run --lockfile_mode=error //:copyright.check"

.github/workflows/license_check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ jobs:
2828
uses: eclipse-score/cicd-workflows/.github/workflows/license-check.yml@main
2929
with:
3030
repo-url: "${{ github.server_url }}/${{ github.repository }}"
31-
bazel-target: "run //src:license-check"
31+
bazel-target: "run --lockfile_mode=error //src:license-check"
3232
secrets:
3333
dash-api-token: ${{ secrets.ECLIPSE_GITLAB_API_TOKEN }}

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ jobs:
3838
bazelisk-cache: true
3939
- name: Run test targets
4040
run: |
41-
bazel run //:ide_support
42-
bazel test //src/...
41+
bazel run --lockfile_mode=error //:ide_support
42+
bazel test --lockfile_mode=error //src/...
4343
4444
- name: Prepare bundled consumer report
4545
if: always()

.github/workflows/test_and_docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
pull-requests: write
3838
contents: read
3939
with:
40-
bazel-docs-verify-target: "//:docs_check"
40+
bazel-docs-verify-target: "--lockfile_mode=error //:docs_check"
4141

4242
# This is the user configurable part of the workflow
4343
unit-tests:
@@ -55,6 +55,6 @@ jobs:
5555
pull-requests: write
5656
id-token: write
5757
with:
58-
bazel-target: "//:docs -- --github_user=${{ github.repository_owner }} --github_repo=${{ github.event.repository.name }}"
58+
bazel-target: "--lockfile_mode=error //:docs -- --github_user=${{ github.repository_owner }} --github_repo=${{ github.event.repository.name }}"
5959
retention-days: 3
6060
tests-report-artifact: tests-report

.github/workflows/test_links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
# Run your link checker and generate log
1616
- name: Run LinkChecker
1717
run: |
18-
bazel run //:link_check > linkcheck_output.txt
18+
bazel run --lockfile_mode=error //:link_check > linkcheck_output.txt
1919
continue-on-error: true
2020

2121
# Run your Python script to parse the linkcheck log and generate issue body

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
# Bazel
55
bazel-*
6-
MODULE.bazel.lock
76
user.bazelrc
87

98
# Ruff

MODULE.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ python.toolchain(
3333
is_default = True,
3434
python_version = PYTHON_VERSION,
3535
)
36-
use_repo(python)
3736

3837
###############################################################################
3938
#

MODULE.bazel.lock

Lines changed: 1044 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)