-
Notifications
You must be signed in to change notification settings - Fork 127
[wip] add lock file validation #739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
rektdeckard
left a comment
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.
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 { |
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.
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.
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.
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.
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
yoonsio
left a comment
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.
nice!
|
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.