Skip to content

fix(comment-release-fixes): skip release tags with no common ancestor - #12

Merged
jdx merged 1 commit into
mainfrom
fix/skip-disjoint-release-tags
Oct 20, 2026
Merged

jdx merged 1 commit into
mainfrom
fix/skip-disjoint-release-tags

Conversation

@jdx

@jdx jdx commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

The release-fix comment job aborts for repos whose release list includes tags from a disjoint history. For hk's v2.8.0 it compared against v0.1.9 … v0.1.1, got `No common ancestor` (HTTP 404) for each, and failed with `cannot safely establish release ancestry` before ever considering v2.7.1 or v2.7.0 (run 39480695287).

A tag with no common ancestor cannot be an earlier release contained in the target, so `base_release` now skips it. Every other comparison error (other 404s, 5xx, etc.) still fails closed, and the closest contained release is still chosen as the base, so the range never widens past a verified ancestor.

Added a test where an older tag has no common ancestor and the base resolves to the nearest real ancestor; the existing fail-closed test still passes (17 tests OK).

Once released, hk needs its `comment-release-fixes.yml` pin bumped, and the v2.8.0 comments can be backfilled via `workflow_dispatch`.

🤖 Generated with Claude Code

AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: unavailable.


Note

Low Risk
Narrow change to release ancestry resolution in an automation script; skips known-benign 404s while preserving fail-closed behavior for other API errors.

Overview
Fixes release-fix comment jobs that abort when the published release list includes tags from disjoint git history (e.g. after a repo rewrite). GitHub’s compare API returns HTTP 404 with “No common ancestor”; those failures were treated as fatal and blocked picking a real base tag.

base_release now ignores compare errors that are 404 with “No common ancestor”, since such tags cannot be ancestors of the target release. All other compare failures still fail closed with cannot safely establish release ancestry. Ancestor selection (closest contained release, alias handling) is unchanged.

Adds test_tags_with_no_common_ancestor_are_skipped so a skippable v0.1 still resolves the base to v1 for v2.

Reviewed by Cursor Bugbot for commit 6410853. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Bug Fixes
    • Improved release ancestry selection by ignoring tags that have no shared history.
    • Releases now continue using the next valid ancestor when an unrelated tag is encountered.
    • Other comparison failures continue to be reported normally.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Central YAML (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 91cfd130-3cfa-4932-ba05-a7adafbe14eb
📥 Commits

Reviewing files that changed from the base of the PR and between 7724f55 and 6410853.

📒 Files selected for processing: 2
  • scripts/comment-release-fixes.py
  • scripts/test_comment_release_fixes.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jdx
jdx merged commit 0faa8f5 into main Oct 20, 2026
3 of 4 checks passed
@jdx
jdx deleted the fix/skip-disjoint-release-tags branch October 20, 2026 19:48
jdx added a commit to jdx/hk that referenced this pull request Oct 20, 2026
…eases (#1744)

The `comment release fixes` job failed for v2.8.0 (run 39480695287) with
`cannot safely establish release ancestry`: the `v0.1.x` tags sit on a
history that was never merged into main, so comparing against them
returns `No common ancestor`. The shared workflow now skips those tags
(jdx/workflows#12, released as v1.1.1) and picks the nearest real
earlier release.

This bumps hk's pin to v1.1.1 so the next release posts its "fixed in"
comments. The missed v2.8.0 comments are backfilled separately by
running the workflow manually for that tag.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

*AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5;
version: unavailable.*

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> <sup>[Cursor Bugbot](https://cursor.com/bugbot) is generating a
summary for commit 11253f0. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
jdx added a commit that referenced this pull request Oct 20, 2026
The reusable workflow checks out its script at an immutable SHA, so v1.1.1
still ran the pre-#12 script.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
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