feat: smart GHA/GitLab generation via cigen (PR5/7)#18
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add optional from_plan (field 7) and phase_config (field 8) to both CIGenerateConfig and CIGenerateInput. from_plan allows rendering from a pre-computed CIPlan JSON; phase_config wires a prereq deploy phase. Regenerated pb.go via protoc v35 + protoc-gen-go (paths=source_relative). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rcleci keep templates) Route github_actions and gitlab_ci through cigen.Analyze → Render* instead of the old template generators. from_plan (field 7) allows rendering from a pre-computed CIPlan JSON. phase_config (field 8) injects a prereq deploy phase. Jenkins and CircleCI continue to use the existing template generators. TDD: add 4 targeted tests — CigenMarkers for github_actions (secrets env, wfctl migrations up, no old build.yml/deploy.yml split) and gitlab_ci (WFCTL_VERSION, migrations up, no image: golang line); TemplateUnchanged for jenkins + circleci. testdata/app.yaml: representative config with env_vars_secret + ci.migrations. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ve CI paths When infra_config is an absolute path (or outside the repo checkout), cigen.Analyze's filepath.Rel(cwd, abs) can yield an absolute or "../"-escaping path that lands in the generated `wfctl infra apply --config <path>` steps and the `paths:` trigger filter, producing CI that never matches a checkout. Pass a cleaned repo-relative alias via cigen.Options.ConfigPathAlias (and PhaseConfigAlias when phase_config is set): cleanConfigAlias collapses absolute or ".."-containing paths to the base filename, else filepath.Clean. Tests: TestExecuteCIGenerateGitHubActions_AbsoluteConfigRendersRepoRelative (absolute tmp config renders `--config 'deploy.yaml'` + relative paths entry, no absolute/".." leak) and TestCleanConfigAlias unit cases. Also annotate the retained NewGitHubActionsGenerator/NewGitLabCIGenerator as template-reference fallbacks (those platforms now route through cigen) so the unreferenced constructors don't read as dead code. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced May 30, 2026
intel352
added a commit
that referenced
this pull request
May 31, 2026
* chore: bump plugin to v0.3.0 — v0.2.0 tag already released for #18 (cigen GHA/GitLab); #804 extends config-derived to jenkins/circleci * docs: pin example to v0.3.0
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
PR5 (final) of the wfctl secrets wizard + smart CI cascade. Rewires
step.ci_generate's github_actions and gitlab_ci platforms to the new config-derivedcigenengine (workflow v0.67.0), so the plugin step produces the same smart, deploy-ready output aswfctl ci generate. jenkins and circleci keep their existing template generators (smart support for those is future work).Changes
build(deps): bumpgithub.com/GoCodeAlone/workflowv0.64.0 → v0.67.0 (exportscigen).feat(contract): additivefrom_plan+phase_configoptional fields onCIGenerateInput(next free field numbers; no renumbering). pb.go regenerated with protoc.feat:ExecuteCIGenerateroutes github_actions/gitlab_ci throughcigen.Analyze+cigen.RenderGitHubActions/RenderGitLabCI(or renders afrom_planCIPlan JSON directly); writes via the existing path-traversal-guarded writer. jenkins/circleci untouched.chore: bumpminEngineVersion0.53.0 → 0.67.0 (cigen requires it).Behavior delta
github_actions output now carries cigen-derived secret env bindings (
${{ secrets.* }}fromenv_vars_secret), a functionalwfctl migrations upstep, and a healthz smoke job — none of which the old template produced. Verified byTestExecuteCIGenerateGitHubActions_CigenMarkers; jenkins/circleci confirmed unchanged by their template-unchanged tests.Verification
GOWORK=off go build ./... && go test ./...→ all 27 pass;golangci-lint→ 0 issues.Notes
🤖 Generated with Claude Code