feat: adopt safe-settings for repository configuration management#114
feat: adopt safe-settings for repository configuration management#114marcusburghardt wants to merge 5 commits into
Conversation
|
@sonupreetam it would be great to have your eyes on this PR since you also researched about alternative solutions. WDYT? |
|
@marcusburghardt This looks good to me, thank you for tagging me on this. The org-level rulesets from Previously, I had evaluated repository-settings-action (rejected legacy branch protection API only, per-repo model, doesn't support rulesets), looked at org-level rulesets via direct gh api scripts, and had a phased rollout plan sketched out (central YAML → reconciliation script → Enterprise org-level rulesets for immutability). safe-settings lands in a similar place architecturally but with a maintained engine instead of a custom script, which I think is the right trade-off. I noticed while briefly reviewing:
Happy to discuss further or put the formal review on the PR whenever you're ready. |
Creating org-level rulesets via POST /orgs/{org}/rulesets requires
Organization Administration: write, not read. Update design doc,
deployment spec, and task list to reflect the correct permission.
Addresses PR complytime#114 review feedback from @sonupreetam.
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Assisted-by: OpenCode (claude-opus-4-6)
|
Good catch. Creating org-level rulesets via |
Creating org-level rulesets via POST /orgs/{org}/rulesets requires
Organization Administration: write, not read. Update design doc,
deployment spec, and task list to reflect the correct permission.
Addresses PR complytime#114 review feedback from @sonupreetam.
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Assisted-by: OpenCode (claude-opus-4-6)
1566739 to
22f017c
Compare
|
@jpower432 and @jflowers , I would appreciate your reviews on this. I plan a gradual adoption, starting manually until a few (less critical) repositories are well tested then move to fully automated. This should reduce the maintenance burden while allowing a centralized and transparent enforcement of our relevant settings. |
Creating org-level rulesets via POST /orgs/{org}/rulesets requires
Organization Administration: write, not read. Update design doc,
deployment spec, and task list to reflect the correct permission.
Addresses PR complytime#114 review feedback from @sonupreetam.
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Assisted-by: OpenCode (claude-opus-4-6)
22f017c to
974bfda
Compare
|
Just rebased using GH interface. |
Define proposal, design, specs, and tasks for adopting github/safe-settings as a complementary tool to peribolos. safe-settings will manage repository settings (auto-merge, delete-branch-on-merge), branch protection rules, rulesets, and security configurations via GitOps. Peribolos continues to own org membership, team creation, and team-to-repo permissions. Signed-off-by: Marcus Burghardt <maburgha@redhat.com> Assisted-by: OpenCode (claude-opus-4-6)
Org-wide defaults, rulesets, and deployment config derived from auditing the current GitHub state of all complytime repos. Key decisions: - Code repos ruleset with 1 approver, stale review dismissal, code owner review, last push approval - Non-code repos ruleset with lighter protection (1 approver only) - complyctl override requiring 2 approvers - Override validator prevents lowering approver count below org default - .github repo excluded (manually managed, avoids circular dependency) - complyscribe and gemara-content-service excluded (archived/pending) Signed-off-by: Marcus Burghardt <maburgha@redhat.com> Assisted-by: OpenCode (claude-opus-4-6)
Align specs with implementation decisions: - required_signatures downgraded to SHOULD (deferred to follow-up) - required_review_thread_resolution set to false (matches current state) - Removed archived repos from spec and config repo lists Harden deployment and boundary specs: - Pinned commit SHA, workflow timeout, YAML pre-validation - Suborg/ruleset repo list synchronization requirement - Override validator falsy-0 bypass fix - Phases reordered: boundary tests before apply Signed-off-by: Marcus Burghardt <maburgha@redhat.com> Assisted-by: OpenCode (claude-opus-4-6)
Workflow (workflow_dispatch only, push/schedule added after validation): - Inputs: dry-run (default true), repos (optional comma-separated filter) - Generates scoped deployment-settings when repos is specified - YAML pre-validation, 15 min timeout, concurrency group Boundary tests (config/boundary_test.go): - Suborg repos exist in peribolos, no duplicate suborg membership - No cross-tool field overlap, suborg/ruleset repo list sync Makefile, docs, and spec updates: - safe-settings-validate target, extended lint, GOTOOLCHAIN=auto - MAINTAINING.md, README.md link, CODEOWNERS path rule - Specs updated for workflow_dispatch-only initial rollout Signed-off-by: Marcus Burghardt <maburgha@redhat.com> Assisted-by: OpenCode (claude-opus-4-6)
Creating org-level rulesets via POST /orgs/{org}/rulesets requires
Organization Administration: write, not read. Update design doc,
deployment spec, and task list to reflect the correct permission.
Addresses PR complytime#114 review feedback from @sonupreetam.
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Assisted-by: OpenCode (claude-opus-4-6)
974bfda to
69f1850
Compare
|
Rebased again using the GH Web Interface. |
Summary
Adopt github/safe-settings as a complementary tool to peribolos for managing the complytime GitHub org. Peribolos continues to own org membership, teams, and team-to-repo permissions. Safe-settings manages repository settings, rulesets, branch protection, and security configurations via GitOps.
What's included
openspec/changes/adopt-safe-settings/): design with 10 decisions, 7 specs, phased task listsafe-settings/): org-wide defaults, two rulesets (safe-settings: code reposandsafe-settings: non-code repos), complyctl 2-approver override, deployment settings with override validators. Derived from auditing the current GitHub state of all repos.safe_settings_sync.yml):workflow_dispatchonly withdry-run(default true) andrepos(optional filter) inputsconfig/boundary_test.go): 5 Go tests validating cross-tool consistency between peribolos and safe-settingsMAINTAINING.md(tool boundary, workflows, troubleshooting),README.mdlink,CODEOWNERSpath rule, Makefile targetsRelated Issues
openspec/changes/adopt-safe-settings/Design Note: workflow_dispatch-only Initial Rollout
safe-settings is a GitHub App (Probot-based) that reads its configuration from the admin repo's default branch via the GitHub API, not from the local filesystem. This is an architectural constraint: the
ConfigManagerfetchessettings.yml,suborgs/, andrepos/throughoctokit.repos.getContent(), and thefull-syncentry point (syncInstallation) does not accept a branch ref parameter.This means:
CONFIG_REFor similar env var to point at a feature branchGiven these constraints, the workflow starts with
workflow_dispatchonly (nopushorscheduletriggers) so that after merge:repos=complytime-demos,dry-run=true)dry-run=false) and verify in the GitHub UIpushandscheduletriggers in a follow-up PRThe
reposinput dynamically generates a scopeddeployment-settings.ymlat workflow runtime, restricting safe-settings to only the specified repositories.Review Hints
Review commits in sequence, each builds on the previous:
docs:spec proposal (design decisions, specs, tasks)feat:safe-settings YAML config (settings, rulesets, suborgs)fix:spec review findings (alignment fixes)feat:implementation (workflow, tests, docs, Makefile)fix:org admin permission correction (feedback from @sonupreetam)After merge, test with: Actions > "Safe Settings Sync" > Run workflow >
dry-run=true,repos=complytime-demosBoundary tests validate cross-tool consistency locally with no credentials needed:
make test-unitFull local validation:
make sanityPrerequisites already completed: GitHub App registered (ID: 3796583), credentials stored, "verifiy" ruleset renamed to "verify".