Compilation workflow: pre-push hooks, validation, and recipe lifecycle #2
thorwhalen
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The problem
reci compiles recipes into GitHub Actions workflows. But once compiled, the recipe and the workflow can drift apart — someone edits the workflow directly, or updates the recipe but forgets to recompile. This silent divergence is error-prone: the workflow runs fine but no longer matches the recipe, and nobody notices until something breaks.
Compilation at push time
One approach: a pre-push git hook (or pre-commit hook) that automatically recompiles the recipe before every push. This gives a "dynamic" feel (always up-to-date) while maintaining the compiled-workflow-on-remote guarantee that GitHub Actions needs.
This is especially valuable during the development phase of a CI pipeline, when the recipe changes frequently — you're iterating, pushing to validate on GitHub (since local tools like ACT don't support everything, e.g., artifacts). Once the CI stabilizes, changes are rare, and the hook becomes a lightweight safety net.
However, compilation-on-push should probably be an opt-in mode, not the default. The rationale:
Validation as an alternative to dynamism
Instead of (or in addition to) automatic recompilation, reci can validate that a recipe and its compiled workflow are still aligned:
reci already has a validation framework (DAG, FLOW, CONF, PURITY, ACT rules). A new rule category (e.g.,
SYNC001: recipe/workflow mismatch) would fit naturally.Recipe lifecycle — where does the recipe live?
Two mental models:
ci/recipe.yml), is versioned, and is the source of truth. The compiled workflow is a derived artifact.Both are valid. reci should support both, with the tooling (hooks, validation) available for those who choose model 1, without imposing it on those who prefer model 2.
Best practices for each model
Model 1 (recipe-in-project):
ci/recipe.yml,.reci/recipe.yml, or project root)Model 2 (recipe-as-tool):
reci compilemanually when CI needs updatingPractical next steps
reci hook installcommand that sets up a pre-push hook for automatic recompilationSYNCvalidation rule category for recipe/workflow alignment checksOpen questions
ci/,.reci/, project root?)Context
From a conversation between @thorwhalen and @valentin-feron. Key insight: during CI development, recipes might change frequently (lots of push-test cycles, especially since ACT doesn't support artifacts). After stabilization, changes are rare. The tooling should serve both phases. But we should encourage parametrization over recipe editing.
Beta Was this translation helpful? Give feedback.
All reactions