Skip to content

Conversation

@andrewnitu
Copy link
Contributor

@andrewnitu andrewnitu commented Dec 18, 2025

if you do lk agent create before doing uv sync (or the equivalent action in other languages), it will start deploying but fail the build partway through due to missing uv.lock. The agent will also be stuck in a bad state.

This PR adds a check to make sure the relevant lock file is there before attempting to deploy.

@andrewnitu andrewnitu changed the title add lock file validation [wip] add lock file validation Dec 18, 2025
Copy link
Member

@rektdeckard rektdeckard left a comment

Choose a reason for hiding this comment

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

Nice!

// ValidateLockFiles checks if the required lock files exist for the given project type.
// This ensures that dependency sync commands (e.g., uv sync, npm install) have been run
// before deployment, preventing build failures.
func ValidateLockFiles(dir fs.FS, projectType ProjectType) error {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this function definitely need to be double-checked. It's probably correct for uv projects but I'm not familiar with all the other kinds of project.

Copy link
Member

Choose a reason for hiding this comment

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

One thing we could do is allow this check to be bypassed when --skip-sdk-check is set, as we already do with similar project detection tasks in case somebody is using a non-standard package manager or something.

Copy link
Member

Choose a reason for hiding this comment

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

Otherwise it looks correct to me. You could add some tests similar to this: https://github.com/livekit/livekit-cli/blob/main/pkg/agentfs/sdk_version_check_test.go#L9

Copy link
Contributor

@yoonsio yoonsio left a comment

Choose a reason for hiding this comment

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

nice!

@andrewnitu
Copy link
Contributor Author

gonna close this for now. I realized the uv.lock requirement comes from the example dockerfile. Users could easily have a dockerfile that does not require the uv.lock (for example it just installs latest versions of dependencies), in which case it could be very confusing for it to be required.

@andrewnitu andrewnitu closed this Dec 19, 2025
@andrewnitu
Copy link
Contributor Author

ref AP-391

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants