Skip to content

Bug/issue 465#970

Open
madkoo wants to merge 12 commits intogithub:main-enterprisefrom
madkoo:bug/issue-465
Open

Bug/issue 465#970
madkoo wants to merge 12 commits intogithub:main-enterprisefrom
madkoo:bug/issue-465

Conversation

@madkoo
Copy link
Copy Markdown

@madkoo madkoo commented Apr 7, 2026

Fixes #465

  • Update schemas to target latest GitHub API

  • feat(schema): add bypass mode for reviewers in suborgs schema

  • Introduced a new "mode" property in the suborgs schema to specify the bypass mode for reviewers, with options "ALWAYS" and "EXEMPT".

fix(build-schema): enhance schema dereferencing with GitHub API spec

  • Updated the build-schema script to fetch and use the GitHub API spec URL from schema files, ensuring all internal $refs are resolved correctly before dereferencing.

test(branches): preserve existing branch protection settings

  • Enhanced tests to ensure that existing branch protection settings, including enforce_admins and restrictions, are preserved when updating branch protection configurations.
  • Added tests to verify normalization of restrictions and defaulting of missing arrays when preserving from GitHub.

…borg levels

- Introduced `repos.json` schema for repository-level safe-settings overrides.
- Updated `settings.json` schema to include additional properties for org-level configurations.
- Created `suborgs.json` schema for suborg-level safe-settings configuration.
- Enhanced the build script to dereference all schemas and handle errors during the process.
Copilot AI review requested due to automatic review settings April 7, 2026 11:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves safe-settings’ config validation and branch protection syncing by introducing JSON schemas (and a dereferencing build step tied to the GitHub REST API spec), updating REST API versioning references, and enhancing branch protection preservation behavior/tests.

Changes:

  • Added new JSON Schemas for org/suborg/repo config files and committed dereferenced schema outputs.
  • Updated script/build-schema to resolve GitHub REST API spec $refs reliably before dereferencing.
  • Enhanced branch protection syncing/tests to preserve existing GitHub settings (e.g., enforce_admins, restrictions) when omitted from config.

Reviewed changes

Copilot reviewed 25 out of 28 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
lib/plugins/branches.js Preserves existing branch protection fields and normalizes restrictions/status checks before updates.
test/unit/lib/plugins/branches.test.js Adds/adjusts tests for preserving enforce_admins/restrictions and normalizing restriction arrays.
script/build-schema Fetches GitHub REST API spec URL from schema sources and pre-dereferences it for stable dereferencing.
schema/settings.json Refactors schema into $defs and updates GitHub REST API spec references/version.
schema/suborgs.json Introduces suborg-level schema referencing GitHub REST API spec shapes.
schema/repos.json Introduces repo-level override schema referencing GitHub REST API spec shapes.
schema/dereferenced/settings.json Updated generated dereferenced org-level schema output.
schema/dereferenced/repos.json Added generated dereferenced repo-level schema output.
lib/settings.js Ensures org-level rulesets are applied first when syncing selected repos.
lib/plugins/custom_properties.js Avoids crashes by filtering null property names during normalization.
lib/plugins/rulesets.js Updates API version header and adjusts override metadata.
test/unit/lib/plugins/rulesets.test.js Updates expected API version header.
lib/plugins/variables.js / lib/plugins/autolinks.js / lib/plugins/collaborators.js Updates REST API doc links to the newer API version.
index.js Updates REST API version headers for rename-related content operations.
docs/** Updates documentation links to the newer API version; sample deployment validator script made safer via optional chaining.
app.yml Updates documentation link for Actions variables permission.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

madkoo and others added 3 commits April 9, 2026 11:05
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

Schema for validation of repos and suborgs

2 participants