fix(review): skip redundant GitHub PATCHes for unchanged upstream drift issues - #4566
Merged
Merged
Conversation
…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.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fileUpstreamDriftIssuesresolves each open drift report's GitHub issue and always PATCHes it, unconditionally, every 6-hour cycle.githubDriftIssuePayloadhas 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.validateRecordedGitHubIssueandfindGitHubIssueForFingerprint(which already fetch the full issue for their own validation checks) to also surfacebody/labels/assignees, then compares the freshly-built payload against that live state before PATCHing — no new DB column or extra fetch needed.unchangedcounter, distinct from the existing API-failureskippedcount) 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.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlint(vianpm run test:ci)npm run typechecknpm run test:coveragelocally (unsharded) — invariant/regression tests confirmed to FAIL without the fix and pass with it, verified by temporarily reverting the skip logic and re-runningnpm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderatename/ assigneeloginfields, and an issue response with theassigneeskey entirely absent) per fix(upstream): fileUpstreamDriftIssues unconditionally PATCHes unchanged GitHub drift issues every 6 hours #4503's requirementsSafety
UI Evidence— N/A, no visible/UI change.