fix(cli): validate node name in dora new --kind node - #2849
Merged
trunk-io[bot] merged 1 commit intoJul 28, 2026
Conversation
`create_dataflow` rejects names containing `/` or non-ASCII characters, but
the `--kind node` path (`create_custom_node`) had no such guard. It built
directories straight from the raw name via the non-recursive
`fs::create_dir`, so `dora new --lang python --kind node a/b` failed with a
confusing "failed to create root directory" (or silently created a nested
path the user did not intend), and non-ASCII names were unvalidated.
Apply the same `contains('/')` / `is_ascii()` checks used by
`create_dataflow`, with clear error messages. Spaces remain allowed — they
are normalized to `-`/`_` — so the internal `create_dataflow` callers
(`"talker 1"`, `"listener 1"`, ...) are unaffected.
Validation: `cargo build -p dora-cli`, `cargo clippy`, and `cargo fmt
--check` pass; `create_dataflow`'s template generation still succeeds
(its custom-node calls use space-separated ASCII names).
This change was generated by Claude (Claude Code), an AI assistant. It is
machine-generated and should be reviewed carefully before merging.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D2eu6P1CvTvoKdK9fK3ZSd
Contributor
|
😎 Merged successfully - details. |
Collaborator
Author
No issues found. The One optional, non-blocking note: like Generated by Claude Code |
phil-opp
marked this pull request as ready for review
July 28, 2026 10:43
trunk-io
Bot
deleted the
claude/dreamy-bardeen-90d0pc-new-node-name-validation
branch
July 28, 2026 12:02
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.
Issue
create_dataflowrejects names containing/or non-ASCII characters, but the--kind nodepath (create_custom_node) had no such guard. It built directories straight from the raw name via the non-recursivefs::create_dir, so:failed with a confusing "failed to create root directory" (or, if
aalready existed, silently created a nested path the user didn't intend). Non-ASCII names were likewise unvalidated.Fix
Apply the same
contains('/')/is_ascii()checks thatcreate_dataflowalready uses, with clear error messages. Spaces remain allowed — they're normalized to-/_— so the internalcreate_dataflowcallers ("talker 1","listener 1", …) are unaffected.Validation
cargo build -p dora-cli,cargo clippy ... -D warnings, andcargo fmt --all --checkpass.dora new --kind dataflowtemplate path still generates its custom nodes (its calls use space-separated ASCII names, which pass validation).🤖 Generated with Claude Code
https://claude.ai/code/session_01D2eu6P1CvTvoKdK9fK3ZSd
Generated by Claude Code