Skip to content

feat: scaffold, plugin config and rule parameters - #1

Open
ccf-lisa[bot] wants to merge 4 commits into
mainfrom
effector/01-scaffold-params
Open

ccf-lisa[bot] wants to merge 4 commits into
mainfrom
effector/01-scaffold-params

Conversation

@ccf-lisa

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

Copy link
Copy Markdown
Contributor

Stack 1/5 for the new effector-github-settings plugin: scaffold and rule parameters.

Implements part 1 of Plugins → effector-github-settings in the effectors implementation plan, per the LLD (Manifest, Rule parameters) and action parameters. Ported from the PoC (effectors-poc/effector-github-settings, branch effectors-phase1).

What

  • CI and release through the shared compliance-framework/workflows (see CI and release).
  • Makefile (build, test, lint, tidy-check), .goreleaser.yaml, .gitignore, release-please-config.json, .release-please-manifest.json.
  • internal/config.go: operator-only plugin config (token required, api_url optional); the plugin takes no action config (every key is an error pointing at params.defaults). Errors never quote the token.
  • internal/params.go: the remediate-apply capability's params_schema (lowercase snake_case names, x-ccf-order, x-ccf-depends-on) and parsing. mode defaults to dry-run and every remediation is off by default.
  • Tests: the schema passes the api's params.ValidateSchema, its defaults equal the Go defaults, values validate; keep parsing (spaces, case-insensitive, @, invalid logins); config errors.

CI and release

Modeled on plugin-github-repositories (master): thin callers of the shared compliance-framework/workflows reusable workflows, all pinned to v1.9.2 (dc74348), with push: branches: [main].

File Calls What it does
ci.yml ci-go-plugin.yml, release-checks.yml, notify-failure.yml gofmt, go mod tidy, toolchain line, go test, golangci-lint with the shared base config (no repo .golangci.yml), goreleaser check + snapshot build, actionlint, PR title, osv-scan; required is the one check to require. release-checks runs only on release-please PRs.
release-please.yml release-please.yml On push to main: opens/updates the release PR; merging it tags vX.Y.Z and publishes the release (as ccf-release-bot).
release.yml release-go-plugin.yml On release: published: goreleaser attaches the archives, gooci uploads dist/ once to ghcr.io/compliance-framework/effector-github-settings:vX.Y.Z, and crane points :latest at the same digest only for a final tag (an rc never moves :latest; the shared workflow decides that from the tag name).
preview.yml preview.yml (kind: go-plugin, on-main: false) Publishes :pr-<number> for PRs labelled preview; no :main previews.
cut-prerelease.yml cut-prerelease.yml workflow_dispatch: tags vX.Y.Z-rcN from the open release PR's version and creates a prerelease.
  • release-please bootstrap: release-please-config.json copies the shared release-please/defaults.json (bump-minor-pre-major, initial-version: "0.1.0", changelog sections) plus packages: {".": {"release-type": "go"}}; .release-please-manifest.json is seeded at 0.0.0 (no release yet, as the workflows repo bootstrapped), so the first release PR proposes 0.1.0.
  • .goreleaser.yaml gains release: {prerelease: auto, replace_existing_artifacts: true}, which the shared release job checks. Builds (binary plugin, linux/darwin, -X internal.Version) are unchanged.
  • Protocol annotation: release.yml passes no protocol-version. The shared workflow has no way to skip the annotation, so artifacts carry its default org.ccf.plugin.protocol.version=2; the agent ignores it for type: effector.
  • Removed: push.yml, test.yml, build-and-upload.yml and the tag-push release.yml (this replaces the earlier fix: pin CI actions, keep rc tags off :latest workflow changes).
  • The shared lint config enables bodyclose and errorlint; the GitHub client in 2/5 is adjusted for them.
  • Needs a repo admin before the first release: the release environment with the ccf-release-bot secrets (RELEASE_BOT_APP_ID, RELEASE_BOT_PRIVATE_KEY, applied by the workflows repo-settings run), the SLACK_BOT_TOKEN secret for CI failure notifications (optional), and GHCR write access for the package (packages: write from GITHUB_TOKEN; link the package to this repo if it already exists). Require the ci / required check on main.

Dependencies (temporary)

go.mod has replace github.com/compliance-framework/agent => ../agent and replace github.com/compliance-framework/api => ../api, commented as temporary: build with sibling checkouts of agent at effectors/09-cmd-effector-mode (agent#176) and api at effectors/26-effectors-e2e (api#626). CI's go, golangci-lint and goreleaser jobs (and so required) fail on module resolution (replacement directory ../agent does not exist) until the final PR of this stack (chore(deps): use agent v0.10.0-rc1 and api v0.23.0-rc1); accepted per the plan's "Build everything before releasing".

Deviations from the PoC

  • api_url must be https; http only for localhost/loopback (tests), and no userinfo: the token goes with every call.
  • No main package yet: it arrives with the plugin in 4/5.

Local gate (with the sibling checkouts)

go build ./..., go vet ./..., go test -race ./..., golangci-lint v2.15.0 with the shared workflows config (0 issues), gofmt, go mod tidy clean, actionlint v1.7.12 clean, goreleaser check valid. On GitHub the shared jobs that need no module resolution pass (actionlint, pr-title, osv-scan, notify, preview).

Counted lines: 879 (go.sum excluded).

🤖 Generated with Claude Code

ccf-lisa Bot and others added 2 commits December 2, 2026 07:22
Port of the PoC's effector-github-settings scaffold: CI and release from plugin-template
(adapted for an effector: binary "plugin", no protocol annotation), the operator-only plugin
config (token, api_url), and the remediate-apply capability's params schema with its parsing.
go.mod replaces the agent and api with sibling checkouts until the final PR of the stack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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: 11cd5f49-7a02-4e15-b754-9fcb7f406b82

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

@ccf-lisa
ccf-lisa Bot added this pull request to stack #6 December 2, 2026 10:31
Replace the plugin-template workflows (push -> test, any tag -> goreleaser + gooci) with
callers of compliance-framework/workflows v1.9.2, as plugin-github-repositories does:
ci (ci-go-plugin, release-checks, notify-failure), release-please, release
(release-go-plugin on release: published), preview (:pr-<n> for PRs labelled preview)
and cut-prerelease (vX.Y.Z-rcN). The shared release workflow moves :latest only for a
final tag, so the rc guard in the old upload step goes away.

release-please-config.json copies the shared defaults; the manifest is seeded at 0.0.0
(no release yet), so the first release PR proposes initial-version 0.1.0. goreleaser
gets release.prerelease: auto and replace_existing_artifacts, which the shared release
job checks.
The plugin reads token once at Configure, and an installation token
expires after an hour: it needs external rotation and an agent restart.

@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