fix(selfhost): give verdict the same state/merged_at precedence status has#3512
Conversation
…s has (#3511) The Grafana reporting exporter's verdict CASE switched purely on advisories.conclusion, unlike the status CASE right above it (which checks the PR's own terminal state first). Live advisories.conclusion is stuck at neutral/action_required for every PR (a separate, pre-existing gap -- persistAdvisory has zero callers), so verdict was mathematically forced to 'manual' for every merged/closed PR on the maintainer dashboard. Mirror status's precedence into verdict in both the Postgres-source and SQLite-source blocks: check state/merged_at first, fall back to advisories.conclusion only for a PR that's still open. Closes #3511
|
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 #3512 +/- ##
=======================================
Coverage 93.09% 93.09%
=======================================
Files 301 301
Lines 31450 31450
Branches 11483 11483
=======================================
Hits 29279 29279
Misses 1517 1517
Partials 654 654 🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-05 15:14:08 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 4 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 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.
|
… not dead advisories (#3535) The exporter's still-open-PR verdict was joined against advisories, which only ever holds a PRE-gate rules-severity summary (always neutral/action_required in practice) -- never the gate's own actual merge/close/hold decision. That decision already has a live, correct, continuously-populated home: review_audit's gittensory-native gate_decision rows (written unconditionally on self-host by recordNativeGateDecision). Point the exporter there instead so a still-open PR's verdict reflects the gate's real, current state instead of an eternal placeholder. Verified against live production Postgres: a still-open PR now shows its actual hold/merge/close decision instead of always 'manual', while merged/closed PRs (the majority, from PR #3512) are unaffected. Closes #3511
Closes #3511
Summary
verdict=manual.scripts/export-grafana-reporting-db.shbuilds the reporting-databaseverdictcolumn purely fromadvisories.conclusion, unlike thestatuscolumn right above it (which checksp.state/p.merged_atFIRST). Verified against live production Postgres:advisories.conclusionis stuck at onlyneutral/action_requiredfor every row (a separate, pre-existing gap —persistAdvisoryinsrc/db/repositories.tshas zero callers anywhere insrc/, confirmed by grep, so nothing ever writes asuccess/failure/skippedrow for a live gate evaluation). Since both surviving values map to'manual',verdictwas mathematically forced to'manual'regardless of the PR's real outcome.status's own precedence intoverdict'sCASE(both the Postgres-source and SQLite-source blocks): checkp.state/p.merged_atfirst, and only fall back toa.conclusionfor a PR that's still open. Verified against live production data for the exact 5 PRs visible in the reported dashboard screenshot (gittensory#3503/fix(signals): classify PHP protobuf stubs as generated #3505/feat(review): add review.tone public-safe voice brief knob (#2044) #3506, metagraphed#3646, awesome-claude#4409) — all now resolve tomerge/closeinstead ofmanual.verdictfrom the same (separately broken)advisories.conclusioncolumn as before. Wiring uppersistAdvisoryinto the live gate-evaluation path is a bigger, separate application-code change; not bundled into this reporting-script fix.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run typecheck(clean)shellcheck scripts/export-grafana-reporting-db.sh(clean, no CI step requires this but ran it as extra diligence on a shell-script change)npx vitest run test/unit/selfhost-grafana-reporting.test.ts— 11/11 passing (10 existing + 1 new regression test)npm run test:workers/npm run build:mcp/npm run test:mcp-pack/npm run ui:openapi:check/npm run ui:build— not run individually; no worker/MCP/OpenAPI/UI surface touched.advisories.conclusionstuck atneutral/action_required), asserting the correct verdict now surfaces, plus a control case confirming a genuinely still-open PR's behavior is unchanged.Safety
UI Evidencesection below. — N/A, not aapps/gittensory-uichange.Notes
Root-caused via a 3-way parallel investigation (dashboard JSON, live production DB, application source code) after the user reported the dashboard symptom directly. All three independently converged on the same file/root cause, then independently cross-verified against live Postgres before implementing.