Skip to content

feat: Add --issueStatuses flag to sonarqube2hdf command#6661

Open
mikeBoterf wants to merge 4 commits intomitre:mainfrom
mikeBoterf:fix/sonarqube-issue-statuses-flag
Open

feat: Add --issueStatuses flag to sonarqube2hdf command#6661
mikeBoterf wants to merge 4 commits intomitre:mainfrom
mikeBoterf:fix/sonarqube-issue-statuses-flag

Conversation

@mikeBoterf
Copy link

Summary

Adds a new --issueStatuses (-s) flag to the saf convert sonarqube2hdf
command. This flag allows users to specify a comma-separated list of issue
statuses to include when pulling issues from the SonarQube API.

Changes

  • Added issueStatuses flag (short: -s) to the sonarqube2hdf command
  • The flag value is passed through to the SonarqubeResults constructor in
    @mitre/hdf-converters

Usage

# Use automatic status discovery (default - no flag needed)
saf convert sonarqube2hdf -n my-project -u https://sonar.example.com -a $TOKEN -o results.json

# Override with specific statuses
saf convert sonarqube2hdf -n my-project -u https://sonar.example.com -a $TOKEN -o results.json \
  -s "OPEN,CONFIRMED,ACCEPTED"

# Include all statuses explicitly
saf convert sonarqube2hdf -n my-project -u https://sonar.example.com -a $TOKEN -o results.json \
  -s "OPEN,CONFIRMED,FALSE_POSITIVE,ACCEPTED,FIXED"

Motivation

The upstream @mitre/hdf-converters library now supports dynamic issue status
discovery and a user-supplied override (see mitre/heimdall2#7791). This change
exposes that capability through the SAF CLI so operators can control which issue
statuses are retrieved without modifying source code.

Related

@mikeBoterf
Copy link
Author

@Amndeep7 @aaronlippold

@mergify
Copy link
Contributor

mergify bot commented Mar 13, 2026

This pull request has a conflict. Could you fix it @mikeBoterf?

@mikeBoterf
Copy link
Author

Recent changes have been pushed to the linked heimdall2 PR (mitre/heimdall2#7791) based on review feedback from @Amndeep7. The --issueStatuses flag has been renamed to --excludeIssueStatuses here to match the updated deny-list approach in the upstream converter. This PR is ready for re-review once the heimdall2 changes are merged and released.

Copy link
Contributor

@Amndeep7 Amndeep7 left a comment

Choose a reason for hiding this comment

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

There's a merge conflict that needs to be resolved

Copy link
Contributor

Choose a reason for hiding this comment

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

Merge conflict needs to be resolved and i would run the linter too just to make sure it picks up everything

Copy link
Author

Choose a reason for hiding this comment

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

Done — rebased on main, linter came back clean.

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't forget to update the readme to reflect the new functionality - it's mostly just copy pasting the help block into the readme and then formatting it nicely

Copy link
Author

Choose a reason for hiding this comment

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

Added — flag description and USAGE line updated in the README.

…ist approach

Update flag semantics to match heimdall2 review feedback:
- Rename flag from --issueStatuses to --excludeIssueStatuses
- Flag now specifies additional statuses to EXCLUDE (deny-list)
  rather than a full replacement list (allow-list)
- Update description to explain default exclusions and usage
- Update usage string to include the new flag
@mikeBoterf mikeBoterf force-pushed the fix/sonarqube-issue-statuses-flag branch from 834b344 to e62af78 Compare March 16, 2026 22:16
@mikeBoterf
Copy link
Author

@Amndeep7 Rebased on main (merge conflict resolved), ran the linter (clean), and added the new --excludeIssueStatuses flag to the README.

Copy link
Contributor

@Amndeep7 Amndeep7 left a comment

Choose a reason for hiding this comment

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

This PR should be good after this fix and once the upstream heimdall monorepo PR is merged.

Copy link
Contributor

Choose a reason for hiding this comment

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

please add another example (and update the readme accordingly) using this new flag

Copy link
Author

Choose a reason for hiding this comment

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

Added in 3b6a88f8 — second example showing -s flag with custom exclusions, in both the command and README.

Add second example showing -s flag with custom exclusions to both
the command definition and README.
@sonarqubecloud
Copy link

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.

2 participants