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

[Feature request] Allow negative filtering by labels #934

Closed
h6ah4i opened this issue May 23, 2024 · 2 comments · Fixed by #935
Closed

[Feature request] Allow negative filtering by labels #934

h6ah4i opened this issue May 23, 2024 · 2 comments · Fixed by #935

Comments

@h6ah4i
Copy link
Contributor

h6ah4i commented May 23, 2024

Hi. I think it would be convenient if runn had more flexibility in filtering runbooks.

## examples
runn run path/to/**/*.yml --label !foo
runn run path/to/**/*.yml --label '!foo and !bar'

However, I am aware that introducing negative operator into the current label option can be troublesome. If possible, it might be better to introduce a new option that allows users to freely filter using the expr syntax.

## examples
runn run path/to/**/*.yml --filter '!labels.foo and !labels.bar'

runn run path/to/**/*.yml --filter '!labels.foo' --filter '!labels.bar'
#  converted to  => (!labels.foo) and ('!labels.bar)

runn run path/to/**/*.yml --filter '!labels["foo"]' --filter '!labels["bar"]'
#  converted to  => (!labels["foo"]) and ('!labels["bar"])
k1LoW added a commit that referenced this issue May 23, 2024
@k1LoW
Copy link
Owner

k1LoW commented May 23, 2024

@h6ah4i Thank you for your request!

Could your requirements be met with features such as #935?

@h6ah4i
Copy link
Contributor Author

h6ah4i commented May 23, 2024

@k1LoW The PR #935 looks great to me! Thank you!

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 a pull request may close this issue.

2 participants