GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(pyproject): track uv.lock relative to target workdir by nguyeda · Pull Request #9266 · updatecli/updatecli

Conversation

@nguyeda

@nguyeda nguyeda commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Current Behavior

The pyproject autodiscovery crawler generates a broken shell target for any pyproject.toml discovered in a subdirectory. The generated target sets:

  • workdir: <subdir> — the uv lock command runs here and succeeds, and
  • a changedif (file/checksum) tracking <subdir>/uv.lock.

Because the shell resource resolves changedif files relative to workdir, the path doubles (e.g. foo/bar/foo/bar/uv.lock). That path doesn't exist, so the post-command file check reports Missing files and the target fails — even though uv lock succeeded. Projects at the scan root are unaffected because workdir is ..

Fix

Record the lockfile path relative to the target's own workdir (just uv.lock) instead of joining workdir into it. The workdir is already emitted into the target, and the shell resource prepends it, so joining it twice was the bug. This also matches how sibling crawlers (golang, npm, cargo) reference their lock files as plain literals.

-	relLockFile := filepath.Join(workdir, "uv.lock")
-	...
-		LockFile:                   relLockFile,
+		LockFile:                   "uv.lock",

Tests

Added a regression scenario (Scenario 12) using a nested subdirectory project (testdata/subdir_project/foo/bar) to prove the fix holds at arbitrary depth. With the bug present this scenario fails (files: - "foo/bar/uv.lock"); with the fix it passes (files: - "uv.lock", workdir: 'foo/bar'). Existing scan-root scenarios are unchanged.

Verified end-to-end against a real subdirectory project: updatecli apply runs uv lock in the subdir and rewrites <subdir>/uv.lock correctly, with no <subdir>/<subdir>/ ever created.

Fixes #9265

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nguyeda @claude
fix(pyproject): track uv.lock relative to target workdir
b7ca1fd
The pyproject autodiscovery crawler generated a broken shell target for any
pyproject.toml discovered in a subdirectory. The target set both
`workdir: <subdir>` and a changedif file of `<subdir>/uv.lock`. Since the shell
resource resolves changedif files relative to workdir, the path doubled (e.g.
`foo/bar/foo/bar/uv.lock`), so the post-command file check reported
"Missing files" and the target failed even though `uv lock` succeeded. Projects
at the scan root were unaffected because workdir is `.`.

Record the lockfile path relative to the target's own workdir (`uv.lock`),
matching how sibling crawlers (golang, npm, cargo) reference their lock files.

Add a regression test with a nested subdirectory project (foo/bar) to cover
arbitrary depth; existing scan-root scenarios are unchanged.

Fixes updatecli#9265

Signed-off-by: David Nguyen <[email protected]>
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01BSdDmyipsijMHvW4myvcEW
loispostula
loispostula approved these changes Jun 25, 2026
View reviewed changes

@loispostula loispostula left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

thanks @nguyeda for your first contribution!

Lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mergify

mergify Bot commented Jun 25, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

olblak
olblak approved these changes Jun 26, 2026
View reviewed changes

@olblak olblak left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thank for the pullrequest

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@olblak
olblak merged commit e487e58 into updatecli:main Jun 26, 2026
8 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@olblak olblak added bug Something isn't working resource-pypi labels Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@loispostula loispostula loispostula approved these changes
@olblak olblak olblak approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

bug Something isn't working resource-pypi

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

pyproject autodiscovery: uv.lock path is doubled for projects in subdirectories, target fails with "Missing files"

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@nguyeda @loispostula @olblak
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.