Skip to content

go: share synthetic testmain helpers - #241

Merged
tonyredondo merged 3 commits into
feature/bep-skipped-targetsfrom
feature/shared-synthetic-testmain-helpers
Sep 3, 2026
Merged

tonyredondo merged 3 commits into
feature/bep-skipped-targetsfrom
feature/shared-synthetic-testmain-helpers

Conversation

@tonyredondo

Copy link
Copy Markdown
Member

Summary

  • build the target-independent Orchestrion helper closure once per Test Optimization stdlib and toolchain configuration
  • reuse one content-addressed helper bundle from every compatible synthetic testmain compile and link, with a conservative fallback when target archives overlap the shared graph
  • keep test targets and their target-specific actions under no-remote-exec while leaving the instrumented stdlib and shared bundle eligible for remote execution and caching
  • expose the shared bundle through the stdlib warmup target and add structural and builder regression coverage for all maintained rules_go forks

Performance

A controlled two-target fixture benchmark with separate clean output roots, 8 jobs, and Bazel disk and remote caches disabled measured:

  • end-to-end Bazel time: 55.003s to 52.392s, about 4.7% faster
  • synthetic helper and testmain action time: 1.802s to 1.009s, about 44% less work

The larger dd-source workload has not been measured yet; this stacked PR intentionally leaves dd-source unchanged.

Validation

  • focused builder and stdlib warmup Bazel tests passed
  • full v0.60.0 Bzlmod Orchestrion integration passed
  • v0.61.1 and v0.62.0 integration smoke tests passed
  • all 84 modules/go tests passed
  • isolated Bzlmod and WORKSPACE consumer E2Es passed
  • fork maps, module versions, generated patch materialization, Python compilation, buildifier, gofmt, and git diff checks passed
  • the root //... run passed 470 tests before an unrelated local Java 21 versus Java 25 toolchain mismatch left 19 targets without status
  • the profile verifier completed v0.60.0 and part of v0.61.1 before its predeclared 10-minute local limit

@tonyredondo
tonyredondo requested a review from a team as a code owner September 3, 2026 05:10

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Datadog Autotest: FAIL

The shared helper action does not declare C toolchain files. A non-pure Go build can fail when a helper dependency needs cgo in a sandbox or on a remote worker.

Open Bits AI session

🤖 Datadog Autotest · Commit da7f5fb · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

Comment thread third_party/rgo/v0_60_0/base/go/private/actions/stdlib.bzl
@tonyredondo
tonyredondo merged commit c969c7d into feature/bep-skipped-targets Sep 3, 2026
97 checks passed
@tonyredondo
tonyredondo deleted the feature/shared-synthetic-testmain-helpers branch September 3, 2026 15:40
tonyredondo added a commit that referenced this pull request Sep 3, 2026
* uploader: handle platform-skipped expected targets

* go: share synthetic testmain helpers (#241)

* go: share synthetic testmain helpers

* go: declare C toolchain for shared helpers

* tests: allow host C compilers in aquery checks

* uploader: detect skipped cached test results

* rules_go: normalize compiler paths for stdlib seeding
tonyredondo added a commit that referenced this pull request Sep 7, 2026
* go: update Orchestrion integration to v1.12.0

* go: preserve exact tracer pins in offline proxy

* fix: invalidate incomplete Orchestrion bootstrap caches

* go: wait for active Orchestrion cache owners

* build: refresh Orchestrion extension lock

* uploader: preserve valid payloads after partial failures

* go: guard Orchestrion resolver package cycles

* go: expose SDK headers to instrumented links

* go: make resolver cycle patch line-ending safe

* go: isolate runtime data tools from Orchestrion

* uploader: batch CODEOWNERS enrichment

* go: mirror rules_go inferred test importpaths

* test: make importpath assertion module-relative

* runfiles: preserve external repository aliases

* python: materialize selected metadata runfiles

* tests: share Python selector stub repository

* uploader: split and validate outbound test payloads

* uploader: remove payloads from read-only output trees

* tests: isolate uploader transport fixtures

* go: add Test Optimization stdlib warmup target

* go: make disabled stdlib warmup a no-op

* go: match go_test transitions in stdlib warmup

* Address remaining review feedback

* docs: plan deterministic stdlib cache publication

* Fix final review findings

* docs: align validated uploader guidance

* rules_go: make stdlib cache outputs deterministic

* rules_go: stabilize declared stdlib cache paths

* uploader: preserve partial upload progress

* uploader: persist retries from read-only outputs

* uploader: support Windows PowerShell partial retries

* uploader: support PowerShell 5.1 payload cleanup

* go: add static Test Optimization targets

* uploader: support runtime selection on Bash 3

* tests: render runtime selection in PowerShell harness

* doctor: ignore ordinary mixed-run artifacts

* uploader: redact runtime context paths

* uploader: add opt-in parallel Python runtime (#233)

* uploader: add opt-in parallel Python runtime

Introduce a cross-platform Python uploader with bounded file workers, shared CODEOWNERS preparation, preventive 4.5 MiB splitting, retries, dry-run, debug diagnostics, and final statistics.

Keep the legacy runtimes as the default during rollout and document the remaining cross-platform and consumer validation gates.

* uploader: preserve no-op and report compatibility

* uploader: resolve Windows batch runfiles manifest

* tests: use host Python for Windows launcher smoke

* tests: isolate PowerShell runfiles resolution

* tests: use native Windows launcher smoke

* uploader: preserve all-cached no-op

* uploader: preserve manifest-only runfiles context

* tests: normalize propagated manifest path

* docs: document Python uploader rollout

* uploader: short-circuit all-cached discovery

* uploader: require complete cached target coverage

* uploader: support FIPS workspace lock naming

* uploader: report end-to-end elapsed time

* uploader: close parallel runtime review gaps

Preserve cross-runtime lock and CODEOWNERS lookup parity, validate endpoint ports, and reject non-standard JSON before upload.

Expand split, retry, replay, backpressure, launcher, and dry-run coverage and align the migration tracker and troubleshooting docs.

* uploader: harden upload preflight and retry handling

* uploader: simplify Python implementation for review

Reduce orchestration and transport duplication, clarify module boundaries and lifecycle reporting, and centralize uploader test runfile setup. Keep the existing uploader behavior while making the implementation and migration tracker easier to review and maintain.

Validated with the 449-test Python tooling suite, all 199 //tools tests, shellcheck, PowerShell parsing, buildifier, compileall, and git diff checks.

* uploader: clarify worker and reporting models

Use domain-specific names for telemetry, result, resource, and legacy-report state. Remove a redundant report wrapper and unused telemetry property while preserving configuration precedence and output contracts.

Validated with the 449-test Python tooling suite, all 199 //tools tests, template lint, compileall, and git diff checks.

* uploader: clarify runtime data flow

Distinguish HTTP outcomes from file results, give resource and telemetry state domain-specific names, and replace string-based report aggregation with explicit fields. Remove stale rule commentary while preserving runtime and report contracts.

Validated with the 449-test Python suite, all 199 //tools tests, compileall, template lint, buildifier, and git diff checks.

* uploader: simplify discovery and split flow

Share payload-type counting across discovery filters and replace terse enrichment, splitting, and runfiles names with domain-specific ones. Preserve unsupported-type handling while removing duplicated aggregation code.

Validated with the 449-test Python suite, all 199 //tools tests, compileall, template lint, and git diff checks.

* uploader: clarify prepared HTTP delivery

Pass PreparedHttpRequest through the transport boundary intact and distinguish prepared requests, body streams, HTTP requests, response excerpts, and transport failures. Reuse canonical payload counters for empty discovery.

Validated with the 449-test Python suite, all 199 //tools tests, compileall, template lint, and git diff checks.

* uploader: clarify runtime state and ownership

* uploader: default to eight workers and harden I/O

* uploader: select a compatible Python interpreter

* uploader: log bounded HTTP errors in debug mode

* uploader: make Python implementation the default

* uploader: validate enrichment during uploads

Allow the Python uploader to match the Bash and PowerShell contract, and retain stable freshness/result log markers for existing integrations.

* uploader: delete payloads from read-only directories

* uploader: close default Python parity gaps

* uploader: isolate discovery and context failures

* uploader: preserve failed split chunks

* uploader: retry telemetry requests independently

* uploader: move enrichment details to debug logs

* uploader: report request-level partial delivery

* uploader: harden partial upload recovery

* uploader: ignore empty test output directories

* fix: preserve payloads across attempts and remote workers

Treat an expected Bazel target as accounted for when any fresh attempt produces a payload, while retaining the all-empty failure.

Publish Orchestrion's action-local synthetic testmain helper archives as declared Bazel outputs so final linking remains portable across sandboxes and remote workers.

Add uploader, builder, and aquery regressions for both failure modes.

* uploader: process valid outputs before coverage errors

* uploader: handle platform-skipped expected targets (#242)

* uploader: handle platform-skipped expected targets

* go: share synthetic testmain helpers (#241)

* go: share synthetic testmain helpers

* go: declare C toolchain for shared helpers

* tests: allow host C compilers in aquery checks

* uploader: detect skipped cached test results

* rules_go: normalize compiler paths for stdlib seeding

* rules_go: preserve execroot cwd for cached stdlib lookup

* rules_go: wrap CGO paths for cached stdlib lookup

* rules_go: keep CGO helpers in full builder

* fix: normalize CGO paths for Go subprocesses

* fix: keep module proxy usable by partial Go builders

* rules_go: isolate stdlib cache from ordinary links

* go: scope no-remote-exec to TestRunner (#243)

* go: add rules_go v0.63.0 support (#244)

* go: add rules_go v0.63.0 support

* ci: use bzlmod for rules_go v0.63 nested tests
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.

1 participant