fix(cli): reject project files clashing with generated package metadata - #1848
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens the uipath pack CLI in packages/uipath by detecting and rejecting projects whose files would be packaged at the same archive path as generated package metadata (avoiding duplicate zip entries that break extraction). It also adds CLI tests to validate the behavior and bumps the package version.
Changes:
- Add pre-archive conflict detection for generated metadata filenames and surface a targeted error message with a spec link.
- Refactor pack metadata writing into a single
metadata_filesmap and ensure conflict checks happen before opening the.nupkg. - Add pytest coverage for conflict detection (case-insensitive, multiple conflicts, subdirectory allowance, and exclusion behavior).
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/uipath/src/uipath/_cli/cli_pack.py | Adds metadata conflict detection before writing the archive and refactors metadata writes. |
| packages/uipath/tests/cli/test_pack.py | Adds regression tests for metadata filename conflicts and exclusion behavior. |
| packages/uipath/pyproject.toml | Bumps uipath version to 2.13.23. |
| packages/uipath/uv.lock | Updates the locked version for the editable uipath package. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5277fea to
a41e647
Compare
a41e647 to
4a96536
Compare
|
🚨 Heads up:
|



Summary
uipath packnow fails when a project file would be packaged at the same path as a metadata file the packer generates (operate.json,package-descriptor.json,bindings_v2.json), naming every offending file and linking the packOptions spec.nupkgbehindpackOptions.filesExcludedresolves the conflictWhy
the zip format allows two entries to share a name, so a leftover
operate.jsonat the project root was silently packaged alongside the generated one. orchestrator accepts such a package but the serverless executor fails at extraction withPackageDownloadError, which gives no hint about the actual cause.