Skip to content

Add support for filtering by status#560

Open
redcatbear wants to merge 1 commit into
mainfrom
feature/519_support-filtering-specification-items-by-status
Open

Add support for filtering by status#560
redcatbear wants to merge 1 commit into
mainfrom
feature/519_support-filtering-specification-items-by-status

Conversation

@redcatbear

Copy link
Copy Markdown
Collaborator

This pull request adds functionality to filter items by their status.
Introduces new command line switch -w and --wanted-statuses

Closes #519.

@redcatbear redcatbear requested a review from kaklakariada July 11, 2026 14:37
@redcatbear redcatbear self-assigned this Jul 11, 2026
@redcatbear redcatbear added feature ai-assisted Written with the help of an LLM labels Jul 11, 2026
@sonarqubecloud

Copy link
Copy Markdown

*/
public boolean isStatusCriteriaSet()
{
return this.wantedStatuses != null && !this.wantedStatuses.isEmpty();

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.

Add a non null check to the constructor and remove the null Check here

Comment on lines +42 to +43
assertThat(filterSettings.getWantedStatuses(), containsInAnyOrder(expectedStatuses));
assertFilterSet(filterSettings, true);

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.

Use assertAll

Comment on lines +7 to +8
We added a new feature to filter specification items by status at import time via `-w` or `--wanted-statuses` CLI parameters.
This is helpful when your project uses specification documents for planning future requirements (marked by the status "draft" or "porposed").

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.

A typical use case is to exclude only draft items. If I understand correctly, this would require specifying all other status in this option?

Another remark: We often don't use the status field for items. Only when we add items we mark them as draft. Would it be possible to allow including items without status?

() -> assertThat(getOutputFileContent(), containsString("2 total")),
() -> assertThat(getOutputFileContent(), containsString("req~draft~1")),
() -> assertThat(getOutputFileContent(), containsString("req~proposed~1")),
() -> assertThat(getOutputFileContent(), not(containsString("req~approved~1")))

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.

Suggested change
() -> assertThat(getOutputFileContent(), not(containsString("req~approved~1")))
() -> assertThat(getOutputFileContent(), not(containsString("approved")))

be more strict

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Written with the help of an LLM feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support filtering specification items by status

2 participants