Repository navigation
fix(cli): refuse to overwrite an existing project in uipath new - #2042
Draft
rge-uipath wants to merge 2 commits into
Draft
rge-uipath wants to merge 2 commits into
rge-uipath wants to merge 2 commits into
Conversation
Running `uipath new <name>` for a function project in a folder that already had main.py, pyproject.toml or uipath.json silently replaced them. Exit 1 naming the existing files instead. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
This branch has not been deployed
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.



uipath new <name>(function projects) silently replaced an existing main.py, pyproject.toml and uipath.json. Now, if any exists in the target directory, nothing is written and it exits 1 viaconsole.error, naming the existing files: "Runuipath newin an empty folder, or pass --force to overwrite." Agent-framework scaffolds are guarded separately (companion: UiPath/uipath-langchain-python#1268).New
--forceflag keeps the old in-place overwrite for function projects. It is not forwarded to agent-frameworknewmiddlewares: they take onlyname, are called directly byuipath new, and live in other packages, so forwarding would be a cross-package signature change.Tests:
test_new_project_with_existing_files(previously asserted the overwrite) now asserts the refusal and untouched file; newtest_new_project_with_existing_files_force_overwritesasserts--forceexits 0 and overwrites. Patch version bumped (2.15.16).Verified from packages/uipath:
uv run pytest tests/cli/test_new.py tests/cli/test_job_token.py tests/cli/eval/test_eval_util.py --no-cov,uv run ruff check,uv run ruff format,uv run mypy src/uipath/_cli/cli_new.py.🤖 Generated with Claude Code