Skip to content

fix(ci): pin plugins to lazy-lock.json on a fresh restore - #54

Closed
potsrevennil wants to merge 2 commits into
masterfrom
fix/ci-fresh-restore
Closed

potsrevennil wants to merge 2 commits into
masterfrom
fix/ci-fresh-restore

Conversation

@potsrevennil

@potsrevennil potsrevennil commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #49.

What

The test job's "Restore plugins" step now runs the same sequence lazy-update.yml (#53) uses:

nvim --headless +qa
cp lazy-lock.json ~/.local/state/nvim/lazy-lock.json
nvim --headless "+Lazy! restore" +qa
cmp lazy-lock.json ~/.local/state/nvim/lazy-lock.json

Why

When the actions/cache plugin cache misses, a bare Lazy! restore doesn't reproduce lazy-lock.json. lazy.nvim's first-run install handles LazyVim before the plugins its specs import are known. It rewrites the state lockfile without their entries and installs them at their upstream target. restore then restores to that rewritten lock. CI only looked reproducible because the cache was warm.

When the cache hits, every plugin is already on disk, so the first +qa installs nothing. Checked locally: the plugin dir was kept, the state dir was empty, no plugin HEAD moved, and cmp matched.

Evidence

Fresh XDG_*_HOME dirs, nix build .#lite, then diff lazy-lock.json ~/.local/state/nvim/lazy-lock.json.

master, bare restore (current CI): 5 plugins are off their locked commits.

4,5d3
<   "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
<   "catppuccin": { "branch": "main", "commit": "05e8787020dcfdb937bf2ff23855ea2415b4e072" },
14,15c12,13
<   "flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" },
<   "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
---
>   "flash.nvim": { "branch": "main", "commit": "5f0f270fdc7c5b0c21d903ee85b9cb06f2ac636a" },
>   "friendly-snippets": { "branch": "main", "commit": "b4d01b0fdf3c9a549961c2f9ffe8dc09be166219" },
25a24
>   "neo-tree.nvim": { "branch": "main", "commit": "4d55ed3482da32d1a68a9ed36dca5f4d69ec0ffb" },
31d29
<   "nvim-lint": { "branch": "master", "commit": "a219b2c9e5b4765e5c845aba119dad55806fcaf1" },
35,36c33,34
<   "nvim-treesitter-textobjects": { "branch": "main", "commit": "851e865342e5a4cb1ae23d31caf6e991e1c99f1e" },
<   "nvim-ts-autotag": { "branch": "main", "commit": "88c1453db4ba7dd24131086fe51fdf74e587d275" },
---
>   "nvim-treesitter-textobjects": { "branch": "main", "commit": "5c7b0263797dfd1bd6202f2b219f3b53a80b2187" },
>   "nvim-ts-autotag": { "branch": "main", "commit": "d7220b55e16ed3c04e88086256def5d282429493" },
43c41
<   "telescope.nvim": { "branch": "master", "commit": "427b576c16792edad01a92b89721d923c19ad60f" },
---
>   "telescope.nvim": { "branch": "master", "commit": "40aedd8a68c78a656a10a8d62d80c54af59420fb" },
45d42
<   "tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" },

master, this fix: every plugin is on its locked commit. What's left is master's stale lockfile, which restore prunes. This is why the PR is stacked on #49.

4,5d3
<   "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
<   "catppuccin": { "branch": "main", "commit": "05e8787020dcfdb937bf2ff23855ea2415b4e072" },
25a24
>   "neo-tree.nvim": { "branch": "main", "commit": "4d55ed3482da32d1a68a9ed36dca5f4d69ec0ffb" },
31d29
<   "nvim-lint": { "branch": "master", "commit": "a219b2c9e5b4765e5c845aba119dad55806fcaf1" },
45d42
<   "tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" },

On #49 with this fix: the diff is empty and cmp passes, on both a cold and a warm cache. A bare restore also happens to match here, because #49's lock currently equals upstream HEAD. It will drift again once upstream moves.

🤖 Generated with Claude Code

potsrevennil and others added 2 commits October 20, 2026 15:25
A bare `Lazy! restore` on a cache miss lets lazy.nvim's first-run
install rewrite the lockfile before LazyVim's imported specs are known,
leaving those plugins at their upstream target. Install first, copy the
committed lock back, restore, and cmp the result -- the same sequence
lazy-update.yml uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@potsrevennil
potsrevennil changed the base branch from master to chore/resync-lazy-lock October 20, 2026 07:29
Base automatically changed from chore/resync-lazy-lock to master October 20, 2026 07:55
@potsrevennil

Copy link
Copy Markdown
Owner Author

Folded into #53, which now carries this restore fix (moved into the shared .github/actions/setup-kapi-vim action).

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.

1 participant