Skip to content

fix(github): preserve colliding check-run failures#3968

Merged
JSONbored merged 1 commit into
mainfrom
codex/fix-ci-dedupe-masking-failing-check-runs
Jul 7, 2026
Merged

fix(github): preserve colliding check-run failures#3968
JSONbored merged 1 commit into
mainfrom
codex/fix-ci-dedupe-masking-failing-check-runs

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • Prevent a same-name dedupe from hiding real failing check-runs emitted by different suites/apps and thereby falsely resolving CI to passed.

Description

  • Change the CI dedupe to use a check-run identity (name + app slug + check-suite id) rather than name alone and leave runs without a suite id undeduped so observed failures can't be hidden.
  • Add check_suite.databaseId to the GraphQL rollup mapping and include check_suite / id on REST fixtures so both REST and GraphQL paths share the same safe identity boundary.
  • Replace dedupeLatestCheckRunsByName with dedupeLatestCheckRunsByIdentity and add checkRunDedupeKey to compute the identity, tiebreaking by started_at (or array order when missing).
  • Add regression tests (REST + GraphQL) that prove: re-run stale-failure → newer passing wins, newer failing wins, out-of-order lists respect timestamps, queued/no-timestamp fallback, and that same-name collisions from different suites are NOT collapsed.

Testing

  • Ran the targeted unit suites: npx vitest run test/unit/graphql-status-rollup.test.ts (all tests passed) and npx vitest run test/unit/backfill.test.ts -t "duplicate-named check-runs" (tests passed with many unrelated cases skipped).
  • Ran typecheck with npm run typecheck which succeeded and git diff --check which reported no issues.
  • Coverage and full local gate could not be completed in this environment: npm run test:coverage was attempted but the targeted run did not finish here and an earlier attempt used an unsupported Vitest option; npm audit --audit-level=moderate returned a 403 Forbidden from the registry in this environment.

Codex Task

@superagent-security

Copy link
Copy Markdown
Contributor

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

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

loopover-orb Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - fixes required

Review updated: 2026-07-07 08:19:40 UTC

3 files · 1 AI reviewer · 2 blockers · readiness 93/100 · CI failing · blocked

🛑 Suggested Action - Manual Review

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.

Review summary
This PR replaces name-only check-run dedup with an identity key that adds app slug + check-suite id, correctly threading check_suite/databaseId through both the REST (backfill.ts checkRunDedupeKey) and GraphQL (fetchLiveCiAggregateViaGraphQl query + checkSuite mapping) paths so runs from different suites/apps sharing a display name are no longer collapsed. The dedupeLatestCheckRunsByIdentity rewrite preserves the original timestamp-tiebreak/array-order-fallback semantics for genuine re-run duplicates (same suite id) while leaving suite-id-less runs undeduped, and the new tests (REST + GraphQL) directly exercise the collision scenario the PR claims to fix alongside the pre-existing re-run regression cases. The change is internally consistent and the fix traces to the real production code path (REST check-run payloads and the GraphQL checkSuite.databaseId field both genuinely carry a suite identity at runtime).

Nits — 5 non-blocking
  • The PR description doesn't link an eligible open issue; per repo convention that should be confirmed/added before merge.
  • checkRunDedupeKey's fallback `run.check_suite?.id ?? run.check_suite?.databaseId` silently prefers REST's `id` over `databaseId` — worth a one-line comment noting the two paths never populate both fields simultaneously, so there's no real precedence conflict.
  • The `validate`/`validate-code` CI checks are failing on this commit; worth confirming those failures aren't related to this diff (e.g. lint/coverage threshold) before merge.
  • Consider exporting `checkRunDedupeKey` (or adding a focused unit test for it directly) so the identity-key construction itself is covered independent of the higher-level reducer tests.
  • The doc comment above `dedupeLatestCheckRunsByIdentity` could explicitly state the fallback behavior when only one of `id`/`databaseId` is present, mirroring what's now in the code.

Why this is blocked

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.

CI checks failing

  • validate
  • validate-code
Signal Result Evidence
Code review ❌ 2 blockers 1 reviewer
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: 51 registered-repo PR(s), 43 merged, 343 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 51 PR(s), 343 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
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, JavaScript, Ruby, Go, Kotlin, MDX, Shell
  • Official Gittensor activity: 51 PR(s), 343 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
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.

🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.70%. Comparing base (92a154b) to head (17143ed).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3968   +/-   ##
=======================================
  Coverage   93.70%   93.70%           
=======================================
  Files         373      373           
  Lines       35076    35087   +11     
  Branches    12863    12868    +5     
=======================================
+ Hits        32868    32879   +11     
  Misses       1584     1584           
  Partials      624      624           
Files with missing lines Coverage Δ
src/github/backfill.ts 96.95% <100.00%> (+0.02%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 7, 2026
@JSONbored
JSONbored force-pushed the codex/fix-ci-dedupe-masking-failing-check-runs branch from 81046b5 to 17143ed Compare July 7, 2026 08:58
@JSONbored
JSONbored merged commit a55063f into main Jul 7, 2026
7 checks passed
@JSONbored
JSONbored deleted the codex/fix-ci-dedupe-masking-failing-check-runs branch July 7, 2026 08:59
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