Skip to content

fix(review): skip redundant GitHub PATCHes for unchanged upstream drift issues - #4566

Merged
JSONbored merged 1 commit into
mainfrom
claude/upstream-drift-issue-unchanged-skip-4503
Jul 10, 2026
Merged

fix(review): skip redundant GitHub PATCHes for unchanged upstream drift issues#4566
JSONbored merged 1 commit into
mainfrom
claude/upstream-drift-issue-unchanged-skip-4503

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • Closes fix(upstream): fileUpstreamDriftIssues unconditionally PATCHes unchanged GitHub drift issues every 6 hours #4503. fileUpstreamDriftIssues resolves each open drift report's GitHub issue and always PATCHes it, unconditionally, every 6-hour cycle. githubDriftIssuePayload has no always-changing field (no timestamp), so an unresolved report with unchanged content produces a byte-identical payload across cycles — wasting a GitHub call and spuriously bumping the issue's "updated" timestamp, notifying assignees/watchers with no real change.
  • Extends validateRecordedGitHubIssue and findGitHubIssueForFingerprint (which already fetch the full issue for their own validation checks) to also surface body/labels/assignees, then compares the freshly-built payload against that live state before PATCHing — no new DB column or extra fetch needed.
  • Skips the write (a new unchanged counter, distinct from the existing API-failure skipped count) when nothing would actually change. Labels and assignees compare as case-insensitive sets, not ordered arrays, since GitHub does not guarantee either the order or the casing it echoes back matches what was last sent.
  • A genuinely changed report (e.g. severity escalation, which changes both the body and the label set) still triggers a fresh PATCH.

Scope

Validation

  • git diff --check
  • npm run actionlint (via npm run test:ci)
  • npm run typecheck
  • npm run test:coverage locally (unsharded) — invariant/regression tests confirmed to FAIL without the fix and pass with it, verified by temporarily reverting the skip logic and re-running
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries — invariant (unchanged report = zero PATCH calls), regression (two consecutive cycles, only the first PATCHes), negative-path (severity escalation still PATCHes), plus malformed-shape resilience tests (missing label name / assignee login fields, and an issue response with the assignees key entirely absent) per fix(upstream): fileUpstreamDriftIssues unconditionally PATCHes unchanged GitHub drift issues every 6 hours #4503's requirements

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests — N/A, no such change.
  • API/OpenAPI/MCP behavior is updated and tested where needed — N/A, the one internal-jobs endpoint touched has no defined response schema.
  • UI changes use live API data — N/A, no UI change.
  • UI Evidence — N/A, no visible/UI change.
  • Public docs/changelogs updated — N/A.

…ft issues (#4503)

fileUpstreamDriftIssues resolves each open drift report's GitHub issue and
always PATCHes it, unconditionally, every 6-hour cycle -- githubDriftIssuePayload
has no always-changing field (no timestamp), so an unresolved report with
unchanged content produces a byte-identical payload across cycles. This wastes
a GitHub call and spuriously bumps the issue's "updated" timestamp, notifying
assignees/watchers with no real change.

Extends validateRecordedGitHubIssue and findGitHubIssueForFingerprint (which
already fetch the full issue) to also surface body/labels/assignees, then
compares the freshly-built payload against that live state before PATCHing --
skipping the write (a new `unchanged` counter, distinct from the existing
API-failure `skipped` count) when nothing would actually change. Labels and
assignees compare as case-insensitive sets, not ordered arrays, since GitHub
does not guarantee either matches what was last sent.
@superagent-security

Copy link
Copy Markdown
Contributor

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

@JSONbored
JSONbored merged commit ae70406 into main Jul 10, 2026
6 checks passed
@JSONbored
JSONbored deleted the claude/upstream-drift-issue-unchanged-skip-4503 branch July 10, 2026 03:59
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.10%. Comparing base (e063f55) to head (3ff3124).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4566   +/-   ##
=======================================
  Coverage   94.09%   94.10%           
=======================================
  Files         427      427           
  Lines       38007    38022   +15     
  Branches    13874    13877    +3     
=======================================
+ Hits        35764    35779   +15     
  Misses       1586     1586           
  Partials      657      657           
Files with missing lines Coverage Δ
src/upstream/ruleset.ts 98.12% <100.00%> (+0.06%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

fix(upstream): fileUpstreamDriftIssues unconditionally PATCHes unchanged GitHub drift issues every 6 hours

1 participant