Skip to content

A caller cannot give the shards env, or collect artifacts from them #59

Description

@sotashimozono

Two gaps, found together while migrating the largest suite in the fleet, which cannot adopt this workflow because of them.

1. No per-shard environment

A consumer's runtests.jl may read environment the workflow has to set. QAtlas.jl's does:

var value
QATLAS_TEST_PROFILE full on the default branch, fast on a pull request
QATLAS_EMIT 1 on the default branch
QATLAS_CIOUT_DIR pinned into the workspace, because Pkg.test sandboxes the suite

The reusable sets its own TESTSHARDS_* and nothing else. So the suite falls back to its default profile everywhere — including the branch that is supposed to run the full one.

That is the bad kind of failure: nothing goes red, the run just tests less than it did. A migration that does this silently is worse than one that breaks loudly.

2. No way to collect a caller's artifacts from the shards

The same suite emits evidence-*.jsonl verification cards from each shard and merges them, on the default branch, into a ci-evidence orphan branch — its own record of what has been verified, independent of coverage and of the test records this package already merges.

The reusable uploads <prefix>-coverage-*, <prefix>-out-* and its own report, and offers no hook for anything else. So a consumer with a per-shard side product has to keep a separate unsharded job to produce it, which is the cost the sharding was meant to remove.

Shape of a fix

  • env: — a caller-supplied block, merged into the shard job's environment. It has to be per-shard, not per-run, because the values can depend on matrix.sid.
  • collect-artifacts: — a glob the shard job uploads under the caller's prefix, plus the matching download in a caller-side job. upload-artifact's if-no-files-found: ignore makes the empty case free.

Both are additive and default to nothing.

Why it took until now

Twenty-odd repositories adopted this without needing either, because their test jobs set no environment and produced nothing but coverage. The one that needs both is the one with the most to lose from a quiet regression.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions