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

Fix mindev ruletype lint. #4828

Merged
merged 1 commit into from
Oct 25, 2024
Merged

Fix mindev ruletype lint. #4828

merged 1 commit into from
Oct 25, 2024

Conversation

blkt
Copy link
Contributor

@blkt blkt commented Oct 25, 2024

Summary

We recently changed the behaviour of minder ruletype create and apply to ignore files that do not define rule types. This allowed us to add test files to mindersec/minder-rules-and-profiles, but it in turn broke mindev.

This change makes mindev behave like minder by splitting folder walk from ruletype validation.

Fixes #4819

Change Type

Mark the type of change your PR introduces:

  • Bug fix (resolves an issue without affecting existing features)
  • Feature (adds new functionality without breaking changes)
  • Breaking change (may impact existing functionalities or require documentation updates)
  • Documentation (updates or additions to documentation)
  • Refactoring or test improvements (no bug fixes or new functionality)

Testing

Manually ran the following commands pre- and post-fix.

mindev ruletype lint -r ~/stacklok/minder-rules-and-profiles/rule-types/ --skip-rego
mindev ruletype lint -r ~/stacklok/minder-rules-and-profiles/rule-types/common/license.yaml --skip-rego
minder ruletype create -f ~/stacklok/minder-rules-and-profiles/rule-types/

Review Checklist:

  • Reviewed my own code for quality and clarity.
  • Added comments to complex or tricky code sections.
  • Updated any affected documentation.
  • Included tests that validate the fix or feature.
  • Checked that related changes are merged.

We recently changed the behaviour of `minder ruletype create` and
`apply` to ignore files that do not define rule types. This allowed us
to add test files to `mindersec/minder-rules-and-profiles`, but it in
turn broke `mindev`.

This change makes `mindev` behave like `minder` by splitting folder
walk from ruletype validation.

Fixes #4819
@blkt blkt self-assigned this Oct 25, 2024
@blkt blkt requested a review from a team as a code owner October 25, 2024 09:44
@blkt blkt merged commit 1bc9af5 into main Oct 25, 2024
24 of 25 checks passed
@blkt blkt deleted the fix/fix-mindev-ruletype-lint branch October 25, 2024 12:53
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.

Make mindev ignore non-ruletype files when linting
2 participants