Repository navigation
fix(companion-freshness): compare against htpx's latest release, not main - #376
Merged
Merged
Conversation
…main The companion advances on htpx release tags (#296, #297, #359), but the scheduled freshness check compared companion_sha with htpx main. main takes CI-only bot commits between releases that never reach the corpus, so the check sat red for eight weeks after v3.3.0 over two of them and would have gone red again after every sync. "Current" now means the newest vX.Y.Z release commit is the vendored commit or an ancestor of it. Ancestry needs history, so the check fetches htpx's commits only (--filter=tree:0) into a throwaway bare repo; a lock synced past the release, like #375's, stays current. Pre-release tags are ignored, a companion_sha upstream does not have is a hard failure (exit 1) instead of a false "behind", and with no release tags upstream the check falls back to the branch tip. A behind result names the exact `scripts/sync-companion.sh --ref <tag>` to run, and the workflow summary and Makefile help say "latest release". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Ignored tag-listing failures can still cause false drift reports, while incomplete branch fetching can incorrectly flag valid companion locks as broken.
2 open issues
What changed in this PR
This PR aligns companion freshness checks with htpx’s release-based updates, avoiding false drift alerts from commits added to main between releases.
Changes:
- Compare the vendored commit with the latest stable release tag, accepting commits that include that release’s history.
- Add ancestry checks and invalid-lock detection, with branch-tip fallback when no releases exist.
- Update sync guidance, workflow summaries, Makefile help, and the changelog.
| File | Description |
|---|---|
test/check-companion-freshness.sh |
Adds release selection, ancestry checks, and release-specific remediation. |
Makefile |
Updates companion-check help to reference the latest release. |
CHANGELOG.md |
Documents the revised freshness behavior. |
.github/workflows/companion-freshness.yml |
Updates drift summaries and release-sync guidance. |
Review effort: Balanced
Gerrrt
enabled auto-merge (squash)
November 23, 2026 21:27
…ranch, one Changed heading A failed `ls-remote --tags` used to leave REL_TAG empty exactly like an upstream with no releases, and fall back to comparing with main: the false drift this check exists to stop reporting. The listing's status is now checked on its own, and only a successful empty listing falls back. The ancestry fetch took only companion_branch, but `sync-companion.sh --ref <branch>` can lock a commit on another branch without changing that field, which the check would then call broken. It now fetches every branch head plus all tags. CHANGELOG: the entry moves into the existing `### Changed` section; a second one under [Unreleased] failed markdownlint MD024. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What & why
The companion advances on htpx release tags (htpx's fan-out; #296, #297 and #359 were all tag syncs), but
test/check-companion-freshness.shcomparedcompanion_shawith htpxmain.maintakes CI-only bot commits between releases that never touch the corpus, so the scheduledcompanion-freshnessrun sat red for eight weeks after v3.3.0 over two of them (#375 cleared it). It would go red again after every sync.New rule: the companion is current when the newest
vX.Y.Zrelease commit is the vendored commit or an ancestor of it.--filter=tree:0, no trees or blobs) into a throwaway bare repo and runsgit merge-base --is-ancestor. Equality alone, whichcheck-core-freshness.shuses for core's exact release pins, would call a past-the-release lock such as chore(companion): sync htpx → main (v3.3.0-2-g1901625) #375's "behind".v3.4.0-rc1isn't a release, andsort -Vwould rank it above the final.companion_shaupstream doesn't have is now a hard failure (exit 1) instead of a misleading "behind".scripts/sync-companion.sh --ref <tag>to run. The workflow summary andmake companion-checkhelp now say "latest release".Checks
Ran the script against live htpx with
companion.locktemporarily set to each state:main(v3.3.0 + 2)current — 2 commit(s) past v3.3.0, exit 0@v3.3.0, suggests--ref v3.3.0, exit 2make lint:bash -nand the return-trap check pass. shellcheck and markdownlint aren't installed locally, so CI's pinned ones cover them.🤖 Generated with Claude Code