Skip to content

[repo-assist] Improve error message when package missing from paket.lock - #4365

Merged
dsyme merged 1 commit into
masterfrom
repo-assist/fix-issue-3277-lockfile-error-message-71cd1fd35aa060c1
Aug 27, 2026
Merged

dsyme merged 1 commit into
masterfrom
repo-assist/fix-issue-3277-lockfile-error-message-71cd1fd35aa060c1

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant. Please review carefully before merging.

Closes #3277

Root cause

LockFile.CheckIfPackageExistsInAnyGroup returns an empty string when a referenced package cannot be found in any lock file group, so the resulting "Package X was referenced in ..., but it was not found in the paket.lock file in group Y." error gives the user no next step. This is exactly the confusing situation reported in #3277, where the reporter had manually edited paket.lock and was left unsure what command to run to fix it.

Fix

When the package genuinely isn't in any group, the helper now appends a short, actionable hint:

This usually means paket.lock is out of sync with paket.dependencies/paket.references. Try running 'paket install' or 'paket update' to regenerate paket.lock.

This is a minimal, surgical change — the existing "however it was found in group Y" branch is untouched.

Trade-offs

  • The new guidance is generic (install/update) rather than trying to detect the precise required command, since that would require broader analysis of the specific inconsistency; a generic pointer is safe and almost always correct.

Test Status

  • Added should give actionable error message when package is missing from lock file in any group in tests/Paket.Tests/Lockfile/QuerySpecs.fs.
  • dotnet build src/Paket.Core/Paket.Core.fsproj -f netstandard2.0 — succeeded, 0 errors.
  • dotnet test tests/Paket.Tests/Paket.Tests.fsproj -f net9 --filter "FullyQualifiedName~QuerySpecs" — 5/5 passed (4 pre-existing + 1 new).

Generated by 🌈 Repo Assist, see workflow run. Learn more.
Comment /repo-assist to run again

Add this agentic workflow to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@ae8d551f07c7ed7619f8c58c7bb4c3ac89395d38

Closes #3277

CheckIfPackageExistsInAnyGroup previously returned an empty string
when a referenced package was not found in any lock file group,
leaving the resulting error message with no actionable guidance.
Now suggests running 'paket install' or 'paket update' to
regenerate paket.lock, which is the common fix for this situation
(e.g. after manually editing paket.lock).

Co-authored-by: Copilot <[email protected]>
@dsyme
dsyme marked this pull request as ready for review August 26, 2026 22:15
@dsyme
dsyme merged commit 84e151b into master Aug 27, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unhelpful error message when packages are missing in paket.lock

1 participant