Skip to content

Commit c352c47

Browse files
authored
rules_go: add registry-backed multi-version fork support (#174)
* rules_go: add base patch profile architecture * docs: document rules_go upstream patch workflow * go: reject legacy complete strip prefix * rules_go: fix Orchestrion module metadata cache * uploader: filter cached Bazel test payloads with BEP * go: format bootstrap validation test * uploader: skip empty outputs before freshness gates * go: resolve validation BEP paths from workspace * doctor: enforce BEP freshness during discovery * go: use SDK GOROOT for module export lookups * go: shorten module export cache paths * go: clean up rules_go patch tooling * uploader: stage BEP remote artifacts Add BEP artifact staging support for doctor and uploader runtimes so remote-only or file-URI test.outputs can be materialized before payload discovery. Update integration fixtures, runtime parity coverage, docs, and Python unit fixtures for BEP-based artifact resolution. Validation: python3 -m unittest discover -s tools/tests/python -p 'test*_tools.py'; bash -n uploader/integration scripts; python3 -m py_compile doctor/helper/tests; PowerShell parser check for uploader runtime. * tests: fix BEP staging checks on Windows * uploader: fix BEP staging on Windows bash * uploader: normalize staged BEP output keys on Windows * tests: extend Python tools timeout * tests: shorten uploader smoke waits * tests: force staging mode in uploader smoke env * tests: pass BEP path to uploader smoke env * tests: skip PowerShell staging smoke on Windows * uploader: normalize PowerShell staged artifact paths * uploader: clean PowerShell staged artifact roots * uploader: isolate PowerShell staging stderr * uploader: tolerate PowerShell helper stderr * uploader: support selective BEP artifact flows * uploader: add BEP artifact staging workflow * ci: support empty Bash test flags on macOS * uploader: add diagnostic reports * uploader: report diagnostic no-upload reasons * test: normalize CI wrapper report paths * uploader: download HTTP BEP artifacts * uploader: log HTTP BEP artifact downloads * test-optimization: add support bundle diagnostics * test: make support bundle tests portable * test: simplify PowerShell support bundle smoke * test: use python command for Windows bundle smoke * test: provide Windows Python shim for bundle smoke * test: harden PowerShell support bundle smoke * test: avoid cmd shim in PowerShell bundle smoke * test: tolerate Windows short temp paths * test: avoid exact temp path checks on Windows * test: assert BEP downloader arguments * ci: fix PowerShell wrapper status capture * docs: remove plan artifacts from PR * uploader: enforce required BEP remote artifacts
1 parent 15b6d0a commit c352c47

2,243 files changed

Lines changed: 61111 additions & 4373 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bazelignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
bazel-bin
1010
bazel-out
1111
bazel-testlogs
12-
third_party/rules_go_orchestrion_base
13-
third_party/rules_go_orchestrion_complete
12+
third_party/rgo/v0_60_0/base
13+
third_party/rgo/v0_61_1/base
1414
tools/tests/rules_go_variant_regressions
1515
modules/go/bazel-bin
1616
modules/go/bazel-out

.github/workflows/ci.yml

Lines changed: 29 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
- name: Run Bazel tests
108108
timeout-minutes: 25
109109
shell: bash
110-
run: ./bazelw test //tools/...
110+
run: ./bazelw test //tools/... --test_output=errors
111111

112112
- name: Run Bazel tests (go companion module)
113113
if: matrix.os == 'ubuntu-latest'
@@ -254,7 +254,9 @@ jobs:
254254
rules-go-variant-smoke:
255255
needs: changes
256256
if: ${{ needs.changes.outputs.run_full_ci == 'true' }}
257-
timeout-minutes: 45
257+
# This job runs the smoke harness serially for every supported upstream.
258+
# Keep enough headroom as the registry grows.
259+
timeout-minutes: 75
258260
runs-on: ubuntu-latest
259261
steps:
260262
- name: Checkout
@@ -281,18 +283,19 @@ jobs:
281283
GO111MODULE=on go install github.com/bazelbuild/bazelisk@v1.28.1
282284
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
283285
284-
- name: Run vendored rules_go base smoke coverage
285-
shell: bash
286-
run: RULES_GO_VARIANT=base ./tools/dev/run_rules_go_variant_smoke.sh
287-
288-
- name: Run vendored rules_go complete smoke coverage
286+
- name: Run vendored rules_go smoke coverage
289287
shell: bash
290-
run: RULES_GO_VARIANT=complete ./tools/dev/run_rules_go_variant_smoke.sh
288+
run: |
289+
while IFS= read -r upstream; do
290+
RULES_GO_UPSTREAM="${upstream}" \
291+
RULES_GO_VARIANT="base" \
292+
./tools/dev/run_rules_go_variant_smoke.sh
293+
done < <(python3 tools/dev/materialize_rules_go_fork.py list-upstreams)
291294
292295
workspace-compat:
293296
needs: changes
294297
if: ${{ needs.changes.outputs.run_full_ci == 'true' }}
295-
timeout-minutes: 45
298+
timeout-minutes: 90
296299
runs-on: ubuntu-latest
297300
steps:
298301
- name: Checkout
@@ -314,53 +317,24 @@ jobs:
314317
GO111MODULE=on go install github.com/bazelbuild/bazelisk@v1.28.1
315318
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
316319
317-
- name: Validate WORKSPACE Go companion path (base, general)
318-
shell: bash
319-
run: |
320-
USE_BAZEL_VERSION=8.4.1 RULES_GO_VARIANT=base \
321-
./tools/tests/integration/run_workspace_go_integration.sh
322-
323-
- name: Validate WORKSPACE Go companion path (complete, general)
324-
shell: bash
325-
run: |
326-
USE_BAZEL_VERSION=8.4.1 RULES_GO_VARIANT=complete \
327-
./tools/tests/integration/run_workspace_go_integration.sh
328-
329-
- name: Validate Bzlmod Go companion path (base, general)
330-
shell: bash
331-
run: |
332-
USE_BAZEL_VERSION=8.4.1 RULES_GO_VARIANT=base \
333-
./tools/tests/integration/run_bzlmod_go_integration.sh
334-
335-
- name: Validate Bzlmod Go companion path (complete, general)
336-
shell: bash
337-
run: |
338-
USE_BAZEL_VERSION=8.4.1 RULES_GO_VARIANT=complete \
339-
./tools/tests/integration/run_bzlmod_go_integration.sh
340-
341-
- name: Validate WORKSPACE Go companion path (base, test_optimization)
342-
shell: bash
343-
run: |
344-
USE_BAZEL_VERSION=8.4.1 RULES_GO_VARIANT=base ORCHESTRION_MODE=test_optimization \
345-
./tools/tests/integration/run_workspace_go_integration.sh
346-
347-
- name: Validate WORKSPACE Go companion path (complete, test_optimization)
348-
shell: bash
349-
run: |
350-
USE_BAZEL_VERSION=8.4.1 RULES_GO_VARIANT=complete ORCHESTRION_MODE=test_optimization \
351-
./tools/tests/integration/run_workspace_go_integration.sh
352-
353-
- name: Validate Bzlmod Go companion path (base, test_optimization)
354-
shell: bash
355-
run: |
356-
USE_BAZEL_VERSION=8.4.1 RULES_GO_VARIANT=base ORCHESTRION_MODE=test_optimization \
357-
./tools/tests/integration/run_bzlmod_go_integration.sh
358-
359-
- name: Validate Bzlmod Go companion path (complete, test_optimization)
320+
- name: Validate Go companion consumer paths
360321
shell: bash
361322
run: |
362-
USE_BAZEL_VERSION=8.4.1 RULES_GO_VARIANT=complete ORCHESTRION_MODE=test_optimization \
363-
./tools/tests/integration/run_bzlmod_go_integration.sh
323+
while IFS= read -r upstream; do
324+
for mode in general test_optimization; do
325+
USE_BAZEL_VERSION=8.4.1 \
326+
RULES_GO_UPSTREAM="${upstream}" \
327+
RULES_GO_VARIANT="base" \
328+
ORCHESTRION_MODE="${mode}" \
329+
./tools/tests/integration/run_workspace_go_integration.sh
330+
331+
USE_BAZEL_VERSION=8.4.1 \
332+
RULES_GO_UPSTREAM="${upstream}" \
333+
RULES_GO_VARIANT="base" \
334+
ORCHESTRION_MODE="${mode}" \
335+
./tools/tests/integration/run_bzlmod_go_integration.sh
336+
done
337+
done < <(python3 tools/dev/materialize_rules_go_fork.py list-upstreams)
364338
365339
coverage-tools:
366340
needs: changes
@@ -485,6 +459,7 @@ jobs:
485459
run_schema_validation: true
486460
run_fixture_json_validation: true
487461
run_schema_parser_parity: true
462+
run_rules_go_fork_drift: true
488463

489464
# Policy: keep the hermetic lane Linux-only for now.
490465
# Rationale: sandbox/network-blocking semantics are most reliable on Linux;

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ jobs:
264264
run_schema_validation: true
265265
run_fixture_json_validation: false
266266
run_schema_parser_parity: true
267+
run_rules_go_fork_drift: true
267268

268269
release-docs-links:
269270
timeout-minutes: 10

.github/workflows/rules-go-variant-extended.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ jobs:
4242
GO111MODULE=on go install github.com/bazelbuild/bazelisk@v1.28.1
4343
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
4444
45-
- name: Run extended vendored rules_go base coverage
45+
- name: Run extended vendored rules_go coverage
4646
shell: bash
47-
run: RULES_GO_VARIANT=base ./tools/dev/run_rules_go_variant_extended.sh
48-
49-
- name: Run extended vendored rules_go complete coverage
50-
shell: bash
51-
run: RULES_GO_VARIANT=complete ./tools/dev/run_rules_go_variant_extended.sh
47+
run: |
48+
while IFS= read -r upstream; do
49+
RULES_GO_UPSTREAM="${upstream}" \
50+
RULES_GO_VARIANT="base" \
51+
./tools/dev/run_rules_go_variant_extended.sh
52+
done < <(python3 tools/dev/materialize_rules_go_fork.py list-upstreams)

.github/workflows/shared-validation.yml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ on:
4848
required: false
4949
type: boolean
5050
default: false
51+
run_rules_go_fork_drift:
52+
required: false
53+
type: boolean
54+
default: false
5155

5256
permissions:
5357
contents: read
@@ -103,7 +107,8 @@ jobs:
103107
run: |
104108
mapfile -t starlark_files < <(
105109
git ls-files -- \
106-
'*.bzl' 'BUILD' 'BUILD.bazel' 'WORKSPACE' 'MODULE.bazel'
110+
'*.bzl' 'BUILD' 'BUILD.bazel' 'WORKSPACE' 'MODULE.bazel' \
111+
':(exclude)third_party/rgo/**'
107112
)
108113
if (( ${#starlark_files[@]} == 0 )); then
109114
echo "No Starlark files found."
@@ -194,6 +199,43 @@ jobs:
194199
shell: bash
195200
run: python3 tools/core/schemas/check_schema_parser_parity.py
196201

202+
rules-go-fork-drift:
203+
if: ${{ !inputs.docs_only && inputs.run_rules_go_fork_drift }}
204+
timeout-minutes: 15
205+
runs-on: ubuntu-latest
206+
steps:
207+
- name: Checkout
208+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
209+
210+
- name: Set up Python
211+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
212+
with:
213+
python-version: ${{ inputs.python_version }}
214+
215+
- name: Set up Go
216+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
217+
with:
218+
go-version: "1.25.0"
219+
220+
- name: Verify Go toolchain for generated rules_go maps
221+
shell: bash
222+
run: |
223+
go version
224+
command -v gofmt
225+
226+
- name: Verify rules_go fork registry and materialized trees
227+
shell: bash
228+
run: |
229+
python3 tools/dev/generate_rules_go_fork_maps.py --check
230+
RULES_GO_ORCHESTRION_CACHE="${RUNNER_TEMP}/rules_go_orchestrion_cache" \
231+
python3 tools/dev/materialize_rules_go_fork.py check --all
232+
python3 tools/dev/verify_rules_go_profiles.py \
233+
--public-denylist tools/dev/private_leak_public_denylist.txt
234+
235+
- name: Verify rules_go fork release archive contents
236+
shell: bash
237+
run: python3 tools/dev/check_release_archive_contents.py
238+
197239
powershell-lint:
198240
if: ${{ !inputs.docs_only && inputs.run_powershell_lint }}
199241
timeout-minutes: 20

0 commit comments

Comments
 (0)