My migration pipeline kept passing its evidence checks, and one of those checks couldn't fail. A jq filter was missing two characters, so it tested the wrong thing and said yes every time.
The pipeline moves new NFL data into the live tables of Statpro, my sports stats site. After the database migration runs as a set of container tasks, evidence checks confirm that each task ran the exact reviewed image, with no command or environment changed.
all(.) versus all(.[])
The check is supposed to confirm that no task in a run carries overrides, which are settings that change a task's command or environment when it launches. In jq, all(generator; condition) runs the condition against each value the generator emits. I'd written . where I needed .[]:
# before: checks the wrapper, not the items
(.overrides.containerOverrides // []) | all(.;
(.name // "job") == "job" and (.command // []) == [] and (.environment // []) == []
)
# after: checks each override element
(.overrides.containerOverrides // []) | all(.[];
(.name // "job") == "job" and (.command // []) == [] and (.environment // []) == []
)
Without the brackets, jq evaluates the condition once on the array itself, which is truthy. Every task passed regardless of what its overrides contained.
The rest of the reproducibility push
This was the last fix in a five-commit push to make the NFL stat pipeline reproducible across the stages that move data into the live tables:
- Requests send explicit, frozen
Acceptheaders where they used to sendundefined. - Projections, the computed views of the data, are normalized before comparison, so phases match despite metadata timestamps.
- The stat contract, the agreed shape of the stat data, is versioned, with assertion-only checks that it exists.
- The migration stack kept creeping past the CloudFormation template size limit. I fixed it with
--path-metadata falseoncdk synthand added a hard byte-count guard.
A check earns trust by failing once
When an evidence check is wrong, a green build is worse than a red one, because green is when you stop looking. A check hasn't earned any trust until you've watched it reject something it should reject.