Skip to content

Add guardrail against Bazel legacy C++ feature regressions#102

Open
nradakovic wants to merge 1 commit into
mainfrom
nira_add_guard_test
Open

Add guardrail against Bazel legacy C++ feature regressions#102
nradakovic wants to merge 1 commit into
mainfrom
nira_add_guard_test

Conversation

@nradakovic

Copy link
Copy Markdown
Member

Add no_legacy_features_guard_test, an analysis-driven test rule under tests/guardrails/ that resolves the active C++ toolchain and fails as a test if the explicit-feature contract regresses -- i.e. the no_legacy_features marker is no longer enabled or a Bazel implicit legacy feature (legacy_compile_flags, legacy_link_flags, sysroot) becomes active again. The verdict is deterministic and surfaced via the test's exit status, so it needs no target hardware and runs on any --config.

Wire the new guardrail_tests suite into every platform CI workflow and document what it validates and how to interpret failures in tests/guardrails/README.md and docs/tests_and_validation.md.

resolves #82

Add no_legacy_features_guard_test, an analysis-driven test rule under
tests/guardrails/ that resolves the active C++ toolchain and fails as a
test if the explicit-feature contract regresses -- i.e. the
no_legacy_features marker is no longer enabled or a Bazel implicit legacy
feature (legacy_compile_flags, legacy_link_flags, sysroot) becomes active
again. The verdict is deterministic and surfaced via the test's exit
status, so it needs no target hardware and runs on any --config.

Wire the new guardrail_tests suite into every platform CI workflow and
document what it validates and how to interpret failures in
tests/guardrails/README.md and docs/tests_and_validation.md.

resolves #82
@nradakovic nradakovic self-assigned this Jul 15, 2026
Copilot AI review requested due to automatic review settings July 15, 2026 15:57
@nradakovic nradakovic requested a review from antonkri as a code owner July 15, 2026 15:57
@nradakovic nradakovic added documentation Improvements or additions to documentation wip Work in progress unit test Add or update unit tests p3 Medium/Low - handle it within normal process labels Jul 15, 2026
@nradakovic nradakovic moved this from Backlog to In Progress in S-CORE Roadmap Jul 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds an analysis-driven Bazel test guardrail to prevent regression back to Bazel’s implicit legacy C/C++ feature behavior, and wires it into CI plus documentation so regressions are detected deterministically across supported --configs.

Changes:

  • Introduces no_legacy_features_guard_test (Starlark test rule) to assert the no_legacy_features contract and detect re-enabled Bazel legacy features.
  • Adds a guardrail_tests suite and runs it in platform CI workflows.
  • Documents the new guardrail and test workspace structure.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/guardrails/README.md Documents what the guardrail checks, how to run it, and how to interpret failures.
tests/guardrails/legacy_feature_guard.bzl Implements the analysis-driven guardrail test rule that resolves the active C++ toolchain and checks the explicit-feature contract.
tests/guardrails/BUILD Declares the no_legacy_features_guard_test target in the guardrails package.
tests/BUILD Adds guardrail_tests test suite aggregating the new guardrail target.
docs/tests_and_validation.md Documents the new tests/guardrails/ area and links to interpretation guidance.
.github/workflows/x86_64-linux.yml Runs the new guardrail suite in the x86_64 Linux CI workflow.
.github/workflows/autosd.yml Runs the new guardrail suite in the AutoSD CI workflow.
.github/workflows/aarch64-linux.yml Runs the new guardrail suite in the aarch64 Linux CI workflow.
.github/workflows/aarch64-ebclfsa.yml Runs the new guardrail suite in the EBcLfSA CI workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +41 to +42
CI runs the guardrail for every platform config (see the workflows under
`.github/workflows/`).
Comment on lines +42 to +44
- name: Guardrail (no legacy features)
run: |
bazel test --config=x86_64-linux -- //:guardrail_tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation p3 Medium/Low - handle it within normal process unit test Add or update unit tests wip Work in progress

Projects

Status: In Progress
Status: In Progress

Development

Successfully merging this pull request may close these issues.

Add a guardrail test to prevent future reintroduction of Bazel legacy feature dependencies

2 participants