-
Notifications
You must be signed in to change notification settings - Fork 1
Ci/dress rehearsal (STIT-476) #101
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
49becac
Add codex-written PLAN
AlexAxthelm ae22dc4
Update action triggers to trigger for next, hotfix, prod
AlexAxthelm e1ca313
rename ruleset file
AlexAxthelm cef1689
update `main` ruleset to align with other repos
AlexAxthelm ab33f91
Copy rulesets from PBTAR
AlexAxthelm 4a7a8ec
update rulesets to match repo policies
AlexAxthelm 1cf98bb
reorder file to pass checks
AlexAxthelm b37a0dd
include bypass actors as part of tracked rules
AlexAxthelm 87508ea
remove empty bypass actor lists
AlexAxthelm 12bd99f
Fix typo
AlexAxthelm 067c6a9
Fix typo
AlexAxthelm 48aef23
Fix typo
AlexAxthelm 50a3fd6
Potential fix for pull request finding
AlexAxthelm 94e2004
Trigger CI
AlexAxthelm e4eaa9f
Add bypass actor to ruleset
AlexAxthelm 603c2a1
return to excluding bypass actors, and document
AlexAxthelm e056f74
fix absolute path
AlexAxthelm b37916c
remove codex plan file
AlexAxthelm 9d30aaf
Update docs
AlexAxthelm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # GitHub Rulesets | ||
|
|
||
| These JSON files represent [GitHub Rulesets](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets). | ||
|
|
||
| Each is created by exporting an existing ruleset in effect in this repo. | ||
|
|
||
| ## Important limitation | ||
|
|
||
| GitHub's rulesets API only returns `bypass_actors` when the caller has write | ||
| access to the ruleset. The default Actions token used in | ||
| [`admin-check_rulesets.yml`](../workflows/admin-check_rulesets.yml) | ||
| does not reliably expose that field, so the rulesets check intentionally ignores | ||
| `bypass_actors` in both the local files and the remote API response. | ||
|
|
||
| That means bypass lists are currently treated as UI-managed policy rather than | ||
| fully verified by CI. | ||
|
|
||
| # Export | ||
|
|
||
| To create a ruleset file from an existing ruleset (usually created through the web UI): | ||
|
|
||
| - In Repo Settings, on the sidebar, go to "Rules" -> "Rulesets". | ||
| - Find the ruleset you want to export. | ||
| - In the "..." (three dots) menu, "Export Ruleset". | ||
|
|
||
| # Import | ||
|
|
||
| NOTE: If you are updating an existing ruleset, see "Update" below. | ||
|
|
||
| To import a new ruleset (from a file) into the repo's settings: | ||
|
|
||
| - In Repo Settings, on the sidebar, go to "Rules" -> "Rulesets". | ||
| - Click the green "New Ruleset" -> "Import a ruleset". | ||
| - Navigate to a JSON file (on your local machine) that defines the ruleset you want. | ||
| - Scroll to bottom of page and **"Create"** | ||
|
|
||
| # Update | ||
|
|
||
| If you want to alter an existing ruleset: | ||
|
|
||
| - In Repo Settings, on the sidebar, go to "Rules" -> "Rulesets". | ||
| - Find the ruleset you want to update. | ||
| - Click on the ruleset name (not three-dots) to see ruleset definition in the WebUI. | ||
| - Rename the ruleset (suggestion `rule-name` -> `rule-name-old`) | ||
| - Set "Enforcement Status" to "Disabled" | ||
| - Scroll to bottom of page and **"Save Changes"** | ||
| - Return to "Rulesets" main page, and import the updated definition (see above, "Import"). | ||
| - Repeat if changing multiple rulesets | ||
| - _(Testing):_ | ||
| - Trigger an empty commit: `git commit -m "Trigger CI" --allow-empty` and push to trigger checking action | ||
| - The action **should fail** while the temporary `*_old` ruleset still exists. | ||
| - In the diff, confirm that: | ||
| - the updated ruleset has no unexpected differences from the JSON file in this repo | ||
| - the only remaining mismatch is the extra disabled `*_old` ruleset in GitHub | ||
| - If there are no differences in the ruleset you updated, then it has imported as expected, and you can delete the `*_old` ruleset in the Repo settings. | ||
| - "Rulesets" -> "`*_old`" -> "..." -> "Delete ruleset". | ||
| - Trigger a new empty commit and push. | ||
| - There should be no diffs, and actions run cleanly with new rulesets in effect. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| "id": 16825861, | ||
| "name": "gitflow-next-lifecycle", | ||
| "target": "branch", | ||
| "source_type": "Repository", | ||
| "source": "RMI/stitch", | ||
| "enforcement": "active", | ||
| "conditions": { | ||
| "ref_name": { | ||
| "exclude": [], | ||
| "include": [ | ||
| "refs/heads/next", | ||
| "refs/heads/hotfix/**" | ||
| ] | ||
| } | ||
| }, | ||
| "rules": [ | ||
| { | ||
| "type": "creation" | ||
| }, | ||
| { | ||
| "type": "deletion" | ||
| } | ||
|
AlexAxthelm marked this conversation as resolved.
AlexAxthelm marked this conversation as resolved.
|
||
| ], | ||
| "bypass_actors": [ | ||
| { | ||
| "actor_id": 2, | ||
| "actor_type": "RepositoryRole", | ||
| "bypass_mode": "always" | ||
| } | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| { | ||
| "name": "gitflow-next-pr", | ||
| "target": "branch", | ||
| "source_type": "Repository", | ||
| "source": "RMI/stitch", | ||
| "enforcement": "active", | ||
| "conditions": { | ||
| "ref_name": { | ||
| "exclude": [], | ||
| "include": ["refs/heads/next"] | ||
| } | ||
| }, | ||
| "rules": [ | ||
| { | ||
| "type": "non_fast_forward" | ||
| }, | ||
| { | ||
| "type": "update" | ||
| }, | ||
| { | ||
|
AlexAxthelm marked this conversation as resolved.
|
||
| "type": "pull_request", | ||
| "parameters": { | ||
| "required_approving_review_count": 1, | ||
| "dismiss_stale_reviews_on_push": true, | ||
| "required_reviewers": [], | ||
| "require_code_owner_review": true, | ||
| "require_last_push_approval": true, | ||
| "required_review_thread_resolution": true, | ||
| "allowed_merge_methods": ["merge"] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| { | ||
| "name": "gitflow-production", | ||
| "target": "branch", | ||
| "source_type": "Repository", | ||
| "source": "RMI/stitch", | ||
| "enforcement": "active", | ||
| "conditions": { | ||
| "ref_name": { | ||
| "exclude": [], | ||
| "include": ["refs/heads/production"] | ||
| } | ||
| }, | ||
| "rules": [ | ||
| { | ||
| "type": "deletion" | ||
| }, | ||
| { | ||
| "type": "non_fast_forward" | ||
| }, | ||
| { | ||
| "type": "creation" | ||
| }, | ||
| { | ||
| "type": "pull_request", | ||
| "parameters": { | ||
| "required_approving_review_count": 2, | ||
| "dismiss_stale_reviews_on_push": true, | ||
| "required_reviewers": [], | ||
| "require_code_owner_review": true, | ||
| "require_last_push_approval": true, | ||
| "required_review_thread_resolution": true, | ||
| "allowed_merge_methods": ["merge"] | ||
| } | ||
| }, | ||
| { | ||
| "type": "required_status_checks", | ||
| "parameters": { | ||
| "strict_required_status_checks_policy": false, | ||
| "do_not_enforce_on_create": false, | ||
| "required_status_checks": [ | ||
|
|
||
| { | ||
| "context": "Linting / Linting (frontend)", | ||
| "integration_id": 15368 | ||
| }, | ||
| { | ||
| "context": "Linting / linting (ruff)", | ||
| "integration_id": 15368 | ||
| }, | ||
| { | ||
| "context": "Tests / Run Unit Tests (frontend)", | ||
| "integration_id": 15368 | ||
| }, | ||
| { | ||
| "context": "Tests / tests (pytest)", | ||
| "integration_id": 15368 | ||
| }, | ||
| { | ||
| "context": "Format / formatting (ruff)", | ||
| "integration_id": 15368 | ||
| }, | ||
| { | ||
| "context": "Formatting / Format Check (frontend)", | ||
| "integration_id": 15368 | ||
| }, | ||
| { | ||
| "context": "Build / Build", | ||
| "integration_id": 15368 | ||
| }, | ||
| { | ||
| "context": "Build / Build Frontend", | ||
| "integration_id": 15368 | ||
| }, | ||
| { | ||
| "context": "docker compose build / docker compose build", | ||
| "integration_id": 15368 | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.