lockfile: relocate to top-level avocado.lock#165
Open
mobileoverlord wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Promotes the project lockfile from the scratch .avocado/lock.json location to a top-level, tracked avocado.lock, including migration logic and bundle/import support so existing projects upgrade transparently.
Changes:
- Move the canonical lockfile path to
<src_dir>/avocado.lockand add legacy-path support + migration on load. - Include
avocado.lockinsavearchives and restore it duringload. - Update
initto gitignore the.avocado/scratch directory while keepingavocado.locktracked; update connect upload to prefer the new lockfile path with legacy fallback.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/lockfile.rs | Changes lockfile path, adds legacy path, and implements legacy → top-level migration/merge behavior. |
| src/commands/save.rs | Adds avocado.lock to the saved archive when present. |
| src/commands/load.rs | Restores avocado.lock from the archive when present. |
| src/commands/init.rs | Updates .gitignore behavior to ignore .avocado/ while keeping avocado.lock tracked. |
| src/commands/connect/upload.rs | Prefers avocado.lock for uploads, falling back to legacy .avocado/lock.json. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
96715aa to
5565083
Compare
Promote the lock file from `.avocado/lock.json` to a top-level, committed `avocado.lock` (like Cargo.lock / flake.lock). This frees `.avocado/` to be a purely-scratch, gitignored directory (which upcoming overlay-preprocessing staging relies on). `LockFile::load` migrates an existing `.avocado/lock.json` to the new path on first read (version-migrate, write to avocado.lock, remove the old file), so existing projects upgrade transparently. - get_path -> <src>/avocado.lock; add legacy_path() + path migration in load() - save merges legacy on disk before writing; write temp uses .lock.tmp - connect upload: resolve lock via get_path with legacy fallback - save/load: bundle and restore avocado.lock - init: gitignore the whole .avocado/ scratch dir; keep avocado.lock tracked
5565083 to
e03d3a2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Promotes the lock file from
.avocado/lock.jsonto a top-level, committedavocado.lock(likeCargo.lock/flake.lock). This frees.avocado/to bea purely-scratch, gitignored directory.
Details
LockFile::get_pathnow returns<src>/avocado.lock; a newlegacy_path()points at the old
.avocado/lock.json.LockFile::loadmigrates an existing legacy lock to the new path on firstread (version-migrate → write
avocado.lock→ remove the old file), soexisting projects upgrade transparently.
savemerges any legacy on-disk state before writing.get_pathwith a legacyfallback, and the save/load bundle now carries
avocado.lock.initgitignores the whole.avocado/scratch dir while keepingavocado.locktracked.Testing
cargo build,cargo test, andcargo clippyare green.