fix(ci): repair root swiftlint_lint ref after scripts/ became a bazel package (#3425) #3499

Merged
mfreeman451 merged 1 commit from fix/ci-scripts-bazel-package into staging 2026-06-01 14:05:51 +00:00
Owner

What

#3496 added scripts/BUILD.bazel, making scripts/ a bazel package. That invalidated the root //:swiftlint_lint target, whose srcs = ["scripts/swiftlint_bazel.sh"] is now a cross-package source reference:

ERROR: //:swiftlint_lint Label '//:scripts/swiftlint_bazel.sh' is invalid because
'scripts' is a subpackage; perhaps you meant '//scripts:swiftlint_bazel.sh'

Because the root package was in error, bazel run //:gazelle (its runner lives in //) also failed to load — blocking gazelle for everyone.

Fix

  • Point swiftlint_lint at //scripts:swiftlint_bazel.sh and exports_files it from scripts/BUILD.bazel.
  • # gazelle:exclude go/pkg/agent/testdata — now that gazelle loads again, it tried to generate a BUILD for the camera_stream_plugin test fixture; testdata isn't bazel-managed.

Validation

  • bazel build //:swiftlint_lint — passes.
  • bazel run //:gazelle -- go — exits 0 (was failing to load the root package) and produces no churn.

Note: a separate local-only bazel query //... snag exists from gitignored swift/FieldSurvey/.build SPM checkouts — not included here since CI never checks those out.

🤖 Generated with Claude Code

## What `#3496` added `scripts/BUILD.bazel`, making `scripts/` a bazel package. That invalidated the root `//:swiftlint_lint` target, whose `srcs = ["scripts/swiftlint_bazel.sh"]` is now a cross-package source reference: ``` ERROR: //:swiftlint_lint Label '//:scripts/swiftlint_bazel.sh' is invalid because 'scripts' is a subpackage; perhaps you meant '//scripts:swiftlint_bazel.sh' ``` Because the **root package** was in error, `bazel run //:gazelle` (its runner lives in `//`) also failed to load — blocking gazelle for everyone. ## Fix - Point `swiftlint_lint` at `//scripts:swiftlint_bazel.sh` and `exports_files` it from `scripts/BUILD.bazel`. - `# gazelle:exclude go/pkg/agent/testdata` — now that gazelle loads again, it tried to generate a BUILD for the `camera_stream_plugin` test fixture; testdata isn't bazel-managed. ## Validation - `bazel build //:swiftlint_lint` — passes. - `bazel run //:gazelle -- go` — exits 0 (was failing to load the root package) and produces no churn. > Note: a separate *local-only* `bazel query //...` snag exists from gitignored `swift/FieldSurvey/.build` SPM checkouts — not included here since CI never checks those out. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(ci): repair root swiftlint_lint ref after scripts/ became a bazel package (#3425)
Some checks failed
Secret Scan / gitleaks (pull_request) Successful in 21s
Golang Tests / test-go (push) Successful in 1m28s
lint / lint (pull_request) Successful in 1m17s
lint / lint (push) Successful in 1m45s
CI / build (pull_request) Failing after 11m8s
2477c64a8e
#3496 added scripts/BUILD.bazel, making scripts/ a bazel package. That invalidated the
root //:swiftlint_lint target's `srcs = ["scripts/swiftlint_bazel.sh"]` (a target in //
can no longer reference a source file inside the scripts subpackage):

    ERROR: //:swiftlint_lint Label '//:scripts/swiftlint_bazel.sh' is invalid because
    'scripts' is a subpackage; perhaps you meant '//scripts:swiftlint_bazel.sh'

Because the root package was in error, `bazel run //:gazelle` (whose runner lives in //)
also failed to load.

- Point swiftlint_lint at `//scripts:swiftlint_bazel.sh` and export it from
  scripts/BUILD.bazel.
- `# gazelle:exclude go/pkg/agent/testdata` so gazelle stops generating a BUILD for the
  camera_stream_plugin test fixture (testdata is not bazel-managed).

Validated: `bazel build //:swiftlint_lint` passes; `bazel run //:gazelle -- go` exits 0
(was failing to load the root package) and produces no churn.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mfreeman451 left a comment

lgtm

lgtm
mfreeman451 deleted branch fix/ci-scripts-bazel-package 2026-06-01 14:05:51 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
carverauto/serviceradar!3499
No description provided.