November 1, 2026
8 pull requests merged across 1 repo
bahdotsh/wrkflw
Problem
Long steps failed. Docker stopped waiting on a step after 5 minutes and Podman after 6, regardless of timeout-minutes, while the job default is 360 minutes. A real build or test step over that limit failed, under Docker with an unexplained exit code of -1.
Timed-out containers kept running. When a job or step timeout fired, wrkflw reported the failure and moved on or exited, but the container was left running. After a run with timeout-minutes: 0.05 and sleep 300, podman ps still showed the step's container.
The two are linked: the caps existed to prevent hangs, but the engine's job and step deadlines already bound every step, as long as a timeout actually stops the container.
Changes
- Remove the per-step caps, so the job and step
timeout-minutesvalues govern. Short internal operations such as inspect and rm keep their limits. - Add
ContainerGuard, which force-removes a container when its run is abandoned. Dropping can't await, so it calls the CLI. - With
--preserve-containers-on-failurethe guard is off, so a timed-out container is kept for debugging, as with other failures.
Notes
- A step with no
timeout-minutescan now run for the full 360-minute job default. Hung steps take that long to fail unless a timeout is set, which matches GitHub. - Docker cleanup needs the
dockerCLI onPATH. If it's missing, a warning is logged and the container stays. - Kubernetes already has its own guard and is unchanged.
Testing
- Unit tests for the guard, using a fake CLI.
cargo test --workspaceandclippy -D warningspass.- End to end under Podman: a job timeout during
sleep 300left 0 containers, and a 390-second step, past the old 360-second cap, completed successfully. - Docker wasn't tested end to end, because the local daemon was down. The Docker path has only compiled and shares the guard, so please try it before merging.
Problem
wrkflw run .gitlab-ci.yml ran the wrong jobs, in the wrong environment. The riskiest part is that jobs a pipeline excludes were executed, so a guarded deploy would run locally.
| Pipeline config | Before | After |
|---|---|---|
image: (job, default:, top level) | ignored; ran in the default Ubuntu image | used |
rules: | ignored; the job always ran | first match decides, no match excludes the job |
rules: - when: never | ran | excluded |
only: / except: | ignored | refs, keywords, /regex/ and variables evaluated |
workflow:rules | ignored | an excluded pipeline skips every job |
when: manual | ran automatically | skipped unless named with --job |
when: on_failure | always ran | only after a failure |
when: always after a failure | ran | runs |
| A stage fails | later stages still ran | later on_success jobs are skipped |
default: before_script / after_script | ignored | used |
A job with no stage: | ran twice | runs once |
Changes
gitlab::job_whendecides each job's condition fromrules:,only:,except:andwhen:.gitlab::pipeline_exclusionevaluatesworkflow:rules.rules:ifsupports==,!=,=~,!~,&&,||, parentheses, bare variables,null, and quoted strings. Regex flagsi,mandsare supported.- The pipeline loop applies those conditions stage by stage, so
when:reflects earlier results. - Conversion resolves
imageand scripts through job, thendefault:, then top level. wrkflw run --variable KEY=value(-V) sets GitLab variables. They override pipeline and job variables, and reach rules, images and scripts.--job <name>runs the named job even if its gate orworkflow:ruleswould exclude it, with a warning. It doesn't lifton_failure, and an earlier stage failure still skips it.
Decisions worth reviewing
- A condition that can't be evaluated excludes the job. This covers a malformed
rules:if, a badonly:regex and an unsupported regex flag. A missing job is safer than a guarded deploy that runs. - The host environment is left out of rules, so a run doesn't depend on what's exported. Variables come from predefined values, pipeline and job variables, then
--variable. - Predefined variables are
CI,GITLAB_CI,CI_PIPELINE_SOURCE=push,CI_DEFAULT_BRANCH,CI_CONFIG_PATH, and the current branch. Other predefined variables, includingCI_COMMIT_TAG, are unset unless given with--variable. rules:changes,rules:existsandrules:variablesaren't evaluated. They warn, and a rule with onlychanges:counts as a match.only:changespasses andexcept:changesdoesn't exclude.- Jobs with an
image:use bash when the image has it andshotherwise, as GitLab does. Jobs with no image keep bash.
Not addressed
artifacts:still aren't passed between jobs.image: entrypointisn't applied. It warns.run_containertakes one string, so GitLab's list form needs its own change.when: delayedruns without waiting forstart_in. It warns.
Testing
- Unit tests cover
when, rule precedence, each operator,only/except,workflow:rules, and image and script fallback. crates/wrkflw/tests/gitlab_pipeline_test.rsdrives real pipelines through emulation: the stage-failure path,allow_failure,--variable,--jobandworkflow:rules.cargo test --workspace --all-featuresandclippy -D warningspass.
Problem
parallel was modelled only as a number, and even that was never used. A pipeline using the matrix form failed to parse, with a message that didn't name the job or key:
Validation failed: YAML parsing error: invalid type: map, expected usize
parallel: 3 parsed, but the job ran once.
Changes
- Model
parallelas a count or a matrix. - Convert both to a job matrix.
parallel:matrixexpands each entry's Cartesian product and exposes the variables as environment variables.parallel: Nruns N instances withCI_NODE_INDEXandCI_NODE_TOTAL. - Disable
fail-fastfor these jobs, since GitLab runs every instance.
Testing
- Unit tests for both forms, including multiple matrix entries.
cargo test --workspaceandclippy -D warningspass.- End to end under Podman: a pipeline with
parallel:matrixnow validates and runs, and each instance's script saw its variables.
Problem
actions/upload-artifact handled only a single glob, so common configurations failed or produced a different layout from GitHub:
path: | Before | After |
|---|---|---|
out/ or out (a directory) | step failed: "No files found" | uploads the directory's contents |
| Multi-line paths | treated as one glob, so no match | each line is searched |
!exclude lines | unsupported | exclude matching files, applied in order |
packages/*/dist, **/dist (a wildcard matching a directory) | selected nothing | select everything below the directory |
out/* or a single file, then download | kept the full out/... path | relative to the search root, as on GitHub |
| No matching files | always failed the step | if-no-files-found is honoured; defaults to warn |
| An existing artifact name | merged into the earlier upload | fails the step unless overwrite: true |
| Hidden files | always uploaded | skipped unless include-hidden-files: true |
The layout matters because jobs that download an artifact and read got/f.txt would otherwise find it at got/out/f.txt.
Changes
- Parse
path:line by line, with directory expansion and!exclusions. A later line can re-include a file. - A wildcard that matches a directory selects everything below it, as upload-artifact's implicit descendants do. This also applies to exclusions, so
!**/node_modulesexcludes the contents. - Compute the artifact root as upload-artifact documents: the part before the first wildcard, the directory given, the parent of a single file, or the common ancestor of several search paths.
- Support
if-no-files-found,include-hidden-filesandoverwrite, trimmed ascore.getInputdoes. - Stage each upload aside, then swap it into the index. A failed upload keeps the earlier artifact, and concurrent uploads of a name have exactly one winner.
- Follow symlinked directories, with cycle detection, unless they leave the workspace. Every path must resolve inside the workspace, and a
path:line outside it now fails the step.
Behaviour changes worth reviewing
All of these are in BREAKING_CHANGES.md.
- Artifact layout changes for patterns with a leading directory:
artifact-dir/*now downloads aspayload.txt, notartifact-dir/payload.txt. An existing test pinned the old path and is updated. out/*now includes files in subdirectories ofout, as on GitHub.- A step that found no files now passes with a warning unless
if-no-files-found: erroris set. A missing artifact shows up later, at download. - Hidden files are now skipped by default, so
path: .no longer uploads.git, andpath: .config/matches nothing. - Uploading to an existing name now fails. Matrix jobs sharing a name need their own names or
overwrite: true, and withoverwrite: truein parallel jobs, which job's files survive is not defined.
Testing
- Unit tests cover directories, wildcards matching directories, exclusions, hidden files, symlinks, duplicate names, concurrent uploads and failed copies.
cargo test --workspace --all-featuresandclippy -D warningspass.- The Podman end-to-end run predates the later commits and has not been repeated: upload
out/, download into another job and read nested files; an optional missing path warns;if-no-files-found: errorfails the step;actions/cacheround trip between jobs.
Problem
continue-on-error was only half supported:
- At job level it wasn't parsed at all. A failing job failed the whole run, blocked dependents, and triggered
fail-fast. - As an expression it was a parse error.
continue-on-error: ${{ matrix.experimental }}on a step passedwrkflw validate, thenwrkflw runrejected the whole workflow. - GitLab's
allow_failure: truewas parsed and ignored, so an allowed failure failed the pipeline.
Also, services: is parsed but never started (a known limitation in the README), and nothing said so at run time. Jobs just failed trying to reach a host that wasn't there.
Changes
continue-on-erroraccepts a boolean or expression, on steps and jobs. Job values are evaluated per matrix combination.JobResult::failure_allowedmarks a tolerated failure. Such a job still displays as failed, but doesn't fail the run, block dependents, or triggerfail-fast.- GitLab
allow_failure: truemaps to the same thing.allow_failure: { exit_codes: ... }is unchanged, so those jobs still fail, because wrkflw doesn't track which exit code failed the job. - Warn when a job declares
services:.
Please check
needs.<job>.result for an allowed failure now reads success. Dependents need the job treated as passed, and I believe this is what GitHub reports, but I couldn't find it documented and haven't confirmed it on GitHub. If GitHub reports failure, the value needs tracking separately from what gates dependents.
Testing
- Integration tests: allowed failure with a running dependent, per-combination expressions, no
fail-fast, step expressions. cargo test --workspaceandclippy -D warningspass.- End to end under Podman: a matrix with an expression at job and step level. Jobs showed as failed, the dependent ran, and the exit code was 0.
- The GitLab mapping and the
services:warning have no dedicated test.
Problem
Passing data through composite actions and reusable workflows failed in several ways, usually with an empty value or literal ${{ }} text reaching a step.
| Scenario | Before |
|---|---|
with: { who: ${{ env.WHO }} } on a composite action | the action got the literal ${{ env.WHO }} |
Nested composite, with: { value: ${{ inputs.who }} } | same |
with: { name: ${{ needs.pre.outputs.v }} } on a reusable workflow | same |
Reusable input default: | ignored, so inputs.x was empty |
Input with a hyphen, inputs.my-input | always empty: written to INPUT_MY-INPUT, read from INPUT_MY_INPUT |
Composite default: 3, env: { PORT: 5432 }, if: true | dropped, because only strings were read |
needs.call.outputs.result from on.workflow_call.outputs | empty unless an inner job output had the same name |
Changes
- Evaluate
with:in the caller's scope for composite actions and reusable workflows, plussecrets:values for reusable workflows. - Apply declared defaults for reusable inputs, and write hyphenated inputs under the name
inputs.*reads. - Keep non-string YAML scalars in composite steps.
- Evaluate
on.workflow_call.outputs. Workflows that don't declare outputs still get the previous flattening, so existing setups keep working.
Note
A called workflow that declares outputs now exposes only those, as on GitHub. Anything relying on an undeclared inner output leaking through will now read as empty.
Testing
- Unit tests for each row, and an integration test covering a dynamic input, defaults and a declared output across jobs.
cargo test --workspaceandclippy -D warningspass.- End to end under Podman: nested composite with hyphenated and numeric inputs, and a reusable workflow with
with:fromneeds, defaults and declared outputs.
Problem
include and exclude accept expressions since #137, but the most common dynamic-matrix form didn't work:
strategy:
matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}
wrkflw validate reported Matrix must be a mapping, and wrkflw run stopped with a parse error before running anything. An expression for a single axis, such as os: ${{ fromJSON(needs.setup.outputs.os) }}, parsed but was treated as one literal value, so the job ran once with the expression text as its value.
Changes
MatrixConfig::expressionholds a whole-matrix expression. It's set byStrategy's deserializer, so a plain mapping parses as before.resolve_expressionsevaluates the whole matrix first, then axes, theninclude/exclude.- A non-object matrix, a non-array axis, or a context unavailable in
strategyproduces a clear error. As withinclude/exclude, that fails the job and the rest of the run continues. validateaccepts the whole-matrix form and applies the same context check.
Testing
- Unit tests in
matrixandvalidators. cargo test --workspaceandclippy -D warningspass.- End to end under Podman: a matrix from a job output with
includeandexcludeexpanded to the expected 4 jobs and passed matrix values to steps, an axis expression expanded to 4 jobs, andneeds.*.outputsworked downstream.
Problem
Under Docker, Podman and Kubernetes, steps run in a Linux container with the workspace at /github/workspace, but the context described the host. On a Mac:
PWD=/github/workspace
GITHUB_WORKSPACE=/Users/me/repo # doesn't exist in the container
RUNNER_OS=macOS # inside a Linux container
So if: runner.os == 'Linux' silently skipped steps, and cd "$GITHUB_WORKSPACE" failed. On Linux hosts runner.os was right, but the paths were still wrong. GitLab's CI_PROJECT_DIR had the same problem.
Separately, working-directory was never evaluated, so ${{ github.workspace }}/src became a literal path segment.
Changes
apply_container_contextsetsGITHUB_WORKSPACE,RUNNER_OS,RUNNER_TEMP,RUNNER_TOOL_CACHEandCI_PROJECT_DIRfor container runtimes, for both GitHub and GitLab runs.working-directoryevaluates expressions. Paths under the workspace become relative, so the existing check that keeps steps inside the workspace still applies, including to${{ github.workspace }}/../escape.
Emulation is unchanged: it runs on the host, so host values are correct there.
Notes
RUNNER_ARCHstill comes from the host. It's right for native images, but not under emulated architectures.- Container runtimes always report
Linux, since that's what wrkflw runs, including forruns-on: macos-latest.
Testing
- Unit tests for the context override and for
working-directory, including the traversal case. cargo test --workspaceandclippy -D warningspass.- End to end under Podman on macOS, in a default job and a
container:job: assertedrunner.os,cd "$GITHUB_WORKSPACE",$RUNNER_TEMP, andworking-directory: ${{ github.workspace }}/src. - Not tested end to end on Docker (the local daemon was down) or Kubernetes. Both use the same code path.