Skip to content

Commit 0860532

Browse files
committed
Merge refactor.aignas.missing-package-error into feat.aignas.extras-helpers
2 parents a60c82a + 4cdd8f9 commit 0860532

124 files changed

Lines changed: 10772 additions & 818 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/plugins/pr-queue/README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ requests with buttons to launch manual code reviews in isolated Git worktrees.
88
- Displays open GitHub PRs filtered by review status, author, draft state, age,
99
or custom search query using the `gh` CLI.
1010
- Fetches on demand without automatic reviews or background polling.
11+
- Looking up a number shows live PR details (or detects asynchronously if a
12+
missing number is an issue), matching review chats, and launch actions.
1113
- Clicking a PR review button creates or updates a dedicated Git worktree at the
1214
PR head commit and starts a new conversation running
1315
`.agents/skills/review-code/SKILL.md`.
@@ -36,7 +38,7 @@ requests with buttons to launch manual code reviews in isolated Git worktrees.
3638
- `sidecars/pr_queue/git_worktree.py`: Git repo detection and PR worktree setup.
3739
- `sidecars/pr_queue/ls_client.py`: Loopback Language Server RPC client.
3840
- `sidecars/pr_queue/server.py`: HTTP backend serving the UI, cached PR queue,
39-
review conversation lookup, and worktree/chat launcher.
41+
PR/issue and review chat lookup, and worktree/chat launcher.
4042
- `sidecars/pr_queue/index.html`: Adaptive dark/light side panel frontend.
4143
- `sidecars/pr_queue/fetch_pr_queue_test.py`: Unit tests for `fetch_pr_queue`.
4244
- `sidecars/pr_queue/server_test.py`: Unit tests for `server`, `state_store`,

‎.agents/plugins/pr-queue/sidecars/pr_queue/fetch_pr_queue.py‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
PR_JSON_FIELDS = (
3838
"number,title,url,author,createdAt,updatedAt,headRefName,headRefOid,"
3939
"baseRefName,isDraft,reviewDecision,reviewRequests,reviews,latestReviews,"
40-
"additions,deletions,changedFiles,labels,statusCheckRollup"
40+
"additions,deletions,changedFiles,labels,state,statusCheckRollup"
4141
)
4242

4343
# Allow enough time for large PR lists over slower networks.
@@ -703,10 +703,10 @@ def normalize_pr(
703703
now: datetime.datetime,
704704
author_association: str = "",
705705
) -> PrSummary:
706-
"""Converts a single `gh pr list --json` item into a PrSummary.
706+
"""Converts a single `gh pr list` or `gh pr view` JSON item into a PrSummary.
707707
708708
Args:
709-
raw_pr: Parsed JSON object for one PR from `gh pr list`.
709+
raw_pr: Parsed JSON object for one PR from `gh pr list` or `gh pr view`.
710710
repo: Repository slug in `owner/name` form.
711711
viewer: Active GitHub login for viewer-scoped fields.
712712
max_age_days: Days since last update after which PRs are marked stale.
@@ -755,6 +755,7 @@ def normalize_pr(
755755
)
756756

757757
is_draft = bool(raw_pr.get("isDraft"))
758+
pr_state = str(raw_pr.get("state") or "OPEN").strip().upper() or "OPEN"
758759
review_decision = str(raw_pr.get("reviewDecision") or "").upper() or "NONE"
759760
is_my_pr = bool(viewer_lower and author_login.lower() == viewer_lower)
760761

@@ -801,6 +802,7 @@ def normalize_pr(
801802
checks_total=checks_total,
802803
action_needed=action_needed,
803804
is_stale=is_stale,
805+
state=pr_state,
804806
)
805807

806808

@@ -1136,7 +1138,7 @@ class FetchError(Exception):
11361138

11371139
@dataclasses.dataclass(frozen=True)
11381140
class PrSummary:
1139-
"""Normalized summary of an open GitHub pull request."""
1141+
"""Normalized summary of a GitHub pull request."""
11401142

11411143
# GitHub repository in owner/name format.
11421144
repo: str
@@ -1204,6 +1206,8 @@ class PrSummary:
12041206
action_needed: str
12051207
# Whether the PR exceeds max_age_days since updated_at.
12061208
is_stale: bool
1209+
# PR lifecycle state from GitHub (OPEN, CLOSED, or MERGED).
1210+
state: str = "OPEN"
12071211

12081212
def to_dict(self) -> dict[str, object]:
12091213
"""Serializes this summary into a JSON-compatible dict."""

‎.agents/plugins/pr-queue/sidecars/pr_queue/fetch_pr_queue_test.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,19 @@ def test_sanitize_log_text_strips_ansi_and_control_chars(self) -> None:
445445
"err next line",
446446
)
447447

448+
def test_normalize_pr_preserves_lifecycle_state(self) -> None:
449+
raw_merged = _make_raw_pr(60)
450+
raw_merged["state"] = "merged"
451+
summary = fetch_pr_queue.normalize_pr(
452+
raw_merged,
453+
repo="bazel-contrib/rules_python",
454+
viewer="alice",
455+
max_age_days=30,
456+
now=datetime.datetime(2026, 11, 12, 12, 0, 0, tzinfo=datetime.UTC),
457+
)
458+
self.assertEqual(summary.state, "MERGED")
459+
self.assertEqual(summary.to_dict()["state"], "MERGED")
460+
448461

449462
if __name__ == "__main__":
450463
unittest.main()

0 commit comments

Comments
 (0)