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

Make minder ruletype apply/create smarter #4798

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

JAORMX
Copy link
Contributor

@JAORMX JAORMX commented Oct 23, 2024

Summary

This changes the behavior of these commands...

If we only give one file or standard input, it will actually parse
and fail if it's not a minder resource (you probably REALLY wanted
to apply that file).

If it's a directory, it'll try to be smart and apply as much as it can.

It all depends on if the file was expanded or not.

Consequently, this fixes the issue we used to have with test files in
the minder-rules-and-profiles repo.

Co-Authored-By: Michelangelo Mori [email protected]

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

Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.

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.

@JAORMX JAORMX requested a review from a team as a code owner October 23, 2024 08:01
This changes the behavior of these commands...

If we only give one file or standard input, it will actually parse
and fail if it's not a minder resource (you probably REALLY wanted
to apply that file).

If it's a directory, it'll try to be smart and apply as much as it can.

It all depends on if the file was expanded or not.

Consequently, this fixes the issue we used to have with test files in
the `minder-rules-and-profiles` repo.

Co-Authored-By: Michelangelo Mori <[email protected]>
Signed-off-by: Juan Antonio Osorio <[email protected]>
@coveralls
Copy link

coveralls commented Oct 23, 2024

Pull Request Test Coverage Report for Build 11475620224

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 15 (0.0%) changed or added relevant lines in 2 files are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.001%) to 54.721%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/util/cli/cli.go 0 1 0.0%
internal/util/helpers.go 0 14 0.0%
Files with Coverage Reduction New Missed Lines %
internal/providers/gitlab/repository_properties.go 1 84.55%
internal/util/helpers.go 3 12.06%
Totals Coverage Status
Change from base Build 11474978290: 0.001%
Covered Lines: 14923
Relevant Lines: 27271

💛 - Coveralls

@JAORMX JAORMX merged commit d8014dc into mindersec:main Oct 23, 2024
25 checks passed
@JAORMX JAORMX deleted the fix-minder-apply branch October 23, 2024 08:21
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.

3 participants