Commit 22705e8
authored
* feat(jira): transition originating issue across workflow as tasks progress
Move the originating Jira issue through its workflow so the board reflects the
task lifecycle: To Do → In Progress on start, → In Review on PR. Best-effort
only — logged and swallowed on any failure, sharing the existing 401/403 auth
circuit breaker, so the board never fails, blocks, or retries the task. Failed
tasks and tasks with no PR leave the status unchanged.
Status resolution ladder (per lifecycle point): per-project override
(--status-on-start / --status-on-pr) → safe heuristic (statusCategory
`indeterminate` on start, `In Review` name-match on PR) → skip with a warning.
Transitions requiring a screen and empty transition lists (no Transition Issues
permission) are skipped. No new OAuth scopes — read:/write:jira-work cover both
the transitions GET and POST.
- agent/src/jira_reactions.py: add transition_task_started / transition_pr_opened
best-effort helpers; extract shared circuit-breaker accounting.
- agent/src/pipeline.py: invoke helpers at the start hook and the success-path
PR hook (only when a PR was opened).
- cdk/src/handlers/jira-webhook-processor.ts: stamp optional
jira_status_on_start / jira_status_on_pr from the project mapping into
channel_metadata.
- cli/src/commands/jira.ts: add optional --status-on-start / --status-on-pr to
`bgagent jira map`.
- docs/guides/JIRA_SETUP_GUIDE.md: Board transitions section (defaults,
overrides, Transition Issues permission prerequisite) + troubleshooting.
Closes #572
* fix(jira): address review — crash-safe transitions, Linear-parity selection
Addresses isadeks' review on PR #605.
1. (correctness) _get_issue_transitions no longer raises AttributeError on
valid-but-non-object JSON (null / bare list / scalar). Previously
resp.json().get(...) could raise past the best-effort boundary, propagate
out of the pipeline hook, and flip an otherwise-successful task to FAILED
(worst case: after the PR opened). Now guarded with isinstance(dict).
2/3. (Linear parity) Rework transition selection to mirror the Linear
reference (prompt_builder.py):
- Start prefers a destination NAMED "In Progress" before the indeterminate
category fallback — fixes the order-dependent bug where "Blocked" (also
indeterminate) could be picked. The category fallback now excludes
"Blocked".
- PR prefers "In Review" then synonyms (Code Review / Review / Peer Review /
Reviewing) then falls back to "In Progress", so a stock board or a
Code-Review column isn't silently skipped.
- Skip if the issue is already at/past the target category (won't drag a
card backward on re-trigger). Fetches ?fields=status&expand=transitions
to get current status + transitions in one call. Overrides bypass the
already-past skip (deliberate instruction).
4. (hardening) CLI trims --status-on-start/--status-on-pr and treats
whitespace-only as unset, so a fat-fingered blank can't persist a
permanent no-op.
Tests: agent 43 (adds Blocked-vs-InProgress order, already-past skips, PR
synonym + In-Progress fallback, non-dict JSON parametrized); CLI adds trim +
whitespace-unset. Docs: resolution ladder rewritten to match. Full build green.
1 parent 8703f55 commit 22705e8
9 files changed
Lines changed: 1152 additions & 30 deletions
File tree
- agent
- src
- tests
- cdk
- src/handlers
- test/handlers
- cli
- src/commands
- test/commands
- docs
- guides
- src/content/docs/using
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
| |||
862 | 866 | | |
863 | 867 | | |
864 | 868 | | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
865 | 877 | | |
866 | 878 | | |
867 | 879 | | |
| |||
1057 | 1069 | | |
1058 | 1070 | | |
1059 | 1071 | | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
1060 | 1080 | | |
1061 | 1081 | | |
1062 | 1082 | | |
| |||
0 commit comments