Skip to content

fix(hook): clear stale pending state on post-commit errors - #330

Merged
404-Page-Found merged 2 commits into
mainfrom
fix/305-post-commit-stale-state
Sep 24, 2026
Merged

404-Page-Found merged 2 commits into
mainfrom
fix/305-post-commit-stale-state

Conversation

@404-Page-Found

@404-Page-Found 404-Page-Found commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • make post-commit pending-state cleanup unconditional with an outer finally
  • prevent checkGitRepo() and readLatestCommitMessage() failures from leaving stale metadata for a later commit
  • add regression coverage for repository validation and commit-message read failures

Closes #305

Validation

  • Compared branch against main: 2 focused commits, 2 files changed
  • Regression tests added for the reported terminal-error paths
  • GitHub Actions will validate the build and full test suite

Review in cubic

@coderabbitai

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 19 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: d599b150-650c-4ea9-9c43-c23f782db4c0

📥 Commits

Reviewing files that changed from the base of the PR and between 65718e4 and 5594538.

📒 Files selected for processing (2)
  • src/git/hook.ts
  • tests/hook.test.mjs

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

@sonarqubecloud

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. Fix for post-commit hook: stale pending-state cleanup is now unconditional via outer finally with regression tests for validation/commit-message read failures.

Re-trigger cubic

@404-Page-Found
404-Page-Found merged commit ad908a7 into main Sep 24, 2026
7 checks passed
@404-Page-Found
404-Page-Found deleted the fix/305-post-commit-stale-state branch September 24, 2026 01:23
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.

[Bug] Post-commit hook can reuse stale pending state after a read failure

1 participant