Skip to content

fix(cli): stop uipath init on an unscaffolded Studio Web project - #1905

Merged
vldcmp-uipath merged 5 commits into
mainfrom
fix/init-unscaffolded-studio-web-project
Oct 1, 2026
Merged

vldcmp-uipath merged 5 commits into
mainfrom
fix/init-unscaffolded-studio-web-project

Conversation

@vldcmp-uipath

Copy link
Copy Markdown
Collaborator

Problem

Studio Web's cloud-workspace flow hands you a folder containing only project.uiproj. Running uipath init there wrote .env, uipath.json, bindings.json and entry-points.json, then crashed with an unhandled FileNotFoundError on the missing pyproject.toml. The project was left half-initialised, with empty functions/agents maps and no source file.

Fix

init now checks for that state before writing anything. When project.uiproj is the only visible entry in the directory, it exits with an actionable message instead:

❌ This project has not been scaffolded yet: 'project.uiproj' is the only file in this directory.
Scaffold it first by running:
`uipath new function`
  • The suggested name is read from project.uiproj → Name and normalized to a valid PEP 508 project name (lowercased, invalid runs collapsed to -). Falls back to uipath new <name> when no name is available.
  • Hidden entries (.uipath, .git, .env, ...) are ignored when deciding whether the directory is still the bare template.
  • The check is language-agnostic: it does not look for pyproject.toml, so the same template folder can still become a JS project.
  • No files are written on failure.

Tests

Added to tests/cli/test_init.py:

  • guard triggers with a name and leaves the directory untouched
  • placeholder fallback when Name is missing
  • hidden entries do not mask the template state
  • project.uiproj alongside real sources still initializes normally

Version

uipath 2.14.22 → 2.14.23

🤖 Generated with Claude Code

Copilot AI lite review requested due to automatic review settings September 17, 2026 14:49
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime test:uipath-integrations labels Sep 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Handle valid project.uiproj JSON whose root is not an object to avoid an unhandled exception.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates uipath init to detect unscaffolded Studio Web projects without writing files, adds regression tests, and bumps the version to 2.14.23.

Changes:

  • Detects bare project.uiproj directories and suggests uipath new.
  • Normalizes project names and ignores hidden entries.
  • Adds initialization guard tests.
  • Updates package and lockfile versions.
File summaries
File Summary
packages/uipath/uv.lock Synchronizes the locked package version.
packages/uipath/tests/cli/test_init.py Adds tests for the initialization guard.
packages/uipath/src/uipath/_cli/cli_init.py Adds scaffold detection and project-name normalization.
packages/uipath/pyproject.toml Updates the package version.
Review details
  • Files reviewed: 3/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/uipath/src/uipath/_cli/cli_init.py Outdated
@vldcmp-uipath
vldcmp-uipath force-pushed the fix/init-unscaffolded-studio-web-project branch from a7adc91 to 5952a24 Compare September 18, 2026 11:49
@vldcmp-uipath
vldcmp-uipath force-pushed the fix/init-unscaffolded-studio-web-project branch from 5952a24 to 051418f Compare October 1, 2026 07:18
Comment on lines +223 to +224
if not visible_entries <= {UIPROJ_FILE}:
return

@andreiancuta-uipath andreiancuta-uipath Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know sets have this operator and had too look it up. I find visible_entries.issubset({UIPROJ_FILE}) easier to understand, but it's still not immediately clear what we're checking.

I would make the cases explicit in the next if, since it checks for empty vs singleton set anyway:

if not visible_entries:
    reason = "this directory is empty."
elif visible_entries == {UIPROJ_FILE}:
    ...
else:
    return

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, i have changed it

vldcmp-uipath and others added 5 commits October 1, 2026 12:11
Studio Web's cloud-workspace flow creates a folder holding only
`project.uiproj`. Running `uipath init` there wrote `.env`, `uipath.json`,
`bindings.json` and `entry-points.json` before crashing on the missing
`pyproject.toml`, leaving the project half-initialised.

`init` now checks for that state before writing anything and exits with
an actionable message pointing at `uipath new <name>`, where the name is
taken from `project.uiproj` and normalized to a valid project name.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@vldcmp-uipath
vldcmp-uipath force-pushed the fix/init-unscaffolded-studio-web-project branch from b409647 to 7c4504e Compare October 1, 2026 09:11
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

🚨 Heads up: uipath-langchain cross-tests are FAILING 🚨

Your changes may break the uipath-langchain-python integration.

⚠️ These checks are NOT enforced by branch protection rules. Please review the failures before merging.

🔍 Inspect the failed run →

@sonarqubecloud

sonarqubecloud Bot commented Oct 1, 2026

Copy link
Copy Markdown

@vldcmp-uipath
vldcmp-uipath merged commit 4467f5d into main Oct 1, 2026
181 of 186 checks passed
@vldcmp-uipath
vldcmp-uipath deleted the fix/init-unscaffolded-studio-web-project branch October 1, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants