Skip to content

[codex] Fix missed component release recovery#2095

Merged
riderx merged 2 commits into
mainfrom
codex/fix-release-scope-recovery
May 10, 2026
Merged

[codex] Fix missed component release recovery#2095
riderx merged 2 commits into
mainfrom
codex/fix-release-scope-recovery

Conversation

@riderx
Copy link
Copy Markdown
Member

@riderx riderx commented May 10, 2026

Summary (AI generated)

  • Make release scope resolution compare each component against its latest matching tag instead of only the latest push range.
  • Prevent reusable release test runs from cancelling other release test runs on main.
  • Add release-scope regression coverage for missed CLI changes after a later Capgo-only push.

Motivation (AI generated)

A cancelled CLI release test run could lose the CLI release forever because the next successful main push only inspected its own push range. The Capgo release could still ship and include CLI changes in the generated changelog, but no cli-* tag or npm publish would happen.

Business Impact (AI generated)

This keeps Capgo and CLI releases aligned when both products changed, so CLI fixes do not silently miss npm publication after CI cancellation or later main pushes. It reduces manual release recovery and avoids users waiting for already-merged CLI fixes.

Test Plan (AI generated)

  • bunx vitest run tests/release-scope.test.ts
  • bunx eslint --no-ignore scripts/release-scope.ts tests/release-scope.test.ts
  • git diff --check
  • Commit hook: bun run cli:build && vue-tsc --noEmit

Summary by CodeRabbit

  • Chores
    • Updated workflow concurrency grouping logic for reusable workflows.
    • Improved internal release scope script with dependency-injected Git execution for enhanced testability.
    • Expanded test coverage for release scope scenarios, including tag selection and fallback handling.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 10, 2026

Warning

Rate limit exceeded

@riderx has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 1 second before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 414a4e4d-de52-4ee5-99e5-9527ba89c591

📥 Commits

Reviewing files that changed from the base of the PR and between 89772f3 and 6cde320.

📒 Files selected for processing (2)
  • scripts/release-scope.ts
  • tests/release-scope.test.ts
📝 Walkthrough

Walkthrough

The PR refactors the release-scope script to support dependency-injected Git execution, adds new exported tag/range query helpers, updates internal Git helpers to accept an optional injected runner parameter, and extends tests to validate tag selection and release-scope logic. Workflow concurrency grouping is updated to use commit SHA for reusable workflow invocations.

Changes

Release Infrastructure Refactoring with Dependency Injection

Layer / File(s) Summary
Workflow Concurrency Update
.github/workflows/tests.yml
Concurrency grouping uses commit SHA for workflow_call invocations, falls back to ref for other event types.
Git Execution Abstraction
scripts/release-scope.ts
Imports node:process and defines GitRunner function type to parameterize Git command execution for dependency injection.
Tag and Range Query Helpers
scripts/release-scope.ts
New exports: getComponentTagPattern generates per-component tag patterns, getLatestComponentTag queries latest tag via git describe with null fallback, getReleaseRangeBase uses latest tag or falls back to before ref.
Git Helper Refactoring
scripts/release-scope.ts
getCommitShas, getChangedFiles, getCommitMessage refactored to accept optional injected run parameter (defaults to runGit) and thread it through all Git invocations.
Release Scope Integration
scripts/release-scope.ts
resolveReleaseScope updated to accept optional injected run parameter, routing all computations through runner-aware helpers for release base, commit range, component filtering, and release decision.
Test Implementation
tests/release-scope.test.ts
Imports expanded to include new helpers. New test cases validate tag selection when git describe succeeds, fallback to pushed range when tag is absent, and multi-query scenarios where previously-missed CLI changes remain releasable after Capgo-only push.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Cap-go/capgo#1985: Modifies scripts/release-scope.ts with exported resolveReleaseScope API and related helpers directly connected to this refactoring.
  • Cap-go/capgo#1981: Refactors release-scope and adjusts workflow concurrency semantics, building on the same release infrastructure logic.

Poem

🐰 A runner hops through Git with grace,
Injection spreads through every place,
Tags and ranges now we find,
With mocked Git calls so refined—
Release scope leaps with tests in tow! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fixing missed component release recovery, which is the core intent of the PR.
Description check ✅ Passed The PR description covers the summary, motivation, business impact, and test plan sections comprehensively, exceeding the template requirements.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-release-scope-recovery

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

@codspeed-hq
Copy link
Copy Markdown
Contributor

codspeed-hq Bot commented May 10, 2026

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing codex/fix-release-scope-recovery (6cde320) with main (0822f6e)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@riderx riderx marked this pull request as ready for review May 10, 2026 18:39
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@riderx
Copy link
Copy Markdown
Member Author

riderx commented May 10, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 10, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@riderx
Copy link
Copy Markdown
Member Author

riderx commented May 10, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 10, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/release-scope.ts`:
- Around line 82-88: The current blanket catch around the git describe call
swallows all errors; instead catch only the "no matching tag" case and rethrow
everything else. Change the try/catch around the run(['describe', '--tags',
'--match', getComponentTagPattern(component), '--abbrev=0', after]) call so that
in the catch you inspect the error (e.g. error.message or error.stdout/stderr)
for the git "no matching tag" / "No names found" / "fatal: no tag" indicator and
return null only for that specific condition; for any other error rethrow it so
callers (e.g. getReleaseRangeBase) see real failures. Ensure you reference the
same run(...) invocation and getComponentTagPattern(component) when locating the
code to modify.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8dfad7d7-aa0c-45b7-96c0-290a6b76b304

📥 Commits

Reviewing files that changed from the base of the PR and between 5e19137 and 89772f3.

📒 Files selected for processing (3)
  • .github/workflows/tests.yml
  • scripts/release-scope.ts
  • tests/release-scope.test.ts

Comment thread scripts/release-scope.ts
@sonarqubecloud
Copy link
Copy Markdown

@riderx riderx merged commit 433795f into main May 10, 2026
52 checks passed
@riderx riderx deleted the codex/fix-release-scope-recovery branch May 10, 2026 19:24
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