Invalid shard "1-3", expected "<current>/<total>" like 1/3
Example threads. These questions and answers were written by the SDODS team to document real problems and how to fix them. The people named are illustrative, not real users. Questions asked on this site are marked new.
Our matrix generates the shard string and we used a dash because a slash was awkward to quote in the pipeline file.
Slash only, one form: <current>/<total>, both integers, 1/3 through 3/3. Whitespace around the slash is tolerated; nothing else is.
bash
sdods run -p demo-shop -e staging --shard 1/3
SDODS_SHARD takes the same string and goes through the same parser, so if the flag is awkward to quote, set the variable instead:
bash
SDODS_SHARD=1/3 sdods run -p demo-shop -e staging
Whichever way you pass it, a malformed value fails immediately with exit 2 rather than silently running everything on every shard — which is the failure you actually want, because the silent version looks like a passing build with triple the runtime.