Repository navigation
feat(#9536)!: resolve Jira started and closed states from status categories - #9925
Conversation
…gories `fullsend issues transition --state` now finds the Jira transition by status category, so repositories no longer need to configure status names for starting or closing an issue. - `--state started` (Jira only) takes the available transition whose target status category is `indeterminate`. It does nothing on an issue that is already in progress or done, so a re-run is safe and a start never reopens a closed issue. GitHub and GitLab return ErrNotSupported, and `--resolution` is rejected with it. - When several transitions fit `started` or `closed`, Jira's default status names break the tie: In Progress for a start; Done, then Closed, then Resolved for a close (case-insensitive). - If that still does not leave exactly one transition, nothing is written (not even the comment). The command exits 0 with a skip result: `skipped`, `reason`, and `candidates` (each with `transition` and `status`). - When a `--state closed` transition requires a resolution and none was passed, and there is no single allowed value, the site default from GET /resolution/search?onlyDefault=true is sent if the transition allows it. Otherwise it still errors. `--transition` and `--status` keep their current resolution handling. - jira.IssueType gains HierarchyLevel. The JSON result of `--state` runs includes `issue_type` and `hierarchy_level`, so callers can leave epics alone without listing type names. Docs: issues-commands guide and CLI reference updated. Note: pre-commit could not fetch its remote hook repositories (TLS failure in the sandbox). The hooks were run directly instead: whitespace/EOF checks, gofmt, go vet ./..., broken-symlink, docs-link and lychee link checks, plus the scan-secrets secret scan. All passed. The semgrep hook skipped: it could not download its pinned ruleset. BREAKING CHANGE: `--state closed` on Jira no longer exits non-zero when several done-category transitions are available and none targets a unique Done, Closed, or Resolved status. It now exits 0 with "skipped": true and lists the candidates. Callers that relied on the error must check the `skipped` field. Closes #9536 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🤖 Finished Review · ✅ Success · Started 11:51 AM UTC · Completed 12:02 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.70 |
Site previewPreview: https://9619090c-site.fullsend-ai.workers.dev Commit: |
|
Risk Assessment: moderate (2/5) DetailsModerate risk preserved: well-scoped feature addressing linked issue acceptance criteria with strong test coverage and no protected or security paths touched, balanced against change size (546 lines across 10 files), documentation churn, and modified behavior for ambiguous transitions without a feature flag. Previous runRisk Assessment: moderate (2/5) DetailsModerate risk: well-scoped feature addressing the linked issue acceptance criteria with strong test coverage and no protected or security paths touched, balanced against large diff size (543 lines across 9 files), documentation churn, and modified behavior for ambiguous transitions without a feature flag. |
|
Looks good to me Earlier findings
Previous run<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJhcHByb3ZlIiwiZmluZGluZ3MiOlt7InNldmVyaXR5IjoibWVkaXVtIiwiY2F0ZWdvcnkiOiJzdGFsZS1kb2MiLCJmaWxlIjoiZG9jcy9ndWlkZXMvZGV2L2NsaS1pbnRlcm5hbHMubWQiLCJpZCI6ImZfYzNmNmFmZDkyYjA2NmMwMiIsImxpbmUiOjE5NiwiYWN0aW9uYWJsZSI6dHJ1ZSwiZGltZW5zaW9uIjoiZG9jcy1jdXJyZW5jeSJ9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImJyZWFraW5nLWNsaSIsImZpbGUiOiJpbnRlcm5hbC90cmFja2VyL3RyYW5zaXRpb24uZ28iLCJpZCI6ImZfNWMzMjhlNDM2NTk0MTY2YSIsImxpbmUiOjIwNiwiYWN0aW9uYWJsZSI6ZmFsc2UsImRpbWVuc2lvbiI6ImNyb3NzLXJlcG8tY29udHJhY3RzIn0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoiYmFja3dhcmQtaW5jb21wYXRpYmxlIiwiZmlsZSI6ImludGVybmFsL2NsaS9pc3N1ZXNfdHJhbnNpdGlvbi5nbyIsImlkIjoiZl8yNzBkN2FkNTZkMTMwYmI1IiwibGluZSI6MTM5LCJhY3Rpb25hYmxlIjpmYWxzZSwiZGltZW5zaW9uIjoiY3Jvc3MtcmVwby1jb250cmFjdHMifV0sImRpc3Bvc2l0aW9ucyI6W3siaWQiOiJmX2MzZjZhZmQ5MmIwNjZjMDIiLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifSx7ImlkIjoiZl81YzMyOGU0MzY1OTQxNjZhIiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn0seyJpZCI6ImZfMjcwZDdhZDU2ZDEzMGJiNSIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9XX0= --> Looks good to me Earlier findings
Previous run (2)<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6InN0YWxlLWRvYyIsImZpbGUiOiJkb2NzL2d1aWRlcy9kZXYvY2xpLWludGVybmFscy5tZCIsImlkIjoiZl9jM2Y2YWZkOTJiMDY2YzAyIiwibGluZSI6MTk2LCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJkb2NzLWN1cnJlbmN5In0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoiYnJlYWtpbmctY2xpIiwiZmlsZSI6ImludGVybmFsL3RyYWNrZXIvdHJhbnNpdGlvbi5nbyIsImlkIjoiZl81YzMyOGU0MzY1OTQxNjZhIiwibGluZSI6MjA2LCJhY3Rpb25hYmxlIjpmYWxzZSwiZGltZW5zaW9uIjoiY3Jvc3MtcmVwby1jb250cmFjdHMifSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJiYWNrd2FyZC1pbmNvbXBhdGlibGUiLCJmaWxlIjoiaW50ZXJuYWwvY2xpL2lzc3Vlc190cmFuc2l0aW9uLmdvIiwiaWQiOiJmXzI3MGQ3YWQ1NmQxMzBiYjUiLCJsaW5lIjoxMzksImFjdGlvbmFibGUiOmZhbHNlLCJkaW1lbnNpb24iOiJjcm9zcy1yZXBvLWNvbnRyYWN0cyJ9XX0= --> ReviewFindingsMedium
Low
Labels: PR changes Go code in the issue tracker and Jira client. Next steps:
|
|
🤖 Finished Fix · ✅ Success · Started 12:04 PM UTC · Completed 12:08 PM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.21 |
🔧 Fix agent — iteration 1 (bot-triggered)Updated the PR description's Breaking change section to cover all three exit-0 behaviour changes (finding 1). Declined the optional distinct exit code for skip results (finding 2) since exit 0 with a documented Fixed (1):
Disagreed (1):
Tests: passed Conflict update: skipped; strategy PR metadata: body updated Finding threads:
Next steps:
Updated by fullsend fix agent |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
/fs-fix Address the medium stale-doc finding in docs/guides/dev/cli-internals.md: document both --state started and --state closed, noting started is Jira-only. |
|
🤖 Finished Fix · ✅ Success · Started 12:22 PM UTC · Completed 12:27 PM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.25 |
Address review feedback on PR #9925: the command tree for 'fullsend issues transition' listed only --state closed. List both values, noting that started is Jira only. Note: pre-commit hooks were not run (infrastructure failure: could not fetch hook repositories); trailing-whitespace, end-of-file and line-ending checks were verified manually. Go tests/lint not run as the change is documentation-only. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🔧 Fix agent — iteration 1 (human-triggered)Addressed the medium stale-doc finding per the human instruction by documenting both --state values in docs/guides/dev/cli-internals.md. The two low findings (BREAKING CHANGE trailer completeness, skip exit code) were outside the instruction and were not changed. Pre-commit could not fetch hook repos; whitespace checks verified manually. Go tests not run (docs-only). Fixed (1):
Tests: passed Conflict update: skipped; strategy
|
|
🤖 Finished Review · ✅ Success · Started 12:29 PM UTC · Completed 12:37 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.39 |
Superseded by updated review
There was a problem hiding this comment.
I reviewed this against issue #9536 to help @fullsend-ai/maintainers.
What I checked:
- All seven acceptance criteria in the issue are covered by the code and by tests.
- It merges cleanly with current main, and the tracker, jira and cli tests pass for me after the merge.
- Nothing else in this repo calls
issues transition, so the breaking change does not break anything here.
I did not find a bug so I’d approve.
One thing for the maintainers to decide (@ascerra , since you wrote the issue):
If several transitions fit, the command now exits 0 and returns skipped. But if no transition fits, it still fails with an error. Example: an issue sitting in a status that has no direct move to In Progress.
So an agent that runs --state started at the beginning of a run would fail on that issue. Is that what we want, or should "nothing fits" also be a skip? It is easier to choose now, before other code depends on it.
Small note: the PR says the author could not confirm if Jira calls the flag default or isDefault. The issue says isDefault, and the code reads both, so this is fine either way.
|
/fs-fix Merge the latest main into this PR branch, preserving existing commits. Resolve any merge conflicts while preserving the PR’s intended behavior, and run the required checks. Keep changes limited to updating the branch. |
|
Risk Assessment: moderate (2/5) DetailsModerate risk preserved: well-scoped feature addressing linked issue acceptance criteria with strong test coverage and no protected or security paths touched, balanced against change size (549 lines across 10 files), documentation churn, and modified behavior for ambiguous transitions without a feature flag. |
|
Looks good to me Earlier findings
|
Superseded by updated review
ascerra
left a comment
There was a problem hiding this comment.
Review with 3 findings posted inline (comment only, no approve or request changes). Each one is checked against head f794ee1.
The PR does what #9536 asked. All three findings trace back to wording in that issue, which I filed, so they come from the issue and not from the work in this PR.
- MEDIUM at
internal/cli/issues_transition.go:139, the skip for an ambiguous--stateexits 0, so a script that checks only the exit code reads it as the issue being started or closed - MEDIUM at
docs/guides/user/issues-commands.md:349, "does nothing" isn't what happens when a comment is passed - MEDIUM at
docs/guides/user/issues-commands.md:364,hierarchy_levelcomes back after the move, so it can't keep an epic from moving
@Benkapner on your question, I'd keep "no transition fits" as an error (here). In your example the issue wasn't started, and I'd want the caller to hear that, the same as in the first finding above. The same error also covers an account that lacks the Transition issues permission, because Jira returns no transitions then (Atlassian docs). I don't think the error has to fail a run. The code agent's optional start step on agents main passes a transition name today, and it logs a warning and carries on when the command fails (here). A --state started caller could do the same.
Verified: code and docs read and go test run for ./internal/tracker/, ./internal/forge/jira/ and ./internal/cli/ at f794ee1; raised by: Claude, DeepSeek
|
/fs-fix Address Adam’s three findings in review: Treat Adam’s review as a revision to #9536’s original requirements.
Update CLI tests to verify skip JSON plus the dedicated exit code for ambiguous starts and closes, and verify output-write errors take precedence. Retain coverage for no writes/comments on ambiguity and comments on already-satisfied states. Run the tracker, Jira, and CLI tests and required repository checks. Align all affected docs/help, the PR description, and BREAKING CHANGE wording with the revised contract. Keep the breaking-change marker because automatic transition selection and resolution fallback still change existing behavior. |
|
🤖 Finished Fix · ✅ Success · Started 10:18 AM UTC · Completed 10:30 AM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.85 |
Address maintainer review on PR #9925 (revised #9536 requirements). - An ambiguous `--state started|closed` on Jira (several transitions fit and no default status name picks one) still prints the skip JSON on stdout, including reason and candidates, then exits with the dedicated code 11 through the ExitCode() hook. A JSON write error takes precedence. Zero matching transitions stays an ordinary error; successful transitions and already-satisfied states still exit 0. tracker.TransitionResult gains Ambiguous so only this skip fails; other skips (for example #9534 issue-type filters) stay successful. - Help and docs say `--state started` on an already started or done issue leaves the status unchanged and still posts a requested comment, instead of "does nothing". - Drop the claim that issue_type and hierarchy_level let callers keep epics from moving: the result is built after the transition. The fields stay and report the kind of issue acted on. - CLI tests cover the skip JSON plus exit code for starts and closes, write-error precedence, zero matches, non-ambiguous skips, and already-satisfied states. Note: pre-commit could not fetch its hook repositories (TLS failure in the sandbox), so it did not run. gofmt, go vet, and git diff --check were run directly, and go test passed for ./internal/tracker/, ./internal/forge/jira/ and ./internal/cli/. BREAKING CHANGE: `--state` on Jira now exits 11 (after printing the skip JSON with "skipped": true) when several transitions fit and none reaches a unique default status, so the issue is not moved. Earlier in this PR `--state closed` exited non-zero as an ambiguous error here before becoming an exit-0 skip; callers should treat code 11 as "not moved, choose with --transition or --status". The command also now picks Done, Closed or Resolved automatically when exactly one is reachable, and falls back to the site default resolution when a required resolution cannot be selected, instead of failing as before. Addresses #9925 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🔧 Fix agent — iteration 4 (human-triggered)Addressed all three findings in one commit. Ambiguous Jira --state skips now print JSON and exit 11. The comment wording and the hierarchy_level claims are corrected in help, docs and the TransitionResult comment. PR description updated. Tracker, Jira and CLI tests pass. pre-commit could not fetch hook repos (TLS), so gofmt, go vet and git diff --check were run directly. Fixed (3):
Tests: passed CI inspections (1):
Conflict update: skipped; strategy Decision points
PR metadata: body updatedNext steps:
Updated by fullsend fix agent |
|
🤖 Finished Review · ✅ Success · Started 10:33 AM UTC · Completed 10:46 AM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.53 |
|
Risk Assessment: moderate (2/5) DetailsModerate risk preserved: well-scoped feature addressing linked issue acceptance criteria with strong test coverage and no protected or security paths touched, balanced against change size (657 lines across 10 files), documentation churn, and modified behavior for ambiguous transitions without a feature flag. |
|
Looks good to me |
Superseded by updated review
|
/fs-retro |
|
🤖 Finished Retro · ✅ Success · Started 1:01 PM UTC · Completed 1:04 PM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.29 |
|
PR #9925 (code agent, implements #9536: Jira Not filed because already covered: the doc-claim-vs-code miss (two of the three human findings) matches open fullsend-ai/agents#2068 (docs-currency subagent should verify behavioral claims against control flow), agents#2173, agents#895, #3497 and agents#961. One more data point: here the false claims were copied from the human-authored issue's wording and the review agent did not check them against code. I did not file a separate proposal. The author-declined, low-severity finding that a human later upgraded is covered by the one proposal filed. Proposals filed |
Summary
fullsend issues transition --statenow finds the Jira transition from status categories, so a repository no longer configures status names to start or close an issue. This adds--state started. When more than one transition fits a state, Jira's default names break the tie. If one still doesn't win, the command writes nothing, prints a skip that lists the candidates, and exits with code 11. A close that requires a resolution sends the site default when the transition allows it. The result also reports the issue type and Jira hierarchy level.Related Issue
Changes
internal/tracker/transition.go--state started(Jira) takes the transition whose target category isindeterminate. On an issue that is already in progress or done it leaves the status unchanged (changed: false) and still posts a requested comment. So a start never reopens a closed issue.startedorclosed, the preferred names decide:In Progressfor a start;Done, thenClosed, thenResolvedfor a close (case-insensitive). If no name leaves exactly one transition, the result isSkippedandAmbiguouswith aReasonandCandidates. Nothing is written, not even the comment. Zero matching transitions is still an ordinary error.--state closedwith a required resolution and no--resolution: the single allowed value is still used first. Otherwise the site default is sent if it is among the allowed values. Otherwise it errors as before.--transitionand--statuskeep their current resolution behaviour.--state startedreturnsErrNotSupported.--state started --resolutionis rejected.internal/forge/jira:IssueType.HierarchyLevel(*int,hierarchyLevel), andLiveClient.DefaultResolution(GET /rest/api/3/resolution/search?onlyDefault=true; no admin rights needed).internal/cli/issues_transition.go: the JSON result addsskipped,reason,candidates[{transition,status}],issue_typeandhierarchy_level, all omitted when empty. An ambiguous skip prints that JSON on stdout, then fails with exit code 11 (TransitionAmbiguousExitCode) through the existingExitCode()hook; a JSON write error takes precedence. Other skips (for example fullsend issues transition: add --if-issue-type predicate to gate Jira transitions by issue type #9534's issue-type filter) would still exit 0. The help text and--stateusage are updated.docs/guides/user/issues-commands.mdanddocs/cli/README.md.Breaking change
fullsend issues transition --stateon Jira changes three former errors:--state closedused to fail with an "ambiguous" error whenever several done-category transitions were available. It now picks Done, Closed or Resolved when exactly one of them is reachable and writes. Otherwise it prints the skip JSON and exits with code 11, writing nothing. Callers must handle code 11 as "issue not moved; choose with--transitionor--status".--state started.--state closedwhose required resolution could not be selected used to error. It now falls back to the site default resolution when the transition allows it, and writes.The commit and title carry
!and aBREAKING CHANGE:trailer.Notes for reviewers
hierarchy_levelandissue_typeare reported only on--stateruns, the only path that reads the issue. They describe the issue the command acted on. A moving run builds them after the transition, so they do not let a caller keep an epic from moving. Filtering before a transition is left to fullsend issues transition: add --if-issue-type predicate to gate Jira transitions by issue type #9534./resolution/searchnames the default flagdefaultorisDefault.Resolutiondecodes both, on top of the server-sideonlyDefault=truefilter. If neither is set, no default is assumed and the close errors as it does today.reason/candidatesso fullsend issues transition: add --if-issue-type predicate to gate Jira transitions by issue type #9534's issue-type skip can use the same shape. Only the ambiguous skip fails. A skip the caller asked for with a filter stays exit 0.Testing
new--transition/--statusresolution handling unchangedstartednot supportedDefaultResolutionandhierarchyLeveldecoding. CLI JSON contract tests cover the skip and hierarchy fields.go testpasses for./internal/tracker/,./internal/forge/jira/and./internal/cli/. Coverage on the changed functions is 89–100%.make lint:pre-commitcould not fetch its remote hook repositories in the sandbox (TLS failure). I ran the configured hooks directly: whitespace/EOF, gofmt,go vet ./..., broken-symlink, docs-link and lychee checks, and the secret scan. All passed. The semgrep hook skipped because it could not download its pinned ruleset, so CI's semgrep job is the check for that.Checklist
!for breaking changes)🤖 Generated with Claude Code
Implements #9536
Closes #9536
Post-script verification
agent/9536-jira-started-state)8e3080c9496e54a762ed3894f9cc792fc9c8d442..HEAD)