Skip to content

ci: reconcile anvil artifacts on Dependabot branches - #108

Draft
Evgenii (Vaiz) wants to merge 2 commits into
mainfrom
user/vaiz/anvil-dependabot-regen
Draft

ci: reconcile anvil artifacts on Dependabot branches#108
Evgenii (Vaiz) wants to merge 2 commits into
mainfrom
user/vaiz/anvil-dependabot-regen

Conversation

@Vaiz

Copy link
Copy Markdown
Contributor

Dependabot cannot run a binary, so a pull request that bumps a GitHub Action leaves cargo-anvil's emitted tree and .anvil.lock stale. Merging one as-is is worse than useless: anvil keys each artifact on disk-vs-lock and template-vs-lock, so an edit it did not make marks the file as repository-customized and it stops updating that file for good.

Add an anvil-regen workflow that reconciles those branches. It restores the emitted files to their base-branch state so the bump takes anvil's plain overwrite path, re-runs the generator, refreshes the insta snapshots, and pushes the result back onto the Dependabot branch. It runs on a schedule because workflows initiated by Dependabot get a read-only token and no secrets, and it needs its own push token because commits pushed with GITHUB_TOKEN do not start check runs.

Point Dependabot at the templates as well as the workflows, grouped by dependency name so both move in one pull request, and widen regenerate-check so drift on an anvil-owned file is visible on the pull request instead of only in the merge queue.

Evgenii (Vaiz) and others added 2 commits August 26, 2026 09:49
Dependabot cannot run a binary, so a pull request that bumps a GitHub
Action leaves cargo-anvil's emitted tree and .anvil.lock stale. Merging
one as-is is worse than useless: anvil keys each artifact on
disk-vs-lock and template-vs-lock, so an edit it did not make marks the
file as repository-customized and it stops updating that file for good.

Add an anvil-regen workflow that reconciles those branches. It restores
the emitted files to their base-branch state so the bump takes anvil's
plain overwrite path, re-runs the generator, refreshes the insta
snapshots, and pushes the result back onto the Dependabot branch. It
runs on a schedule because workflows initiated by Dependabot get a
read-only token and no secrets, and it needs its own push token because
commits pushed with GITHUB_TOKEN do not start check runs.

Point Dependabot at the templates as well as the workflows, grouped by
dependency name so both move in one pull request, and widen
regenerate-check so drift on an anvil-owned file is visible on the pull
request instead of only in the merge queue.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Match the repository's shell of record: the Justfile sets
script-interpreter to pwsh, so the recipes CI already runs are
PowerShell. Set it as the workflow-level default rather than per step.

The rewrite also drops two bash-isms that had no PowerShell counterpart
and were carrying risk: jq string-wrapping to build the matrix JSON
(ConvertTo-Json -InputObject does it without unrolling a single-element
array), and `git diff --cached --quiet`, whose exit code 1 means "there
are changes" and would have been read as a failure.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.9%. Comparing base (916eb71) to head (2fe1581).

❌ Your project status has failed because the head coverage (99.9%) is below the target coverage (100.0%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #108   +/-   ##
=====================================
  Coverage   99.9%   99.9%           
=====================================
  Files        135     135           
  Lines      17449   17449           
=====================================
  Hits       17448   17448           
  Misses         1       1           
Flag Coverage Δ
linux 99.9% <ø> (?)
linux-arm 99.9% <ø> (?)
windows 99.9% <ø> (?)

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.

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.

2 participants