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

Take into account hierarchy when dealing with rule types #3626

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

JAORMX
Copy link
Contributor

@JAORMX JAORMX commented Jun 14, 2024

Summary

Rule types are usable by projects down the hierarchy, this allows
someone in a child project to create a profile that uses rule types
approved in a parent project. This is very handy since folks with
permission to write profiles don't need to have permissions to write
rule types, they can simply use some already approved and created.

This also adds the constraint that rule type names are unique down the
hierarchy. That is, a user cannot create a rule type name that overrides
a rule type that exists in a parent project.

Fixes #3500

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 June 14, 2024 10:29
@JAORMX JAORMX force-pushed the ruletype-hierarchy branch 3 times, most recently from 56cfa0e to 38dcea4 Compare June 14, 2024 11:13
@JAORMX JAORMX requested review from jhrozek and rdimitrov June 14, 2024 11:15
@coveralls
Copy link

Coverage Status

coverage: 53.438% (-0.02%) from 53.454%
when pulling bce35ac on ruletype-hierarchy
into b351409 on main.

@coveralls
Copy link

Coverage Status

coverage: 53.428% (-0.03%) from 53.454%
when pulling bce35ac on ruletype-hierarchy
into b351409 on main.

@coveralls
Copy link

Coverage Status

coverage: 53.43% (-0.03%) from 53.456%
when pulling 350a12e on ruletype-hierarchy
into 457f6ab on main.

Rule types are usable by projects down the hierarchy, this allows
someone in a child project to create a profile that uses rule types
approved in a parent project. This is very handy since folks with
permission to write profiles don't need to have permissions to write
rule types, they can simply use some already approved and created.

This also adds the constraint that rule type names are unique down the
hierarchy. That is, a user cannot create a rule type name that overrides
a rule type that exists in a parent project.

Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
@coveralls
Copy link

Coverage Status

coverage: 53.414% (-0.04%) from 53.45%
when pulling 821f0e0 on ruletype-hierarchy
into cd5d5b4 on main.

@JAORMX JAORMX merged commit cd7a0f2 into main Jun 14, 2024
21 checks passed
@JAORMX JAORMX deleted the ruletype-hierarchy branch June 14, 2024 21:48
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.

Allow hierarchical profiles to take rules up in the hierarchy
3 participants