Skip to content

fix(review): stop paging Sentry on an expected update_branch merge conflict - #8077

Merged
JSONbored merged 1 commit into
mainfrom
loopover-24-update-branch-conflict-noise
Jul 22, 2026
Merged

fix(review): stop paging Sentry on an expected update_branch merge conflict#8077
JSONbored merged 1 commit into
mainfrom
loopover-24-update-branch-conflict-noise

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • update_branch performs a real merge internally, so it fails with the same "merge conflict" shape a MERGE action does -- but unlike a merge's terminal hold (a PR permanently blocked until a human intervenes), this is NOT a stuck state.
  • forceUpdateBranch's caller (prReadyForReview) already falls through to reviewing the PR on its current, non-rebased head when this returns false -- exactly like every other "couldn't rebase, review anyway" path in that function.
  • The branch owner, not the bot, needs to resolve the conflict. Paging Sentry on every naturally-diverged PR this happens to hit (LOOPOVER-24: 16 occurrences over 6 days) was pure noise for something already gracefully handled -- still fully recorded via the existing audit() call either way.

What Changed

  • src/services/merge-failure.ts: exported isMergeConflictMessage for reuse (previously module-private, only used by classifyMergeFailure's merge-action classification).
  • src/services/agent-action-executor.ts: the update_branch action class now skips the Sentry captureError call specifically when the failure is a genuine merge conflict; every other non-merge action class (and every OTHER update_branch failure reason) is unaffected.

Test plan

  • Added a regression test confirming a merge-conflict update_branch failure does not call captureError.
  • Added a test confirming a non-conflict update_branch failure still pages Sentry exactly as before (proves the existing agent_action_execution_failed path is unchanged for real failures).
  • npx vitest run test/unit/agent-action-executor.test.ts -- 183/183 passing.
  • npm run test:ci -- green (one unrelated, pre-existing environmental gap: packages/discovery-index's @sentry/cli devDependency was missing from node_modules, unrelated to this change -- confirmed by an additive, non-destructive install and a clean re-run of the affected test file in isolation).

…nflict

update_branch performs a real merge internally, so it fails with the
same "merge conflict" shape a MERGE action does -- but unlike a
merge's terminal hold (a PR permanently blocked until a human
intervenes), this is not a stuck state: forceUpdateBranch's caller
(prReadyForReview) already falls through to reviewing the PR on its
current, non-rebased head when this returns false. The branch owner,
not the bot, needs to resolve the conflict; paging on every naturally-
diverged PR this happens to hit was pure noise, still recorded via
the existing audit() call either way.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored JSONbored self-assigned this Jul 22, 2026
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 22, 2026
@loopover-orb

loopover-orb Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Warning

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-22 19:43:02 UTC

3 files · 1 AI reviewer · 2 blockers · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
This change makes the `update_branch` action class skip the Sentry `captureError` call specifically when the underlying failure is a genuine merge-conflict message, reusing the existing `isMergeConflictMessage` classifier (now exported) rather than reinventing the check. The wiring is correct: the `audit()` call for the `error` outcome still fires unconditionally (verified by the new regression test asserting `outcome: "error"` while `captureSpy` is not called), and the non-conflict path is proven unchanged by the second added test. This is a small, well-targeted, root-cause fix — it suppresses noise at the exact site where the false-positive classification happens rather than papering over it downstream.

Nits — 3 non-blocking
  • The PR description cites `LOOPOVER-24` as the motivating issue but it reads like an internal ticket ID rather than a linked GitHub issue — worth confirming this satisfies the repo's issue-link requirement for external contributions.
  • src/services/merge-failure.ts:26 — the doc comment update is good but slightly duplicates the reasoning already in agent-action-executor.ts's inline comment; consider trimming one side to avoid the two explanations drifting apart later.
  • Consider a short comment at the `isMergeConflictMessage` export site noting it's now a shared classification boundary between merge and update_branch, so a future edit to the regex remembers both call sites (src/services/merge-failure.ts:26).

Concerns raised — review before merging

  • No linked issue detected: No closing reference or linked issue number was found in the PR metadata/body. — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue: This repo's maintainer focus manifest requires every PR to reference a tracked issue. — Link the relevant issue (for example Closes #123) before opening the PR.
📋 Copy for AI agents — paste into your coding agent
Fix the following blocker(s) from this PR review:

1. No linked issue detected: No closing reference or linked issue number was found in the PR metadata/body. — If this PR is intended to solve an issue, link it explicitly in the PR body.

2. Maintainer requires a linked issue: This repo's maintainer focus manifest requires every PR to reference a tracked issue. — Link the relevant issue (for example `Closes #123`) before opening the PR.

Decision drivers

  • ❌ Code review — 2 blockers (1 reviewer)
  • ❌ Gate result — Blocking (Repo-configured hard blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 16 registered-repo PR(s), 14 merged, 255 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 16 PR(s), 255 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: minor
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, Ruby, Go, JavaScript, MDX, Shell, Solidity
  • Official Gittensor activity: 16 PR(s), 255 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Then work through the remaining 2 steps in the Signals table above.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 22, 2026
@JSONbored
JSONbored merged commit 1026fb3 into main Jul 22, 2026
12 checks passed
@JSONbored
JSONbored deleted the loopover-24-update-branch-conflict-noise branch July 22, 2026 19:50
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.39%. Comparing base (b99a475) to head (dac2cf4).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8077      +/-   ##
==========================================
+ Coverage   91.98%   97.39%   +5.40%     
==========================================
  Files         748        2     -746     
  Lines       76616      345   -76271     
  Branches    23238      143   -23095     
==========================================
- Hits        70473      336   -70137     
+ Misses       5041        4    -5037     
+ Partials     1102        5    -1097     
Flag Coverage Δ
control-plane ?
rees ?
shard-1 25.50% <0.00%> (-27.98%) ⬇️
shard-2 24.63% <0.00%> (-30.95%) ⬇️
shard-3 95.07% <100.00%> (+40.53%) ⬆️

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

Files with missing lines Coverage Δ
src/services/agent-action-executor.ts 97.24% <100.00%> (+<0.01%) ⬆️
src/services/merge-failure.ts 100.00% <ø> (ø)

... and 746 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant