Skip to content
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

Update the lock file when necessary #110

Merged
merged 2 commits into from
Oct 30, 2023
Merged

Update the lock file when necessary #110

merged 2 commits into from
Oct 30, 2023

Conversation

rtimush
Copy link
Collaborator

@rtimush rtimush commented Oct 30, 2023

The PR is created as a draft, as it includes changes from #109.

Closes #83.

CLI changes

  • protofetch fetch: updates protofetch.lock if protofetch.toml has changed. Previous behavior: ignore protofetch.toml even if changed, fetch whatever protofetch.lock says.
  • protofetch fetch --locked: verifies that the lock file is up-to-date and fails otherwise
  • protofetch fetch --force-lock: deprecated, but still works for backwards compatibility.
  • protofetch update: recreates the lock file, like fetch --force-lock used to, but does not actually fetch the protos

It is possible to keep --force-lock, but I think it'd better to deprecate this flag:

  • it's poorly named, the name looks like it forces protofetch to use the lock file, but in fact it's the opposite
  • it combines two steps (recreating the lock file, and fetching the protos), which should be rarely needed. It should be more common to only want to recreate the lock file, and fetching the protos is usually a part of some build script.

API changes

fetch and lock now accept a LockMode enum.

Compatibility

  • older versions of protofetch seamlessly use the new lock files
  • the new versions of protofetch will have to update old lock files, fetch --locked will not succeed unless the updated lock file is available.

@rtimush rtimush requested a review from a team October 30, 2023 15:22
@rtimush rtimush marked this pull request as ready for review October 30, 2023 15:37
@rtimush rtimush merged commit 72bb0b6 into master Oct 30, 2023
12 checks passed
@rtimush rtimush deleted the locked-resolver branch October 30, 2023 16:29
@rtimush rtimush mentioned this pull request Nov 2, 2023
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.

Verify descriptor and lock file consistency
2 participants