Skip to content

feat: atl jira sprint lifecycle commands (create/edit/start/close/list/move/backlog)#57

Merged
Hinne1 merged 17 commits into
mainfrom
claude/sprint-lifecycle-commands
Jun 23, 2026
Merged

feat: atl jira sprint lifecycle commands (create/edit/start/close/list/move/backlog)#57
Hinne1 merged 17 commits into
mainfrom
claude/sprint-lifecycle-commands

Conversation

@Hinne1

@Hinne1 Hinne1 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a full sprint lifecycle command group under atl jira sprint:

atl jira sprint create --board 42 --name "Sprint 30" --goal "..." [--start --duration 14d]
atl jira sprint edit 123 --goal "Updated goal"
atl jira sprint start 123 --duration 14d
atl jira sprint close 123            # prompts unless --force
atl jira sprint list --board 42 [--state active,future,closed]
atl jira sprint move NX-1 NX-2 --to 123   # or --sprint "name" --board 42
atl jira sprint backlog NX-1

Until now atl could only move issues between existing sprints (atl jira issue sprint) — it could not create a sprint, set a goal, or start/close one. This fills that gap.

Design

  • New internal/cmd/sprint/ group registered under the existing jira group (internal/cmd/jira/jira.go). No top-level alias; internal/cmd/issue/sprint.go is unchanged.
  • Pure logic (duration/date parsing, request-body building) isolated in dates.go with table tests; now injected for determinism.
  • Three thin Agile API passthroughs added to internal/api/jira.go: CreateSprint, UpdateSprint, GetSprint. UpdateSprint uses POST (Agile partial update — PUT would null omitted fields, verified against Atlassian docs).
  • No OAuth change: write:sprint:jira-software was already in DefaultScopes().
  • close confirms [y/N] unless --force/--json/non-TTY (mirrors issue/comment/delete.go). Every command supports --json.

Testing

  • make check green; golangci-lint 0 issues; full go test ./... passing.
  • Pure helpers (parseDuration, resolveActiveDates, build*Body) table-tested. Network-bound command/API wrappers follow the existing house pattern of no unit tests (const AtlassianAPIURL makes HTTP round-trips untestable).

Draft — pending live verification

Before marking ready, a live run against a real board will confirm (a) the goal persists at creation and (b) close/start/edit print a real sprint ID (not Sprint 0) — i.e. the Agile update endpoint returns a populated body. Trivial fallback fix on standby if not.

https://claude.ai/code/session_01BtsGd9FVEFf5L7FZZJvrLu

Hinne1 added 14 commits June 23, 2026 07:02
PUT is a full replace that nulls omitted fields; partial bodies like
{state:"closed"} would wipe name/goal/dates. POST is the Agile
partial-update verb.
…ints

If --duration or date flags are malformed, fail before the server-side
mutation so no unstarted sprint is left behind.

Claude-Session: https://claude.ai/code/session_01BtsGd9FVEFf5L7FZZJvrLu
Implements `atl jira sprint close <id>` with a [y/N] confirmation prompt
(skipped with --force, --json, or non-TTY stdin). GetSprint is used
best-effort to show the sprint name in the prompt; falls back to numeric ID
on error. Removes the placeholder stub from sprint.go.

Claude-Session: https://claude.ai/code/session_01BtsGd9FVEFf5L7FZZJvrLu
Match the existing 'atl jira issue sprint --sprint <name>' lookup
(issue/sprint.go) so name resolution is consistent across both commands.
- Fixed duplicate sprint names in examples (Sprint 30 → Sprint 31 for second create)
- Clarified backlog command moves issues out of sprints to board backlog
- Ensured example references are unambiguous

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new sprint command group (atl jira sprint) to manage the Jira sprint lifecycle, including commands to create, edit, start, close, and list sprints, as well as move issues in and out of sprints. Feedback on the changes highlights several improvement opportunities, including resolving timezone mismatches by using time.Now().UTC(), refining the sprint name matching logic to prioritize exact matches over substrings, and adding defensive nil-pointer checks when processing sprint objects returned from the API.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread internal/cmd/sprint/create.go Outdated
Comment thread internal/cmd/sprint/start.go Outdated
Comment thread internal/cmd/sprint/move.go
Comment thread internal/cmd/sprint/sprint.go
Comment thread internal/cmd/sprint/sprint.go
Comment thread internal/cmd/sprint/list.go
Hinne1 added 2 commits June 23, 2026 08:46
The Agile sprint endpoint caps page size server-side (~50), so boards with
many sprints previously returned only the first page. Follow startAt until
isLast so list/name-lookup see the full set.
…C now

- newSprintDetail/printSprint/list: guard against nil *Sprint elements
- move: two-pass name match (exact before substring) so an exact name is
  never shadowed by an earlier substring match; keeps substring fallback
- create/start: use time.Now().UTC() so the default start aligns with the
  UTC-parsed explicit dates
@Hinne1 Hinne1 marked this pull request as ready for review June 23, 2026 07:25
…, date doc

- GetSprints: terminate on short page + hard maxPages bound (guards a
  non-conformant server that ignores startAt / omits isLast)
- create: say 'Created and started' when --start so the message matches state
- docs: clarify create can take explicit dates without --start
@github-actions

Copy link
Copy Markdown

Merging this branch changes the coverage (1 decrease, 1 increase)

Impacted Packages Coverage Δ 🤖
github.com/enthus-appdev/atl-cli/internal/api 35.89% (-0.59%) 👎
github.com/enthus-appdev/atl-cli/internal/cmd/jira 0.00% (ø)
github.com/enthus-appdev/atl-cli/internal/cmd/sprint 16.96% (+16.96%) 🎉

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/enthus-appdev/atl-cli/internal/api/jira.go 16.56% (-0.86%) 465 (+23) 77 388 (+23) 👎
github.com/enthus-appdev/atl-cli/internal/cmd/jira/jira.go 0.00% (ø) 6 (+1) 0 6 (+1)
github.com/enthus-appdev/atl-cli/internal/cmd/sprint/backlog.go 0.00% (ø) 17 (+17) 0 17 (+17)
github.com/enthus-appdev/atl-cli/internal/cmd/sprint/close.go 0.00% (ø) 31 (+31) 0 31 (+31)
github.com/enthus-appdev/atl-cli/internal/cmd/sprint/create.go 0.00% (ø) 48 (+48) 0 48 (+48)
github.com/enthus-appdev/atl-cli/internal/cmd/sprint/dates.go 77.03% (+77.03%) 74 (+74) 57 (+57) 17 (+17) 🌟
github.com/enthus-appdev/atl-cli/internal/cmd/sprint/edit.go 0.00% (ø) 27 (+27) 0 27 (+27)
github.com/enthus-appdev/atl-cli/internal/cmd/sprint/list.go 0.00% (ø) 35 (+35) 0 35 (+35)
github.com/enthus-appdev/atl-cli/internal/cmd/sprint/move.go 0.00% (ø) 49 (+49) 0 49 (+49)
github.com/enthus-appdev/atl-cli/internal/cmd/sprint/sprint.go 0.00% (ø) 26 (+26) 0 26 (+26)
github.com/enthus-appdev/atl-cli/internal/cmd/sprint/start.go 0.00% (ø) 29 (+29) 0 29 (+29)

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/enthus-appdev/atl-cli/internal/cmd/sprint/dates_test.go

@Hinne1 Hinne1 merged commit 9a310b0 into main Jun 23, 2026
11 checks passed
@Hinne1 Hinne1 deleted the claude/sprint-lifecycle-commands branch June 23, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant