Skip to content

Name the real config in generated hash steps and headers - #21

Merged
ndbroadbent merged 2 commits into
mainfrom
providers/config-path
Dec 4, 2026
Merged

ndbroadbent merged 2 commits into
mainfrom
providers/config-path

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

STATUS known problems 14 and 15: the coordinator's items (a) and (b). Rebased onto main (after #15, #19, #13, #20, #22 and #24).

(b) shares (a)'s plumbing (the provider has to know the config's name for both), so I did them together rather than coming back to it after the install step.

What changed

  • Protocol: CigenSchema.config_file, the config's path from the project root as written after --config (cigen.yml, .cigen, ci.yml). cigen generate fills it from the config path's file name; WorkflowOrchestrator::execute takes it explicitly.
  • cigen::plugin::config_file::config_flag, shared by both providers: no flag for cigen.yml or .cigen (cigen hash finds those by itself), --config <name> otherwise, and an error for a name that isn't safe in a shell command (or an empty one).
  • GitHub provider: the skip flow's cigen hash and the header use it. The header now reads # Source: <config> / # Regenerate with: cigen generate[ --config <name>].
  • CircleCI provider: its three cigen hash commands use it.
  • Config loader: a .cigen/ directory beside cigen.yml counts as a second layout only if it holds config files (config.yml, config/, commands/ or workflows/). The new scenario found this: the skip flow keeps its binary and caches in .cigen/ (bin/, cache/, skip-cache/), so after the first step every cigen.yml project "had both layouts" and the hash step failed. Item 5 (the install step) will move the binary out of .cigen/, but a .cigen/ of CI state shouldn't break loading either way.

Testing

  • Test first: skip_scenarios::a_cigen_yml_project_skips_and_runs (mockci) failed before the change and passes now. The first run executes, an unchanged tree skips, and a changed input runs.
  • config_layouts::a_cigen_dir_of_ci_state_beside_cigen_yml_is_not_a_second_layout.
  • github_provider::the_header_and_hash_step_name_the_real_config: cigen.yml gets no --config; ci.yml gets it in the header and the hash step.
  • Unit tests for config_flag and the CircleCI hash steps.
  • .github/workflows/ regenerated: only the header lines and the dropped --config .cigen. Golden fixtures unchanged (no fixture declares inputs, so none has a hash step). task ci green.

README: the Status sentence no longer lists cigen.yml projects as unable to skip in CI.

Docs

The site pages (docs/src/content/docs/): the skipping example has no --config, a note says when the hash step passes it, providers says what the header names, and configuration and cli say a .cigen/ of CI state is not a second layout.

@ndbroadbent
ndbroadbent force-pushed the providers/config-path branch 2 times, most recently from 1d6667e to 8dbbdc2 Compare December 4, 2026 01:10
Both providers ran `cigen hash --config .cigen`, so a cigen.yml project
failed at the hash step, and the GitHub header always named
`.cigen/workflows/` and a `cargo run` command.

The core now sends the config's path from the project root
(`CigenSchema.config_file`). Generated commands add `--config` only when
cigen wouldn't find the config by itself, and the header names the config
and the `cigen generate` command to rerun.

A `.cigen/` holding only CI state (the binary and caches the skip flow keeps
there) beside a cigen.yml is no longer taken for a second layout; the new
mockci scenario for a cigen.yml project hit exactly that.
@ndbroadbent
ndbroadbent force-pushed the providers/config-path branch from 8dbbdc2 to de0b4ae Compare December 4, 2026 01:34
@ndbroadbent
ndbroadbent merged commit af04562 into main Dec 4, 2026
8 checks passed
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