Skip to content

fix: scaffold submodules input in consumer ci.yml (#39)#41

Merged
kazmosahebi merged 1 commit into
mainfrom
fix/init-emit-submodules
Jun 9, 2026
Merged

fix: scaffold submodules input in consumer ci.yml (#39)#41
kazmosahebi merged 1 commit into
mainfrom
fix/init-emit-submodules

Conversation

@kazmosahebi

Copy link
Copy Markdown
Contributor

Refs #39. Scaffold half of the submodules story (PR #40 added the workflow input).

Problem

hyperi-ci init -> _render_workflow() only emits tag / from-head / bump (plus optional publish-target) into the generated consumer ci.yml. So the submodules input from #40 never reaches a consumer through the scaffold, and a hand-added submodules: line is clobbered on the next init --force.

Change

  • init reads a submodules: field from .hyperi-ci.yaml (_detect_submodules, mirroring detect_license).
  • _render_workflow emits submodules: <value> into the with: block when set (mirrors the existing publish-target conditional).
  • _render_hyperi_ci_yaml round-trips the field, so re-init preserves it.
  • Runtime-safe: CIConfig is .get()-based with no strict validation, so the new key is ignored by the config loader -- it's init-only.
  • docs/LESSONS.md: the public-submodule path now points at the .hyperi-ci.yaml field + init render.

Result

.hyperi-ci.yaml:

submodules: schemas

hyperi-ci init renders ci.yml:

    with:
      tag: ${{ inputs.tag || '' }}
      from-head: ${{ inputs.from-head || '' }}
      bump: ${{ inputs.bump || 'auto' }}
      submodules: schemas
    secrets: inherit

Verification

  • tests/unit/test_init.py: 51 passed.
  • Field declared in .hyperi-ci.yaml is ignored by the runtime config loader (confirmed CIConfig reads only known keys).

Together with #40, a consumer with a public submodule sets one field in .hyperi-ci.yaml and re-runs hyperi-ci init -- no manual workflow editing.

init only emitted tag/from-head/bump into the generated ci.yml, so the submodules input added in #40 never reached consumers -- and a hand-added line was clobbered on the next init --force.

- init reads a 'submodules:' field from .hyperi-ci.yaml and renders it as the submodules input in the consumer ci.yml with: block (mirrors the publish-target branch), round-tripping it into the regenerated .hyperi-ci.yaml so re-init preserves it.
- Runtime-safe: CIConfig is .get()-based, so the field is ignored by the config loader -- init-only.
- docs/LESSONS.md: point the public-submodule path at the .hyperi-ci.yaml field + init render.

Refs #39
@kazmosahebi kazmosahebi merged commit fec23fd into main Jun 9, 2026
5 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