Conversation
| // 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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
|
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. |
|
ref AP-391 |
if you do
lk agent createbefore doinguv 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.