Repository navigation
generator: stamp tend version into workflow header - #316
Conversation
Every generated workflow now starts with `# Generated by tend X.Y.Z.` instead of `# Generated by tend.`, giving downstream nightly regen a stable anchor for detecting version bumps regardless of what templates pin for uvx or the action tag. Update plugins/tend-ci-runner/skills/nightly/SKILL.md Step 6 to read that anchor before and after `uvx tend@latest init`, surface the bump in the PR title (`chore: update tend workflows (A -> B)`), and include a `git diff --stat` summary in the body. Pre-stamp workflows produce an empty OLD_VER, and the renderer omits the version line when either side is empty or both sides match. Closes #313.
tend-agent
left a comment
There was a problem hiding this comment.
The stamp-in-header approach cleanly supersedes the template-regex fallback from #314 — one anchor per file, independent of what templates pin. Shell logic in plugins/tend-ci-runner/skills/nightly/SKILL.md handles the three transitional cases correctly (empty OLD, equal OLD/NEW, real bump), and the semver ERE matches the format importlib.metadata.version("tend") produces for the current pyproject.toml.
One release-maintenance concern worth flagging: the regtest snapshots now pin the literal version string (# Generated by tend 0.0.16. × 16 files). Every subsequent version = "X.Y.Z" bump in generator/pyproject.toml will fail uv run pytest until all 16 snapshots are regenerated with --regtest-reset. The release skill at .claude/skills/release/SKILL.md doesn't currently mention this step. Two options:
- Scrub the version in the existing
conftest.pyregister_converter_prehook (e.g.re.sub(r'# Generated by tend [^.]+\.', '# Generated by tend X.Y.Z.', output)), so regtests only assert on structural content.test_extras_preserve_headeralready covers the "header is present" case viastartswith("# Generated by tend "). - Or add a snapshot-regen step to the release skill.
The first avoids ongoing churn entirely; the second accepts it as explicit release friction. Not a blocker either way.
Pin a placeholder (`X.Y.Z`) in the workflow header instead of the literal version, so a `version = ...` bump in `generator/pyproject.toml` doesn't rewrite all 16 regtest snapshots. `test_extras_preserve_header` already asserts the header is present. Addresses review feedback on #316. Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
Applied option 1 — added a |
## Summary - Bumps generator version 0.0.16 → 0.0.17 - 57 commits since 0.0.16; the headline change is #375 (gate fork-exposed scheduled workflows on `github.repository_owner` so consumer-repo forks no-op on the cron and stop generating cross-repo CheckSuite notifications back to `tend-agent`) - Other notable changes: workflow header stamps tend version (#316), bot-token rebound to `GITHUB_TOKEN` (#373), review skill draft/light-mode + polling improvements (#308, #311, #315, #362) ## Test plan - [x] `uv run pytest` — 188 passed - [x] `pre-commit run --all-files` — clean - [ ] After merge: tag 0.0.17, PyPI publishes, regenerate tend's own workflows with `uvx tend@latest init` Co-authored-by: Claude <[email protected]>
## Summary Regenerates `.github/workflows/tend-*.yaml` against the freshly published 0.0.17. Brings tend's own deployment in line with what consumers will see after their nightly regen: - **Fork guard (#375)**: scheduled jobs now carry `if: github.repository_owner == 'max-sixty'`, so forks of tend (or fork-of-fork chains) no-op on the cron instead of failing on missing secrets and pinging `tend-agent` with cross-repo CheckSuite notifications. - **Header (#316)**: workflow comment now reports the generator version it was rendered from. - **GITHUB_TOKEN rebind (#373)**: the bot token is now exported as `GITHUB_TOKEN` (previously `GH_TOKEN`). ## Test plan - [x] `uvx [email protected] init` produced a clean diff (8 files, +19/-16) limited to header, `if:` guard, and the token env-var rename - [ ] Watch tomorrow's scheduled runs to confirm the guard does not gate out tend's own canonical workflow Co-authored-by: Claude <[email protected]>
Summary
# Generated by tend 0.0.16.instead of# Generated by tend., viaimportlib.metadata.version("tend")ingenerator/src/tend/workflows.py.plugins/tend-ci-runner/skills/nightly/SKILL.mdStep 6 to read that anchor from the workflow YAML before and afteruvx tend@latest init, surface the bump in the PR title (chore: update tend workflows (A → B)), and include agit diff --statsummary in the body.uvx tend@…or themax-sixty/tend@v1action tag, so detection works on tend itself (where neither template embeds a concrete version today) and on downstream repos that pin tolatest.OLD_VER; renderer omits the version line when either side is empty or both sides match, so the transitional regen (before / after this ships) won't printunknown → 0.0.17.Test plan
uv run pytestingenerator/— 164 passed (regtest snapshots refreshed for all 8 workflows × minimal + with-setup parameterizations).pre-commit runon touched files — trim whitespace, ruff, typos, bang-backtick guard all pass.uvx tend@latestcarry this change) will be the first to showA → Bwhen tend is bumped.