Handle quoted admin submit_job paths#4456
Conversation
|
/build |
Greptile SummaryThis PR fixes single-quoted path parsing in the admin console by generalising the Confidence Score: 5/5Safe to merge; the only remaining finding is a minor edge-case documentation/test gap that does not affect the primary fix. All P0/P1 concerns from prior review rounds are resolved. The one new observation (props silently dropped for single-quoted commands that also use the hash notation) is P2: the old double-quoted path had the same limitation, the combined scenario was already broken before this PR, and submit_job — the primary target — never uses props. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Input line] --> B{_has_quotes?}
B -- Yes --> C[_split_quoted_args]
B -- No --> D[# prop split]
C --> E{shlex.split succeeds?}
E -- Yes --> F[Return shlex tokens, props=None]
E -- No / ValueError --> G[_split_unquoted_args fallback, props=None]
D --> H[strip line, capture props]
H --> I[_split_unquoted_args]
I --> J[Return tokens + props]
Reviews (6): Last reviewed commit: "Merge branch 'main' into codex/fix-submi..." | Re-trigger Greptile |
chesterxgchen
left a comment
There was a problem hiding this comment.
This PR is not needed,
- the fix is already in PR #4449
- HCI command parsing already honors shell-style quoting when
the command contains ":- nvflare/fuel/hci/cmd_arg_utils.py:22
- split_to_args() uses shlex.split(line) if " is present
- The server registry uses that tokenizer directly:
- nvflare/fuel/hci/server/reg.py:67
- the malformat string should fallback, should fail
|
/build |
|
I re-checked this against current
That case still reproduces on today's So from the perspective of issue #1328, I don't think #4449 fully covers the problem yet. If the concern is specifically the malformed-input fallback behavior, I'm happy to adjust that part separately, but the single-quoted drag-and-drop case from #1328 still appears to be unfixed on |
|
/build |
|
/build |
|
/build |
Summary
submit_job#command-props behaviorWhy
Dragging a job folder into the admin console on Ubuntu can produce a single-quoted path. The current parser only switches to
shlex.split()when a command contains double quotes, so single-quoted paths are passed through literally andsubmit_jobrejects the resulting folder path.Root Cause
nvflare.fuel.hci.cmd_arg_utils.split_to_args()andparse_command_line()special-case double quotes instead of using shell-like tokenization generally. That leaves single quotes in the parsed argument, which then flows into the client-side file transfer path lookup.Impact
This change allows quoted drag-and-drop job paths to be submitted from the admin console without manually stripping surrounding quotes.
Fixes #1328.
Validation
pytest tests/unit_test/fuel/hci/cmd_arg_utils_test.py -q