Skip to content

test(signals): cover decidePublicSurface's oss_maintainer not_checked label fallback (#8324)#8434

Closed
galuis116 wants to merge 1 commit into
JSONbored:mainfrom
galuis116:test/settings-preview-oss-maintainer-label
Closed

test(signals): cover decidePublicSurface's oss_maintainer not_checked label fallback (#8324)#8434
galuis116 wants to merge 1 commit into
JSONbored:mainfrom
galuis116:test/settings-preview-oss-maintainer-label

Conversation

@galuis116

Copy link
Copy Markdown
Contributor

Summary

Closes #8324.

decidePublicSurface in src/signals/settings-preview.ts is documented as the single source of truth for the GitHub App's public surface, shared by the live webhook processor and the maintainer-facing dry-run preview. Its willLabel computation has an inline fallback disjunct:

const willLabel =
  shouldApplyPrLabel(settings, input.minerStatus) ||
  (settings.publicAudienceMode === "oss_maintainer" && input.minerStatus === "not_checked" && settings.autoLabelEnabled && (settings.publicSurface === "comment_and_label" || settings.publicSurface === "label_only"));

shouldApplyPrLabel returns false for an oss_maintainer repo whose miner status isn't "confirmed", so for a not_checked PR this inline condition is the only thing that can set willLabel -- it governs whether the webhook processor labels a PR before the official Gittensor miner lookup completes. It had zero coverage (grep not_checked test/unit/settings-preview.test.ts returned nothing).

Adds a describe isolating the four arms of the disjunct:

  • comment_and_label surface -> labels (and actions includes label)
  • label_only surface -> labels
  • comment_only surface -> does NOT label (the disjunct's own publicSurface check excludes it)
  • autoLabelEnabled: false -> does NOT label

Test-only, no production change.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (Closes #8324).

Validation

  • git diff --check
  • npm run actionlint - no workflow files touched.
  • npm run typecheck
  • npx vitest run test/unit/settings-preview.test.ts - 36 pass (was 32); the four new assertions prove both arms of the disjunct.
  • npm run test:coverage / test:workers / build:mcp / ui:* - not run: this adds four assertions to one existing unit test file and touches no other surface.
  • npm audit --audit-level=moderate - no dependency changes.
  • New behavior has unit tests for new branches and fallback paths - this PR is that coverage.

If any required check was skipped, explain why:

  • Test-only change: no src/** lines are modified, so codecov/patch has no changed lines to score. The worker/MCP/UI suites are unaffected because no such code is touched.

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, none touched.
  • API/OpenAPI/MCP behavior is updated and tested where needed - n/a.
  • UI changes use live API data or real empty/error/loading states - n/a, no UI change.
  • Visible UI changes include a UI Evidence section - n/a: test-only, no visible change.
  • Public docs/changelogs are updated where needed - n/a.

Notes

  • The tests deliberately drive minerStatus: "not_checked" so shouldApplyPrLabel's own arm is false, isolating the inline fallback as the sole determinant of willLabel.

… label fallback (JSONbored#8324)

decidePublicSurface in src/signals/settings-preview.ts is the single source
of truth for the GitHub App's public surface, shared by the live webhook
processor and the maintainer dry-run preview. Its willLabel has an inline
fallback disjunct -- oss_maintainer + not_checked + autoLabelEnabled +
(comment_and_label | label_only) -- that governs whether a PR is labelled
before the official Gittensor miner lookup completes. It had no coverage
(grep not_checked in the test file returned nothing).

Because shouldApplyPrLabel returns false for an oss_maintainer repo whose
miner status is not "confirmed", this inline condition is the only thing that
can set willLabel for a not_checked PR, so these tests isolate it exactly.

Adds a describe covering the four arms of that disjunct: comment_and_label and
label_only surfaces label; comment_only does not (the disjunct's own
publicSurface check); and autoLabelEnabled=false does not. Test-only, no
production change.
@galuis116
galuis116 requested a review from JSONbored as a code owner July 24, 2026 12:55
@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 24, 2026
@loopover-orb

loopover-orb Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-24 13:14:19 UTC

1 file · 1 AI reviewer · no blockers · CI failing · blocked

🛑 Suggested Action - Fix Blockers

Review summary
Test-only PR adding a focused describe block that covers all four arms of the oss_maintainer + not_checked willLabel fallback disjunct in decidePublicSurface, closing issue #8324 as claimed. The tests correctly exercise a genuinely reachable path (since shouldApplyPrLabel returns false for non-confirmed miners in oss_maintainer mode, this inline disjunct is the sole determinant of willLabel for not_checked PRs), and the assertions plausibly match the described behavior of publicSurface and autoLabelEnabled gating. No production code is touched, and the new tests are additive and isolated, well-linked to the issue.

Nits — 2 non-blocking
  • The inline `// Add test coverage for decidePublicSurface's oss_maintainer + not_checked auto-label fallback #8324: ...` comment above the new describe block is a multi-line prose explanation duplicating the PR description rather than a short code comment; consider trimming it to one line.
  • Consider adding a fifth case exercising `publicAudienceMode !== "oss_maintainer"` (e.g. gittensor_only) with `minerStatus: "not_checked"` to make the audience-mode guard explicit alongside the other three disjunct arms, though this may be covered elsewhere.

CI checks failing

  • validate
  • validate-tests-merge

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #8324
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 (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 1897 registered-repo PR(s), 1235 merged, 56 issue(s).
Contributor context ✅ Confirmed Gittensor contributor galuis116; Gittensor profile; 1897 PR(s), 56 issue(s).
Improvement ℹ️ Insufficient signal risk: clean · value: insufficient-signal · LLM: minor
Linked issue satisfaction

Addressed
The PR adds a dedicated describe block in test/unit/settings-preview.test.ts covering all four required combinations of oss_maintainer + not_checked with autoLabelEnabled and publicSurface variants, matching the issue's explicit test-case requirements without altering production code.

Review context
  • Author: galuis116
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: JavaScript, Python, TypeScript, Dart, HTML, MDX, Rust, C++
  • Official Gittensor activity: 1897 PR(s), 56 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Triage stale or unlinked PRs.
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.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

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

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests-merge)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 24, 2026
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.

Add test coverage for decidePublicSurface's oss_maintainer + not_checked auto-label fallback

1 participant