feat: add container and python examples, and fix repo validation - #1
Merged
Conversation
Two features had no examples: exec's `container` block, and Python execution.
The docker/ examples drive the docker CLI as the task, which is a different
thing from running a task inside an image, so nothing here showed the latter.
container/toolchains.flow covers pinned toolchains, env and secret passing,
extra volumes, workspace mount and workdir overrides, and entrypoint selection.
Every executable in it was run against a real docker daemon rather than only
schema-validated.
python/ covers inline `interpreter: python`, params through os.environ, running
a .py by extension, tracebacks reporting real line numbers, mixing shell and
Python steps in one serial executable, and Python in a container.
python/scripts.flow imports a .py through `imports`, with the same f: comment
metadata syntax shell scripts use.
The validation executable was checking one file. It globbed *.flow from the
workspace root, which matches only validate.flow itself - every example lives in
a subdirectory and none of them were ever checked, despite the README saying
otherwise. It now walks the tree and also validates the workspace config and the
template.
That immediately surfaced four invalid files, all of which had been passing CI:
- basics/launch.flow declared `wait` on a launch, which is not a field
- docker/containers.flow, go-project/release.flow, and setup/database.flow
each put `params` on the executable rather than on its type
Python examples need a flow build carrying the interpreter field. CI already
installs flow from main, so they validate as soon as flowexec/flow#439 lands.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R328pa3FUUfga4gYah1iQi
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.
Important
The Python examples need a flow build carrying the
interpreterfield. CI installs flow frommain, so they go green the moment flowexec/flow#439 lands. The container examples and the validation fix are independent and work today.Summary
Two features shipped without examples, and the repo's own validation was checking one file.
container/— running executables inside an imageNothing here used exec's
containerblock. Thedocker/examples drive the docker CLI as the task, which is a different thing from running a task inside an image — so the feature was undiscoverable from examples.container/toolchains.flowcovers pinned toolchains, env/secret passing, extra volumes, workspace-mount and workdir overrides, and entrypoint selection.Every executable in it was run against a real Docker daemon, not just schema-validated:
That caught a bug in my first draft: I wrote
cmd: "-c '...'"withentrypoint: sh, not realising flow already wrapscmdassh -c. It failed withsh: illegal option. Schema validation would never have found it.python/— Python executablespython/basics.flowcovers inlineinterpreter: python, params viaos.environ, running a.pyby extension, tracebacks reporting real line numbers, mixing shell and Python steps in oneserial, and Python in a container.python/scripts.flowimports a.pythroughimports, using the samef:comment metadata shell scripts use.All verified by running them. The traceback example asserts its own claim — the error really is reported at line 4:
Validation was checking one file
validate.flowranflow schema validate *.flow --strictfrom the workspace root. That glob matches onlyvalidate.flowitself — every example lives in a subdirectory, so none had ever been checked, despite the README claiming "All.flowfiles in this repo are schema-validated in CI".It now walks the tree (
find, sinceflow schema validatetakes explicit paths) and also validates the workspace config and the template. Coverage went from 1 file to 24.That immediately surfaced four invalid files that had been passing CI:
basics/launch.flowwaitdeclared on alaunch, which has no such fielddocker/containers.flowparamson the executable instead of its typego-project/release.flowsetup/database.flowAll four are fixed here — the
paramsblocks moved under theserialthey feed.Testing
Plus the live runs above. Note the README's structure table now distinguishes
docker/(driving the CLI) fromcontainer/(running inside an image), which is the point most likely to confuse someone browsing.🤖 Generated with Claude Code
https://claude.ai/code/session_01R328pa3FUUfga4gYah1iQi