Skip to content

fix(ci): break renovate changelog self-commit loop and sync workspace mirror - #864

Merged
c-vigo merged 1 commit into
release/0.4.0from
bugfix/863-renovate-changelog-loop
Jul 6, 2026
Merged

c-vigo merged 1 commit into
release/0.4.0from
bugfix/863-renovate-changelog-loop

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Fixes #863.

What was wrong

The Renovate changelog automation had two independent defects, both surfaced on #862 (which accrued 150+ identical empty commits before the build workflow was disabled by hand to stop it):

  1. Self-triggering loop. renovate-changelog-commit.yml pushes with a GitHub App token (re-triggers workflows); the build gated only on the PR author (permanently renovate[bot]), never the pusher, and commit-action has no empty-diff guard → the bot's own no-op commits fired fresh synchronize events without end.
  2. Stale workspace mirror (red CI). The bot committed only root CHANGELOG.md, leaving the scripts/manifest.toml mirror assets/workspace/.devcontainer/CHANGELOG.md stale, so the sync-manifest gate failed on every Renovate PR — independent of the loop.

Fix

  • Loop: guard both build jobs on github.event.sender.login != 'commit-action-bot[bot]', so a synchronize raised by the commit bot's push no longer starts a build. Net effect: exactly one changelog commit per Renovate PR.
  • Mirror: the build copies root CHANGELOG.md → the verbatim mirror and ships both in the artifact; renovate-changelog-commit.yml commits FILE_PATHS: CHANGELOG.md,assets/workspace/.devcontainer/CHANGELOG.md (precedent: prepare-release.yml).

Shipped copies under assets/workspace/.github/workflows/ regenerated via scripts/sync_manifest.py (identical to root).

Testing

CI-config + changelog only (no unit-testable logic). prek run --all-files green locally, including sync-manifest.

Operational note

renovate-changelog-build.yml is disabled manually right now to stop the active loop. Re-enable once this reaches dev (via sync-main-to-dev), then use #862 to validate the flow end-to-end.

… mirror

The changelog commit is pushed with a GitHub App token that re-triggers
workflows, but the build gated only on the PR author (permanently
renovate[bot]) and never the pusher, and commit-action has no empty-diff
guard -- so the bot's own no-op commits fired endless synchronize events
(#862 accrued 150+ empty commits). Guard both build jobs on
github.event.sender.login so the commit bot's push no longer starts a build.

The automation also committed only root CHANGELOG.md, leaving the
scripts/manifest.toml mirror assets/workspace/.devcontainer/CHANGELOG.md
stale and failing the sync-manifest gate on every Renovate PR. The build now
mirrors the verbatim copy and both files are committed (FILE_PATHS).

Refs: #863
@c-vigo
c-vigo merged commit defa77c into release/0.4.0 Jul 6, 2026
11 checks passed
@c-vigo
c-vigo deleted the bugfix/863-renovate-changelog-loop branch July 6, 2026 08:19
c-vigo added a commit that referenced this pull request Jul 6, 2026
Fixes #867. Cosmetic follow-up split out of #863 / PR #864.

## Problem

`insert_renovate_changelog_entry` appended entries at the **bottom** of
`## Unreleased → ### Changed`. With the `#### Modules` sub-heading
convention (#816), a Renovate dependency bump landed **under `####
Modules`**, misattributing it as a module change (seen on #862).

## Fix

Insert at the **top** of `### Changed` — a plain bullet above any `####`
sub-heading — reusing the existing post-heading offset, and add a
trailing blank line when the section opens with a heading so
Keep-a-Changelog spacing is preserved. The position-independent
idempotency guard (`_pr_marked_in_changed`) is unchanged.

## Testing (TDD)

- RED: `test_insert_above_subheading_in_changed` (fails on old code —
entry landed below `#### Modules`).
- GREEN: fix applied; renamed `test_insert_appends_to_changed_section` →
`test_insert_prepends_to_changed_section` and asserted top placement.
`uv run pytest packages/vig-utils/tests/test_renovate_changelog_pr.py` →
12 passed.
- Manual smoke: ran `renovate-changelog-pr` against a `#### Modules`
fixture — the bullet now sits above `#### Modules`.
- `prek run --all-files` green (incl. `sync-manifest`).

## Rollout note

The tool runs from the baked `renovate-changelog-pr` console script in
the published image, so this goes live for Renovate PRs after the next
image rebuild that bakes the updated `vig-utils`.
c-vigo added a commit that referenced this pull request Jul 6, 2026
…nv (#875)

## Description

Fixes the two residual defects in the Renovate changelog automation
surfaced when the workflow was re-enabled after #863/#864, verified live
on PRs #861/#862 (mirror missing from bot commit → `sync-manifest` red)
and #865/#866 (commit stage crash on parenthesized branch names).

Closes #874

## Type of Change

- [x] `fix` -- Bug fix

## Changes Made

- `Upload changelog artifact` step now sets `include-hidden-files: true`
— `upload-artifact` (≥ v4.4) silently excludes hidden directories,
dropping `assets/workspace/.devcontainer/CHANGELOG.md` from the artifact
so the commit workflow could never commit the mirror.
- `metadata.env` values are written with `printf '%s=%q'` instead of
unquoted `echo`, so grouped Renovate branch names
(`renovate/python-(minor-and-patch)`) survive being `source`d by
`renovate-changelog-commit.yml`.
- Workspace copy of the workflow updated via `sync-manifest`; changelog
entry added (root + mirror).

## Changelog Entry

### Fixed
- **Renovate changelog artifact drops the workspace mirror;
`metadata.env` breaks on parenthesized branches**
([#874](#874))
- `upload-artifact` silently excluded the mirror under the hidden
`.devcontainer` directory, so the bot commit updated only the root
`CHANGELOG.md` and tripped the `sync-manifest` gate; now uploaded with
`include-hidden-files: true`.
- `metadata.env` values are `%q`-quoted so grouped Renovate branch names
(e.g. `renovate/python-(minor-and-patch)`) survive being `source`d by
the commit workflow.

## Testing

- Workflow-YAML-only change — TDD exception (non-testable config).
- Root cause confirmed empirically: downloaded the actual
`renovate-changelog` artifact from run 28799680160 (PR #862) — it
contains only `CHANGELOG.md` + `metadata.env`, no mirror; commit-stage
failures for #865/#866 (runs 28799792964 / 28799804936) show
`metadata.env: line 3: syntax error near unexpected token '('`.
- Full pre-commit suite green locally (`just precommit`, exit 0, all
files).
- End-to-end verification after merge: re-tick the rebase checkboxes on
#861/#862/#865/#866 — Renovate rewrites the branches, the automation
must add one bot commit per PR touching both changelogs, with green
`sync-manifest`.
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