Skip to content

feat(anvil): replace legacy CI with aggregate gate - #158

Open
martin-kolinek wants to merge 6 commits into
mainfrom
drop-old-checks
Open

feat(anvil): replace legacy CI with aggregate gate#158
martin-kolinek wants to merge 6 commits into
mainfrom
drop-old-checks

Conversation

@martin-kolinek

Copy link
Copy Markdown
Collaborator

🤖 ## Summary

  • replace the legacy main and nightly workflows with generated Anvil PR and scheduled workflows
  • add one stable PR Job / Required Anvil checks aggregate context covering impact analysis plus fast, test, MSRV, runtime-analysis, and mutation matrices
  • move generic developer operations into generated Anvil recipes with native Just options
  • remove the duplicate root Just tree, constants.env, legacy check scripts/action, and obsolete version-update scripts
  • bump cargo-anvil to 0.8.0 and update generated artifacts, snapshots, READMEs, and contributor guidance

Developer UX

just anvil-build [--package <name>] [--profile <name>]
just anvil-doc-build [--open]
just anvil-examples [--run] [--package <name>] [--example <name>] [--timeout <seconds>]
just anvil-fmt [--fix]
just anvil-miri [--package <name>] [--test <filter> | --example <name>]
just anvil-readme [--fix]

Unfiltered example execution honors [package.metadata.anvil.examples].no-run; explicit example selection overrides the default exclusion.

Required rollout action

Before merging, update repository ruleset 15650058 to require PR Job / Required Anvil checks instead of the contexts emitted by the deleted legacy workflow. Keep unrelated requirements such as license/cla and CodeQL policy. Otherwise the repository will wait for deleted checks after merge.

Validation

  • cargo-anvil unit, integration, recipe-contract, schema, snapshot, and doctest suites
  • cargo-anvil Clippy with all targets/features and warnings denied
  • clean cargo anvil --dry-run
  • generated README and formatting fix paths
  • just anvil-pr-fast
  • just anvil-build --package cargo-anvil
  • just anvil-examples --run

The complete local just anvil-pr tier reached the upstream anvil-pr-msrv group. Two separate runs failed in two different timing-sensitive cargo-gamma-lib census integration tests; one failed test passed immediately in isolation. No cargo-anvil or cutover check failed.

Add a stable required-check context, consolidate generic developer recipes into cargo-anvil, remove obsolete legacy workflows and version plumbing, and bump cargo-anvil to 0.8.0.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 4, 2026 06:52

Copilot AI 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.

🔵 Needs a closer look

It changes core CI/workflow gating and repository-wide developer/verification tooling, so a final human review is needed to validate the end-to-end rollout and branch protection update.

Pull request overview

This PR migrates the repository from the legacy main/nightly GitHub Actions setup to Anvil-generated workflows and recipes, including a single aggregate required check context intended for branch protection/rulesets.

Changes:

  • Replace legacy CI workflows with Anvil-generated PR + scheduled workflows, adding an aggregate required-checks job that produces the PR Job / Required Anvil checks context.
  • Move/expand developer-facing operations into the generated Anvil justfile tree (build/docs/examples/fmt/miri/readme), and remove legacy scripts and the old root justfile wrappers/constants.
  • Bump cargo-anvil to 0.8.0 and refresh generated artifacts, snapshots, and documentation to match.
File summaries
File Description
scripts/update_tool_versions.ps1 Removed legacy constants/env-driven tool version updater.
scripts/update_rust_toolchain.ps1 Removed legacy toolchain updater (constants/env + rust-toolchain edits).
scripts/update_action_versions.ps1 Removed legacy workflow action-version updater.
scripts/run-examples.ps1 Removed legacy example runner in favor of Anvil recipe.
scripts/mutants.rs Removed legacy script-based mutation runner (now Anvil-managed).
scripts/check-external-types.rs Removed legacy script-based external-types check (now Anvil-managed).
rust-toolchain.toml Drops obsolete comment referencing removed constants env.
README.md Updates CI workflow references and documents Anvil tiers + developer recipes + version pin locations.
justfiles/spelling.just Removed legacy spelling recipe (now Anvil-managed).
justfiles/setup.just Removed legacy install-tools recipe (now Anvil-managed).
justfiles/format.just Removed legacy formatting recipes (now Anvil-managed).
justfiles/coverage.just Removed legacy coverage recipes (now Anvil-managed).
justfiles/basic.just Removed legacy “basic” command suite in favor of Anvil recipe tree.
justfiles/anvil/mod.just Imports new developer utility recipe file(s).
justfiles/anvil/dev/build.just Adds generated developer anvil-build recipe.
justfiles/anvil/checks/readme-check.just Adds anvil-readme --fix convenience wrapper over readme check/generate.
justfiles/anvil/checks/miri.just Adds developer targeting options (--package/--test/--example) while preserving default behavior.
justfiles/anvil/checks/llvm-cov.just Removes legacy-recipe reference from coverage rationale comment.
justfiles/anvil/checks/fmt.just Adds anvil-fmt --fix option for local formatting.
justfiles/anvil/checks/examples.just Adds --run/--package/--example/--timeout local execution support with no-run metadata honor.
justfiles/anvil/checks/doc-build.just Adds --open option for local doc generation.
Justfile Removes legacy root imports/dotenv wiring; leaves Anvil-managed import.
DEVELOPMENT.md Updates onboarding/validation commands to Anvil recipes and tiers.
crates/README.j2 Updates CI badge to the Anvil PR workflow.
crates/cargo-heather/README.md Regenerated README (CI badge + dependency-info blob update).
crates/cargo-gamma/README.md Regenerated README (CI badge update).
crates/cargo-gamma-unsafe/README.md Regenerated README (CI badge update).
crates/cargo-gamma-rt/README.md Regenerated README (CI badge update).
crates/cargo-gamma-process/README.md Regenerated README (CI badge update).
crates/cargo-gamma-lib/README.md Regenerated README (CI badge update).
crates/cargo-gamma-engine/README.md Regenerated README (CI badge update).
crates/cargo-gamma-attrs/README.md Regenerated README (CI badge update).
crates/cargo-gamma-attrs-impl/README.md Regenerated README (CI badge update).
crates/cargo-ensure-no-default-features/README.md Regenerated README (CI badge update).
crates/cargo-each/README.md Regenerated README (CI badge update).
crates/cargo-coverage-gate/README.md Regenerated README (CI badge + dependency-info blob update).
crates/cargo-aprz/README.md Regenerated README (CI badge update).
crates/cargo-aprz-lib/README.md Regenerated README (CI badge update).
crates/cargo_ensure_no_cyclic_deps/README.md Regenerated README (CI badge update).
crates/automation/README.md Regenerated README (CI badge update).
crates/cargo-anvil/tests/snapshots/snapshots__local_only.snap Updates snapshot outputs for new recipes/options.
crates/cargo-anvil/tests/snapshots/snapshots__github_backend.snap Updates snapshot outputs for aggregate required-checks job and new recipes/options.
crates/cargo-anvil/tests/snapshots/snapshots__ado_backend.snap Updates snapshot outputs for new recipes/options.
crates/cargo-anvil/tests/recipe_contracts.rs Extends recipe contract tests to cover new developer options and new recipe behavior.
crates/cargo-anvil/templates/justfiles/anvil/mod.just Template updated to import new developer utility recipe file(s).
crates/cargo-anvil/templates/justfiles/anvil/dev/build.just New template for generated anvil-build recipe.
crates/cargo-anvil/templates/justfiles/anvil/checks/readme-check.just Template adds anvil-readme --fix convenience wrapper.
crates/cargo-anvil/templates/justfiles/anvil/checks/miri.just Template adds developer targeting options for Miri.
crates/cargo-anvil/templates/justfiles/anvil/checks/llvm-cov.just Template comment update (coverage rationale).
crates/cargo-anvil/templates/justfiles/anvil/checks/fmt.just Template adds --fix option for local fmt.
crates/cargo-anvil/templates/justfiles/anvil/checks/examples.just Template adds local example execution support (--run, exclusions, timeout).
crates/cargo-anvil/templates/justfiles/anvil/checks/doc-build.just Template adds --open option for docs build.
crates/cargo-anvil/templates/github/pr-impl-workflow.yml Template adds required-checks aggregate gate job.
crates/cargo-anvil/src/lib.rs Documents new developer-facing recipes/options in crate docs.
crates/cargo-anvil/src/anvil/artifacts/mod.rs Catalog now includes developer utility recipe artifacts.
crates/cargo-anvil/src/anvil/artifacts/justfile.rs Adds dev recipe file list and dev_files() artifact emission.
crates/cargo-anvil/README.md Regenerated README (docs updated for new developer recipes + version bump).
crates/cargo-anvil/docs/design/local.md Design docs updated to specify developer options and behavior.
crates/cargo-anvil/docs/design/github.md Design docs updated for aggregate required-checks gate context.
crates/cargo-anvil/docs/design/checks.md Design docs updated to describe new local-only options (--fix, --open, --run, etc.).
crates/cargo-anvil/Cargo.toml Bumps cargo-anvil version to 0.8.0.
constants.env Removed legacy constants file (toolchain/tool pins moved under Anvil versions catalog).
Cargo.lock Updates lockfile for cargo-anvil 0.8.0.
AGENTS.md Updates contributor guidance to use Anvil recipes/tiers (incl. readme generation command).
.github/workflows/nightly.yml Removes legacy nightly workflow.
.github/workflows/main.yml Removes legacy main workflow.
.github/workflows/anvil-pr-impl.yml Adds required-checks aggregate gate job.
.github/actions/setup/action.yml Removes legacy composite setup action (replaced by Anvil actions).
.anvil.lock Updates Anvil lock to 0.8.0 and includes new dev recipe artifact.
Review details
  • Files reviewed: 67/69 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.5%. Comparing base (cad5174) to head (87c4ce1).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main    #158     +/-   ##
=======================================
- Coverage   97.6%   97.5%   -0.1%     
=======================================
  Files        298     298             
  Lines      67348   66768    -580     
=======================================
- Hits       65763   65144    -619     
- Misses      1585    1624     +39     
Flag Coverage Δ
linux 97.5% <100.0%> (?)
linux-arm 97.5% <100.0%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Lead with the user problem and outcome, explain adoption before Just, and replace the implementation-heavy reference with a shorter standalone narrative.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 4, 2026 07:28

Copilot AI 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.

🔵 Needs a closer look

It replaces core CI/workflow infrastructure and build orchestration across many generated artifacts, which warrants final human validation of rollout/branch-protection behavior.

Review details
  • Files reviewed: 67/69 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Clarify setup scope, restore the linked check catalog and repository customization conventions, and replace the reading list with a concise design-doc pointer.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 4, 2026 08:00

Copilot AI 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.

🔵 Needs a closer look

It performs a broad CI/build-system cutover (workflows, required-check semantics, and developer tooling) that warrants final human review of rollout and branch-protection impacts.

Review details
  • Files reviewed: 67/69 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Replace the structural customization levels with guidance for rustfmt, Clippy, dependency policy, public API checks, spelling, coverage, Miri, Loom, examples, and scheduled reporting.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 4, 2026 08:54

Copilot AI 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.

🔵 Needs a closer look

AGENTS.md still documents just package=crate_name <recipe> even though the updated Justfile no longer defines a package variable, so the guidance is now incorrect.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

AGENTS.md:11

  • just package=crate_name <recipe> is legacy guidance that no longer matches the current Justfile: the root Justfile no longer defines a package variable, so this invocation will fail. Recommend updating this doc line to point people at Anvil’s impact scoping and the explicit --package <name> options on the few recipes that support it (e.g. anvil-build, anvil-examples, anvil-miri).
  • Files reviewed: 67/69 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Generate cargo-anvil verification guidance for the whole repository and keep root AGENTS.md focused on repository-specific rules.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 4, 2026 10:35

Copilot AI 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.

🔵 Needs a closer look

It makes broad, repository-wide CI/build-system changes (workflows, required contexts, and large generated surface area) where correctness depends on external ruleset/config rollout and end-to-end CI behavior.

Review details
  • Files reviewed: 71/73 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

# across pull-request and merge-group callers.
name: Required Anvil checks
if: always()
needs:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🤖: Non-blocking — The stable aggregate can silently stop gating a newly added validation job because its needs list is maintained separately from the workflow's job list.

Please add a contract test that compares the top-level validation jobs with required-checks.needs, excluding only required-checks itself. Today all seven jobs are represented, but without this guard a future job can run and fail while PR Job / Required Anvil checks remains green.

# Update behaviour: https://github.com/microsoft/ox-tools/blob/main/crates/cargo-anvil/docs/design/updates.md

# Build all targets and features for local development.
[arg("package", long, pattern='(?:[A-Za-z0-9_.-]+)?')]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🤖: Non-blocking — The new [arg(...)] attributes raise adopters' minimum just version to 1.46.0, but the generated compatibility guidance still documents only the earlier 1.44 [script(...)] requirement.

Please state the 1.46.0 minimum in the generated guidance and make the setup prerequisite report an actionable error for an older installed just. The setup action installs just only when it is absent, so an existing 1.44 or 1.45 binary will fail while parsing these imported recipes and make the entire Anvil recipe tree unavailable, including anvil-setup.

$start.UseShellExecute = $false
$start.RedirectStandardOutput = $true
$start.RedirectStandardError = $true
$start.Environment['ANVIL_EXAMPLE'] = '1'

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🤖: Non-blocking — The tests can pass without proving that an unfiltered runnable example actually starts, and they do not exercise the new timeout/process-tree termination path.

Please add an observable success fixture that fails unless ANVIL_EXAMPLE=1 and a sleeping fixture run with --timeout 1; assert the success marker, prompt failure, and target-specific timeout diagnostic. This pins both the child-environment contract and the Kill(true)/stream-draining behavior instead of only checking a zero exit from a selection that could be empty.

Emit a repository skill that preserves existing policy, aligns tool configuration, proves check equivalence, and removes duplicate infrastructure after initial cargo-anvil adoption.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 4, 2026 11:04

Copilot AI 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.

🔵 Needs a closer look

It replaces core CI/ruleset gating and deletes legacy infrastructure, so a human maintainer should validate rollout details (including required-context/ruleset changes) end-to-end.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

README.md:235

  • The repo deletes constants.env and documents Anvil’s version pins as living in justfiles/anvil/versions.just, but .delta.toml still lists constants.env as a workspace-level trip-wire input. Consider removing that entry (or replacing it with the new authoritative pin file if needed) to avoid keeping a stale, non-existent input in the impact configuration.
  • Files reviewed: 73/75 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

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.

3 participants