Skip to content

feat: github view data: detail.py foundation + gated GET /detail/pr route (read-only) - #47

Merged
mabry1985 merged 1 commit into
mainfrom
feat/bd-nm78.1-github-view-data-detail-py-foundation-ga
Oct 26, 2026
Merged

mabry1985 merged 1 commit into
mainfrom
feat/bd-nm78.1-github-view-data-detail-py-foundation-ga

Conversation

@mabry1985

Copy link
Copy Markdown
Member

Summary

Adds detail.py, the data foundation for epic bd-nm78's in-console PR/issue drawer. It is a host-free module of plain async functions in the api.fetch_prs style: every gh call goes through run_gh, the repo is validated with bad_repo(), failures are classified with check_gh_error, bodies are parsed with parse_json, and each function returns a dict or {"error": …} and never raises.

  • fetch_pr_detail(repo, number, fresh=False) makes one gh pr view N --repo o/n --json <fields> call and returns the full object — the merge-readiness picture (mergeable/mergeStateStatus/reviewDecision/latestReviews) plus the metadata the drawer will render (labels/assignees/milestone/reviewRequests/closingIssuesReferences/files). number must be a positive int; anything else is an {"error"} returned without touching gh. The body is capped at 60000 chars with body_truncated: true when cut.
  • A small in-process TTL cache — cached(key, coro_fn, ttl=15), keyed by ("pr", repo, number) — coalesces the drawer's open + reflexive refreshes into one gh call; error results are never cached and fresh=True bypasses a live entry.
  • Mounts GET /detail/pr?repo=o/n&number=N[&fresh=1] on the gated /api/plugins/github prefix in build_data_router, with the FastAPI/detail imports kept lazy. No UI and no write routes were added.

All 24 requested JSON fields were verified present in gh pr view --json's field list on the real CLI, so none were dropped.

@protoreview protoreview Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

QA panel review — PASS

code-review-structural · head 515eeab97207 · formal

Low-risk, purely additive PR: a new detail.py module, its test file, and one new route in api.py. No correctness or cross-file defects were found. The single surviving item is a documentation nit — detail.py is missing from PROTO.md's §3 file-layout table. The verifier confirmed it against the file at head. No panel disagreement, no verification gaps, no prior requests to disposition.

Findings

Severity Location Finding Verified
⚪ nit PROTO.md The new detail.py module is not added to the file-layout table in PROTO.md §3, which documents every module in the package. confirmed
findings JSON (machine-readable)
[
  {
    "file": "PROTO.md",
    "line": 0,
    "severity": "nit",
    "category": "conventions",
    "claim": "The new `detail.py` module is not added to the file-layout table in PROTO.md \u00a73, which documents every module in the package.",
    "evidence": "PROTO.md \u00a73 lists `__init__.py`, `gh_cli.py`, `status.py`, `projects.py`, `read_tools.py`, `write_tools.py`, `review_tools.py`, `gh_issue.py`, `api.py`, `view.py`, `tests/` \u2014 but the PR adds `detail.py` without updating the table.",
    "verdict": "confirmed",
    "note": "Read PROTO.md at head 515eeab: \u00a73 table ends with `view.py` and `tests/`; `detail.py` is absent. The diff adds `detail.py` as a new module. Finding is accurate."
  }
]

1 finding(s) excluded from the verdict by in-diff confinement (file not among this PR's changed paths):

  • PROTO.md (nit) — The new detail.py module is not added to the file-layout table in PROTO.md §3, which documents every module in the package.

@protoreview protoreview Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Promoting the PASS verdict for head 515eeab97207: all checks terminal-green, zero unresolved review threads. (approve-on-green)

Open findings carried by this approval — non-blocking, but they did not go away:

  • nit PROTO.md:0 — The new detail.py module is not added to the file-layout table in PROTO.md §3, which documents every module in the package.

Approving a WARN does not resolve its findings (issue #22).

@mabry1985
mabry1985 merged commit 2a8ca74 into main Oct 26, 2026
4 checks passed
@mabry1985
mabry1985 deleted the feat/bd-nm78.1-github-view-data-detail-py-foundation-ga branch October 26, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant