Skip to content

fix(github): guard backfill GraphQL helpers' repoFullName parsing - #9345

Closed
philluiz2323 wants to merge 1 commit into
JSONbored:mainfrom
philluiz2323:fix/backfill-repo-fullname-guard-9317
Closed

fix(github): guard backfill GraphQL helpers' repoFullName parsing#9345
philluiz2323 wants to merge 1 commit into
JSONbored:mainfrom
philluiz2323:fix/backfill-repo-fullname-guard-9317

Conversation

@philluiz2323

Copy link
Copy Markdown
Contributor

Summary

fetchLiveCiAggregateViaGraphQl, fetchLivePullRequestReviewDecision, and fetchLiveReviewThreadBlockers in src/github/backfill.ts parsed repoFullName with a bare split(/) + truthiness check. Extra path segments (owner/repo/extra) and whitespace-padded slugs (owner/ repo, owner/repo) therefore reached GraphQL query strings — the same failure mode #8311 closed for app.ts/comments.ts.

Adds a local parseBackfillRepoFullName helper mirroring the segment-count + whitespace guard used in labels.ts/assignees.ts/pr-actions.ts, reused by all three call sites. Each function keeps its existing fail-soft return contract (null / undefined / []).

Test plan

  • test/unit/graphql-status-rollup.test.ts: fetchLiveCiAggregateViaGraphQl rejects extra-segment and whitespace-padded slugs before any GraphQL call
  • test/unit/backfill-2.test.ts: fetchLivePullRequestReviewDecision returns undefined for the same malformed shapes
  • test/unit/backfill-2.test.ts: fetchLiveReviewThreadBlockers returns [] for the same malformed shapes
  • Targeted vitest run passes (3/3 new cases)

Closes #9317

fetchLiveCiAggregateViaGraphQl, fetchLivePullRequestReviewDecision, and
fetchLiveReviewThreadBlockers parsed repoFullName with a bare split/truthiness
check, so extra segments and whitespace-padded slugs reached GraphQL queries.
Add a local parseBackfillRepoFullName helper mirroring JSONbored#8311's segment-count and
whitespace guard, preserving each call site's fail-soft return contract.

Closes JSONbored#9317
@philluiz2323
philluiz2323 requested a review from JSONbored as a code owner July 27, 2026 13:29
@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

❌ 3 Tests Failed:

Tests completed Failed Passed Skipped
11205 3 11202 16
View the top 2 failed test(s) by shortest run time
test/unit/selfhost-pg-retention.test.ts > runRetentionPrune + processJob on the Postgres backend (#977) > processJob prune-retention deletes eligible rows and records a success audit event on Postgres
Stack Traces | 0.00636s run time
AssertionError: expected 3 to be +0 // Object.is equality

- Expected
+ Received

- 0
+ 3

 ❯ test/unit/selfhost-pg-retention.test.ts:119:44
test/unit/selfhost-pg-retention.test.ts > pruneExpiredRecords on the Postgres backend (#977) > deletes across multiple bounded batches and stops at the per-table cap, same as the SQLite path
Stack Traces | 0.016s run time
AssertionError: expected +0 to be 4 // Object.is equality

- Expected
+ Received

- 4
+ 0

 ❯ test/unit/selfhost-pg-retention.test.ts:76:33
View the full list of 1 ❄️ flaky test(s)
test/unit/salvageability.test.ts > resolveAiReviewSalvageableHold > defaults: no configured floor uses the gate default, and a confidence-less blocker counts as certainty (at/above floor)

Flake rate in main: 100.00% (Passed 0 times, Failed 11 times)

Stack Traces | 0.00751s run time
AssertionError: expected undefined to be defined
 ❯ test/unit/salvageability.test.ts:88:18

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

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

loopover-orb Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Important

🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪

🔍 LoopOver is reviewing…

AI analysis is in progress. This comment will update when the review is complete.

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

@philluiz2323

Copy link
Copy Markdown
Contributor Author

Closing: opened while #9285 (green CI, fixes the salvageability + selfhost-pg-retention failures currently red on every open PR) is still merge-pending. Will re-file on a green main after that lands.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(github): backfill.ts GraphQL read helpers are missing the repoFullName segment-count/whitespace guard

1 participant