Repository navigation
feat: select GitHub issue imports and cap list volume - #116
Conversation
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
Summary by CodeRabbit
WalkthroughThe importer now supports direct imports of selected GitHub issues and caps list-mode imports with ChangesIssue selection and validation
Bounded list imports
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant CLI
participant runImport
participant GitHub
participant Tracker
CLI->>runImport: provide --issue or --limit
runImport->>GitHub: fetch selected issues or paginated list results
GitHub-->>runImport: issue responses
runImport->>runImport: validate selection or apply filters and limit
runImport->>Tracker: write validated import results
Merge Risk: ⚪ Minimal · up to
|
Reviewer's GuideThe PR adds exact GitHub issue endpoint selection and a capped, newest-updated list mode, wiring both through validated CLI options and the existing atomic/idempotent import pipeline, with comprehensive fixture-backed integration coverage and updated documentation. Sequence diagram for selected GitHub issue importsequenceDiagram
participant CLI
participant Importer
participant GitHub
participant Tracker
CLI->>Importer: parseImportOptions(options)
Importer->>Importer: parseIssueNumbers(repo, input)
loop selected issue numbers
Importer->>GitHub: GET /repos/{repo}/issues/{number}
GitHub-->>Importer: issue or HTTP 404
end
alt missing issue during normal import
Importer-->>CLI: error, no issues imported
else valid selection
Importer->>Tracker: import selected issues
Tracker-->>Importer: imported, updated, skipped
Importer-->>CLI: result with missingIssues when applicable
end
Sequence diagram for capped GitHub issue list importsequenceDiagram
participant CLI
participant Importer
participant GitHub
participant Tracker
CLI->>Importer: parseImportOptions(options)
Importer->>GitHub: GET /repos/{repo}/issues?sort=updated&direction=desc&per_page=n+1
loop pagination
GitHub-->>Importer: issue page and Link header
Importer->>Importer: applyClientFilters(issues, opts)
alt more than n eligible issues
Importer-->>Importer: retain n+1 and stop pagination
else no truncation proven
Importer->>GitHub: follow next page
end
end
Importer->>Tracker: import first n eligible issues
Tracker-->>Importer: import result with limit and truncated
Importer-->>CLI: bounded import result
Flow diagram for GitHub import mode validationflowchart TD
A[GitHub import command] --> B{--issue provided?}
B -->|Yes| C[parseIssueNumbers]
C --> D{Conflicting flags or invalid reference?}
D -->|Yes| E[Usage error]
D -->|No| F[Fetch selected issue endpoints]
B -->|No| G{--limit provided?}
G -->|Yes| H[Validate positive integer]
H --> I[Fetch newest-updated list with one-item probe]
G -->|No| J[Fetch existing list mode]
F --> K[Shared import pipeline]
I --> K
J --> K
K --> L[Atomic and idempotent tracker writes]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
@coderabbitai full review Please review head 85acd18, including outside-diff findings. |
|
|
@coderabbitai full review Please review head 85acd18, including outside-diff findings. |
✅ Action performedFull review finished. |
- [pm-github-fmrf](https://github.com/unbraind/pm-github/blob/main/.agents/pm/features/pm-github-fmrf.toon): #115 (1315818) - [pm-github-6srd](https://github.com/unbraind/pm-github/blob/main/.agents/pm/features/pm-github-6srd.toon): #116 (2d52ed1) Co-authored-by: SteveBot <1153461+unbraind@users.noreply.github.com>
Agents tracking a single GitHub issue currently have to approximate with
--since, which can import unrelated issues in a busy repository. This adds exact selection and a bounded list mode.pm github import owner/repo --issue 189fetches only that issue endpoint. Comma-separated numbers,#N, and same-repository references deduplicate before fetch; malformed or cross-repository references and conflicting list flags fail with usage errors. All selected numbers are fetched before tracker writes. A missing number refuses the batch, while dry runs reportmissingIssues; PR numbers require--include-prs. Comments, dependency linking, atomic transactions, gates, custom types, and provenance idempotency retain the shared import pipeline.--limit nrequests newest-updated order and stops list pagination after one extra eligible issue proves truncation. Results carrylimitandtruncated. Help, importer and legacy command examples, and README describe both flags. PR #115 blocker code is untouched.Before: tracking one issue needed a timestamp window and a check for accidental imports. After:
--issue 189fetches one endpoint; re-import updates the samegh:owner/repo#189item.Validation:
runImportfails the selection test 0/1 with AssertionError (2 imports instead of 1). Restoring onlybuildIssuesUrl/fetchAllIssuesfails the cap-plus-probe test 0/1 (3 issues instead of 2). Unchanged tests ran in disposable candidate copies; production source remained unchanged.pm github import unbraind/pm-web --issue 189 --dry-runplanned one import and left zero items; a real import created exactly one provenance-tagged item.npm run release:checkandbun run release:checkeach pass 546/546 tests with zero failures/skips/cancellations/todo and exact 100/100/100/100 coverage across 12 authored modules. The Bun release chain's coverage runner invokes Node.Package owner and full evidence: pm-github-6srd. Item remains in progress with its claim released.
Summary by Sourcery
Enable precise GitHub issue imports and safely cap repository list imports.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests:
Summary by cubic
Adds exact issue selection and a bounded list mode to
pm github import. Previously, tracking one issue meant approximating with--since, which could import unrelated issues in a busy repository;--issue 189now fetches only that issue endpoint, and--limit ncaps list-mode imports.--issueaccepts comma-separated numbers,#N, and same-repoowner/repo#Nreferences; references deduplicate before fetch, and malformed or cross-repo references fail with usage errors.missingIssuesinstead), and PRs require--include-prs.--limitfetches newest-updated order and stops after one extra eligible issue proves truncation; results carrylimitandtruncated.--issueconflicts with state/label/since/assignee/milestone filters and with--limit; both flags compose with comments, dependency linking, atomic imports, gates, and custom types, and re-imports update the samegh:owner/repo#Nitem.Written for commit 85acd18. Summary will update on new commits.