Skip to content

feat: plan and execute the remediations - #3

Open
ccf-lisa[bot] wants to merge 1 commit into
effector/02-github-clientfrom
effector/03-plan
Open

ccf-lisa[bot] wants to merge 1 commit into
effector/02-github-clientfrom
effector/03-plan

Conversation

@ccf-lisa

@ccf-lisa ccf-lisa Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Stack 3/5 for effector-github-settings: plan and execute the remediations.

Part 2 (plan) of Plugins → effector-github-settings, split out to keep each PR under 1000 lines; LLD (Rule parameters, Behaviour → Result). Ported from the PoC.

What

internal/plan.go:

  • read: reads only what the enabled remediations need (the repository always; collaborators and invitations only when enforced).
  • ComputePlan: direct collaborators to zero except keep, never the repository's owner (listed as kept); invitations for kept logins stay (email invitations can't be kept); web commit signoff in either direction.
  • execute: collaborators, then invitations, then signoff; stops at the first GitHub error and returns what it already changed. A PATCH GitHub answers with the old signoff value (an org policy) is an error. Each login is re-checked before it goes into a DELETE path.
  • One-line messages: dry-run: would …, applied: …, compliant: nothing to change, and the failed message with the partial changes; at most 10 names per change.

Tests (fake GitHub): reads only what's enforced, the plan (owner kept, case-insensitive keep, sorting, email invitations), signoff both ways, apply order and result, partial changes on a 403, signoff kept by GitHub, a bad login refused before any call, message wording.

Local gate

Build, vet, go test -race, golangci-lint (0 issues), go mod tidy -diff clean, with the sibling checkouts. CI fails on module resolution until 5/5 (accepted).

Counted lines: 458.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 9fe047ab-44a4-46b8-96d2-11a85d30f837

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Reads only the state the enabled remediations need, computes the changes (direct collaborators
to zero except keep and the owner, pending invitations, web commit signoff either way), makes
them in order (collaborators, invitations, signoff) stopping at the first GitHub error, and
words the one-line dry-run, applied and failed messages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@gusfcarvalho gusfcarvalho left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ccf-review: APPROVE

no findings.

Stack (gh stack 6): #1 → #2 → #3 → #4 → #5

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