[go: up one dir, main page]

Add iteration list command

Problem to solve

Currently, there is no way via the CLI to get iteration information. Iteration information can be helpful, for instance, for getting issues in the current iteration. While filtering by iteration ID is possible for issues, there is no combination of commands currently that would allow me to do so. The first step in this is to create a command to fetch iteration information from the iteration API.

User Story:

As an engineer and scrum master, I would like to be able to easily view all issues in the current iteration. To do that, I need to be able to fetch the iteration ids from gitlab via the CLI.

Proposal

The following subcommand be added: iteration list.

Currently, the iteration API only supports listing, but this is sufficient for most use-cases. There may eventually be a desire to view as well, but list for now should be enough.

Further details

The eventual goal would be to be able to do something like get all issues in the current iteration. That would look like the following:

glab issue list --iteration $(glab iteration list --group MYGROUP --state current --output json | jq '.[0].id')

This would require an update to both issue list and to create the iteration command.

Implementation plan

Add new filter to: https://gitlab.com/gitlab-org/cli/-/blob/96b5fcb0f2802a69176b0e2aefa1f525f0139c0d/commands/issuable/list/issuable_list.go#L164-164

Add test for filter

Add new iteration command similar to https://gitlab.com/gitlab-org/cli/-/blob/96b5fcb0f2802a69176b0e2aefa1f525f0139c0d/commands/label/list/label_list.go#L24-24

Edited by Jay McCure