fix(cli): only treat delimited run/executor/plugins prefixes as overwrites - #605
Open
ManoharPaturi wants to merge 1 commit into
Open
fix(cli): only treat delimited run/executor/plugins prefixes as overwrites#605ManoharPaturi wants to merge 1 commit into
ManoharPaturi wants to merge 1 commit into
Conversation
…_prefixed_args
The prefix detection in _parse_prefixed_args used startswith(prefix),
so any task argument whose parameter name merely starts with a reserved
prefix was rejected with a misleading error, e.g.:
ValueError: Run overwrites must start with 'run.'. Got runtime=3600
Task parameters named runtime, run_id, executors, plugins_dir, etc.
crashed every CLI invocation. Prefixed args are now only matched when
directly followed by a delimiter ('=', '.', '['); keyword arguments for
task parameters are passed through untouched. Bare tokens starting with
the prefix still raise the original error.
Additionally, only the leading prefix occurrence is stripped (previously
run.a.run.b=1 was mangled to ab=1, silently targeting the wrong
parameter) and values containing '=' are no longer truncated
(executor=k=v previously yielded value 'k').
Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
ManoharPaturi
force-pushed
the
fix/cli-prefixed-args-word-boundary
branch
from
September 7, 2026 16:36
84d2763 to
c25b36c
Compare
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.
Fixes #604.
_parse_prefixed_argsmatched reserved prefixes with a barestartswith, so task parameters likeruntime=,run_id=,executors=,plugins_dir=were rejected with "Run overwrites must start with 'run.'" before the task parser ever saw them.Now an argument only belongs to the prefixed namespace when the prefix is directly followed by
=,.or[. Keyword args fall through to the task parser; a bare token starting with the prefix still raises (the existing test for that case still passes).Also fixed in the same function, found while testing:
str.replaceon every occurrence, sorun.a.run.b=1becamea.b=1(wrong parameter) — now only the first occurrence is stripped=were truncated at the first one (executor=k=v→k) — nowsplit("=", 1)Tests: 4 new (word boundary, nested key not corrupted, value with
=, end-to-endcli_executewith aruntimeparam). All fail on main, pass here. Rest oftest/cli/unchanged (only pre-existing py312 lazy-CLI failure).