Repository navigation
fix(config): reject a non-list setup with a config error - #1740
Merged
Merged
Conversation
`setup:` was read as `raw.get("setup", []) or []`, so `setup: false`,
`setup: {}` or `setup: ''` silently became no steps, and a non-empty
mapping or string iterated its keys or characters and failed with the
misleading `setup[0] must be a mapping`. An absent, empty or `[]` setup
still means no steps; anything else that is not a list now raises
`setup must be a list of steps`.
Follow-up to #1738, whose review noted this gap.
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.
.config/tend.yamlnow fails withsetup must be a list of stepswhensetup:holds anything other than a list. Before,setup: false,setup: {}orsetup: ''silently loaded as no setup steps, and a non-empty mapping or string (setup: {run: make},setup: make) was iterated by key or character and failed with the misleadingsetup[0] must be a mapping with uses or run. An absent, empty (setup:) or[]setup still means no steps.This is the list-shaped counterpart of #1738, which closed the same
or {}hole forsecrets,workflowsandchecks; that PR's review notedsetup:and left it out. New cases intest_config_edge_cases.pycover all five rejected shapes plus the two accepted empty ones. The rejected cases fail on main, and the generator suite passes locally, apart from the two network-boundtest_refresh_consumers.pytests that can't resolve DNS in the sandbox.