Skip to content

feat(miner): add read-only CI check-run poller#2621

Merged
JSONbored merged 3 commits into
JSONbored:mainfrom
Helios531:feat/miner-ci-poller-2323
Jul 2, 2026
Merged

feat(miner): add read-only CI check-run poller#2621
JSONbored merged 3 commits into
JSONbored:mainfrom
Helios531:feat/miner-ci-poller-2323

Conversation

@Helios531

Copy link
Copy Markdown
Contributor

Summary

Implements #2323 by adding a read-only GitHub Checks poller for gittensory-miner. The poller resolves a PR head SHA, fetches check runs, normalizes CI state, and supports bounded exponential backoff without performing any GitHub writes.

Related Issue

Closes: #2323

Change Type

  • Feature
  • Tests
  • Miner package
  • Bug fix
  • Docs
  • UI
  • Database migration

Real Behavior Proof

  • Added pollCheckRuns(repoFullName, prNumber) in packages/gittensory-miner/lib/ci-poller.js
  • Uses only authenticated or unauthenticated GET requests
  • Normalizes results to pending, success, failure, or neutral
  • Handles queued/empty checks as pending
  • Handles failed terminal conclusions as failure
  • Supports bounded retry/backoff via injectable sleepFn

Validation

  • npx vitest run test/unit/miner-ci-poller.test.ts
  • npm run build:miner
  • npm run typecheck
  • npm run test:unit
  • npm run test:ci
  • npm audit --audit-level=moderate

Checklist

  • Linked issue is open, unassigned, and eligible: feat(miner-manage): CI check-run poller (read-only) #2323
  • No duplicate open PR found for this work
  • No GitHub write actions added
  • Tests cover success, failure, pending, neutral, invalid input, malformed PR response, and backoff
  • Miner build includes the new module
  • Full local gate passed

@Helios531
Helios531 requested a review from JSONbored as a code owner July 2, 2026 16:38
@superagent-security superagent-security Bot added the contributor:flagged Contributor flagged for review by trust analysis. label Jul 2, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

@loopover-orb

loopover-orb Bot commented Jul 2, 2026

Copy link
Copy Markdown

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-02 23:37:50 UTC

4 files · 1 AI reviewer · no blockers · readiness 73/100 · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
The change adds a focused read-only Checks poller that resolves the PR head, fetches paginated check runs, normalizes terminal and pending states, and re-checks the head before returning terminal results. The implementation is mostly coherent and the tests exercise the important success, failure, pending, drift, malformed-response, and pagination paths. The main maintainability issue is that the fetch abstraction is under-validated, so a bad injected client fails later with a less useful runtime error rather than at option normalization.

Nits — 6 non-blocking
  • nit: packages/gittensory-miner/lib/ci-poller.js:31 accepts any truthy `fetchFn`, so a non-function option will fail later inside `githubGetJsonResponse`; validate it in `normalizeOptions` and throw a deterministic option error.
  • nit: packages/gittensory-miner/lib/ci-poller.js:37 accepts any `sleepFn`, so retrying with a non-function sleep hook fails only after a pending poll; validate it alongside `fetchFn`.
  • nit: test/unit/miner-ci-poller.test.ts:38 only asserts all requests use GET and auth, but not the expected GitHub API headers; add one assertion for `accept`, `user-agent`, and `x-github-api-version` because this module owns that protocol boundary.
  • packages/gittensory-miner/lib/ci-poller.js:29 should reject invalid injected functions during `normalizeOptions`, e.g. keep the default when omitted but throw when `fetchFn` or `sleepFn` is present and not callable.
  • test/unit/miner-ci-poller.test.ts:63 should assert the full request header shape on at least one call so future refactors do not silently drop the GitHub API version or user agent.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
Signal Result Evidence
Code review ✅ No 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 (size label size:L; no linked issue context).
Validation posture ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 134 registered-repo PR(s), 80 merged, 3 issue(s).
Contributor context ✅ Confirmed Gittensor contributor Helios531; Gittensor profile; 134 PR(s), 3 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: Helios531
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 134 PR(s), 3 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Explain no-issue PR.
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
  • 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

@dosubot dosubot Bot added the size:L label Jul 2, 2026
@loopover-orb loopover-orb Bot added gittensor gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jul 2, 2026
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.09%. Comparing base (e835ab0) to head (eac7085).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2621   +/-   ##
=======================================
  Coverage   96.09%   96.09%           
=======================================
  Files         237      237           
  Lines       26444    26446    +2     
  Branches     9587     9588    +1     
=======================================
+ Hits        25412    25414    +2     
  Misses        425      425           
  Partials      607      607           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@superagent-security superagent-security Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superagent found 1 security concern(s).

Comment thread packages/gittensory-miner/lib/ci-poller.js Outdated
@superagent-security superagent-security Bot added the pr:flagged PR flagged for review by security analysis. label Jul 2, 2026
@superagent-security superagent-security Bot removed the pr:flagged PR flagged for review by security analysis. label Jul 2, 2026
Add the miner CI check-run poller package surface with typed entrypoints and unit coverage. Handle paginated GitHub check-run responses, terminal stale conclusions, malformed payloads, and trusted GitHub API origin validation so authenticated requests cannot exfiltrate tokens to arbitrary hosts.
@Helios531

Copy link
Copy Markdown
Contributor Author

@JSONbored I would like to contribute to this project, Could you review my PR?
Thanks!

@Helios531

Copy link
Copy Markdown
Contributor Author

@JSONbored I implemented issue #2323 correctly. But I think your Gittensory Orb Review Agent has some problems.
plz Could you plz review my PR again? Thanks!

@JSONbored

Copy link
Copy Markdown
Owner

@JSONbored I would like to contribute to this project, Could you review my PR? Thanks!

I warned you last night, please stop tagging me / asking for reviews - next time you do it, it's a +5 day wait to be reviewed and/or automatic closure. I already get notified to review this, I don't need to be reminded.

@dosubot dosubot Bot added the lgtm label Jul 2, 2026
@JSONbored
JSONbored merged commit 63f5190 into JSONbored:main Jul 2, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor:flagged Contributor flagged for review by trust analysis. gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Development

Successfully merging this pull request may close these issues.

feat(miner-manage): CI check-run poller (read-only)

2 participants