Skip to content

fix(remediation): sync PR title/body even when fix commit is a no-op - #20

Merged
franzramadhan merged 2 commits into
mainfrom
fix/remediation-noop-pr-title-sync
Aug 7, 2026
Merged

fix(remediation): sync PR title/body even when fix commit is a no-op#20
franzramadhan merged 2 commits into
mainfrom
fix/remediation-noop-pr-title-sync

Conversation

@franzramadhan

Copy link
Copy Markdown
Contributor

Summary

  • remediateOne returned early once CommitFiles reported a no-op tree (branch already matches the fix), skipping CreateOrUpdatePullRequest entirely — an already-fixed branch with a stale PR title/body never got synced.
  • Found via a live scan against reearth/reearth-accounts: PR #307's actions-pinned fix branch was already correct, but the title never picked up the conventional-commit format from fix(remediation): use conventional-commit PR titles and sync existing PRs #19.
  • Fix: always upsert the PR after CommitFiles, whether or not a new commit was made.

Test plan

  • go build ./...
  • go vet ./...
  • go test ./...
  • Added TestRun_SyncsPRTitleWhenCommitIsNoOp regression test covering the no-op-commit-but-stale-PR case

remediateOne returned early once CommitFiles reported no tree change,
skipping CreateOrUpdatePullRequest entirely. An already-fixed branch with
a stale PR title/body (e.g. from before the conventional-commit title
change) never got synced, since sync only ran on a fresh commit.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.16%. Comparing base (2d23c56) to head (98bb2ee).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #20      +/-   ##
==========================================
+ Coverage   78.06%   78.16%   +0.10%     
==========================================
  Files          41       41              
  Lines        3159     3156       -3     
==========================================
+ Hits         2466     2467       +1     
+ Misses        550      548       -2     
+ Partials      143      141       -2     
Flag Coverage Δ
unittests 78.16% <100.00%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@franzramadhan
franzramadhan merged commit 6643c22 into main Aug 7, 2026
1 check passed
@franzramadhan
franzramadhan deleted the fix/remediation-noop-pr-title-sync branch August 7, 2026 05:28
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.

2 participants