Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doing list --state: add option for active #94

Closed
operte opened this issue Nov 3, 2021 · 5 comments
Closed

doing list --state: add option for active #94

operte opened this issue Nov 3, 2021 · 5 comments

Comments

@operte
Copy link
Collaborator

operte commented Nov 3, 2021

Right now the only options are open, closed and all. at least having active would be useful.

@operte operte added the good first issue Good for newcomers label Nov 4, 2021
@operte
Copy link
Collaborator Author

operte commented Nov 19, 2021

This is a trickier problem than I first expected.

Turns out that work items have a state and states have a state category.
States are controlled by the user and they can have any name. Right now we check for state, which might not be compatible with teams that have non-default state names.

State categories are not alterable by the user. However, they are linked to the type of process that the project uses. azDo supports 4 projects: Basic, Agile, Scrum and CMMI. These have different state categories:

  • Basic and CMMI: Proposed, In Progress and Completed
  • Agile and Scrum: Proposed, In Progress, Completed, Removed

See https://medium.com/objectsharp/work-item-states-in-azure-devops-7f355918bc08

We could start checking state category instead of state. However, the user sees state in the web boards, and not the state category, so there would be no direct link between the two.

I don't think we can directly get the state category of the state of a work item.
There is a command to get all states that a board has, including their categories: https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/work-item-type-states/list?view=azure-devops-rest-5.0#definitions
We could run this command while doing init and store the categories in the config file. These can then be used to filter work items. It would also be clear to the user what the categories mean.

@operte operte removed the good first issue Good for newcomers label Nov 19, 2021
@timvink
Copy link
Collaborator

timvink commented Nov 19, 2021

Yeah storing the info in config would be nice. We have some states hard-coded right now (like which ones are 'active').

We should have some defaults when they are not specified in the config (for backward compatibility and for users that start without using the doing init command). Or an error specifying how & what to add to the config.

The question is how useful is this compared to the engineering effort. Good to consider alternatives; maybe to allow AND OR operators for filters. Then you could write a command to filter on issues with states you consider as 'active', and define an alias for it (or add it to your projects Makefile, like make show_active_issues).

@operte
Copy link
Collaborator Author

operte commented Nov 24, 2021

Hey Tim! :D

Good point on the engineering effort. This looks like a lot of work for something I don't see a great benefit to in the short term.
And I agree with the solution. I think the minimum we can do is allow the user to pass an arbitrary state to --state, but still keep our defaults. I'll pick this up sometime soon.

@timvink
Copy link
Collaborator

timvink commented Nov 24, 2021

I had a look at the github cli for gh issue list (link).

-S, --search <query>
Search issues with query
-s, --state <string>
Filter by state: {open|closed|all}

Maybe instead of allowing passing custom states to --state, we could implement --search. Devops also has a kind of query language, see here

@operte
Copy link
Collaborator Author

operte commented Feb 22, 2022

For this issue I'm planning to do the following:

I'll split this into different PRs.

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

No branches or pull requests

2 participants