Repository navigation
Commit 6517aaf
authored
Add scan.py to offload triage Jira scan from MCP to REST API (#79)
## Summary
- Adds `triage/scripts/scan.py` that replaces the AI-driven `/scan`
phase with a deterministic Python script calling the Jira REST API
directly, eliminating ~50-100K tokens of mechanical MCP pagination per
run
- Key-based cursor pagination (Jira Cloud ignores `startAt`),
ADF-to-text extraction, issue normalization, retry with backoff on
429/5xx, dual auth (Basic for API tokens, Bearer for PATs)
- 102 unit + integration tests with fixture data, structured in layers
(pure functions, pagination with fake search callable, integration with
mocked HTTP)
- Updates `scan.md` skill file, `guidelines.md` tool table, `README.md`
prerequisites, and `SKILL.md` version (0.1.0 → 0.2.0)
**Merge-order note:** PR #78 also bumps triage to 0.2.0 and makes
identical CI changes (`test.yaml`, `lint.yaml`). Whichever merges second
should rebase and bump to 0.3.0 — each PR introduces its own MINOR
change and needs a distinct version.
## Test plan
- [x] 102 unit + integration tests pass (`python3 -m pytest
triage/scripts/test_scan.py -v`)
- [x] Live-tested against Jira Cloud (`redhat.atlassian.net`, project
EDM) — 154 unresolved bugs paginated correctly, fields normalized, ADF
descriptions extracted as readable text
- [x] Markdown lint passes on all changed files
- [x] Structure validation passes (`pre-review-checks.py triage`)
- [x] Existing `_shared/scripts` tests still pass
- [x] Code reviewed (2 iterations — 2 critical issues fixed:
guidelines.md tool table contradiction, script path convention)
Assisted-by: Claude Opus 4.6 (1M) <noreply@anthropic.com>1 parent f7f8c6d commit 6517aaf
6 files changed
Lines changed: 1651 additions & 135 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
0 commit comments