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

Changes for handling org level rulesets #519

Merged
merged 15 commits into from
Oct 18, 2023
Merged

Conversation

decyjphr
Copy link
Collaborator

@decyjphr decyjphr commented Aug 17, 2023

Rulesets are now available in GitHub. These changes are to support configuring Rulesets using safe-settings.

Approach

We will support org level rulesets using -rulesets: entries in .github/settings.yml and repo level rulesets using -rulesets: entries in the .github/repos/<repo>.yml (deferring the handling of rulesets entries in <suborg>.yml until ruleset targeting using repo properties is available and we would want to do the same in suborg yml)

@decyjphr
Copy link
Collaborator Author

decyjphr commented Oct 4, 2023

Added 2 env variables to control messages during errors or during the PR checkrun.

Env variable default behavior
CREATE_PR_COMMENT true Will show the differences in the PR comments between the existing config and the new changes being applied in the PR body
CREATE_ERROR_ISSUE true Will create an issue in the admin repo when there are errors when applying the settings. So the errors don't happen silently

Instead of this approach of creating an issue for showing the errors when safe-settings runs, I've made changes so a check is created for the latest commit. If there are errors the check shows as failure.

Previously when there were errors when applying safe-settings, or if the custom-validators return false, it is not visible to the users, with this approach, the checkrun details will show the errors when they occur.

@decyjphr decyjphr marked this pull request as ready for review October 18, 2023 00:24
@decyjphr decyjphr merged commit 1540810 into main-enterprise Oct 18, 2023
1 check passed
@decyjphr decyjphr deleted the decyjphr/repo-rules branch April 23, 2024 21:48
torgst pushed a commit to helse-sorost/safe-settings that referenced this pull request Oct 6, 2024
In github#519 configvalidators and overridevalidators started to be read from DeploymentConfig, but the constructor params was not removed.
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.

1 participant