tests: add reproducer for fetch-lib unhelpful error message (#2204)
Metadata
Current evaluation
Adds failing unit test reproducing #2204 (fetch-lib prints 'Library None not found in Charmhub') plus a fix using lib_data.full_name fallback. Pending review, 0 reviewers, CI passing.
Suggested action: needs review
Reason: PR was opened by maintainer lengau to reproduce and fix #2204 (still open), includes a Copilot-generated fix (commit 4a4d0d4) and a failing test, with CI passing. However, it has had zero reviewer activity for 128 days and needs a maintainer to review and merge.
Impact:
35
Quick Win:
22.75
Staleness:
50
Complexity:
35
Confidence:
75
Issue body
## Summary
Adds a failing unit test that reproduces #2204: `charmcraft fetch-lib` prints the unhelpful message `Library None not found in Charmhub.` when a library's `lib_id` is not registered in Charmhub.
## Bug
When fetching all libs (no argument), `parsed_args.library` is `None`. When the Charmhub bulk API returns no entry for a local/unpublished library's `lib_id`, the error uses `parsed_args.library` directly, producing `"Library None not found in Charmhub."` instead of a meaningful identifier.
## Reproducer
```
uv run python -m pytest tests/unit/commands/test_store.py::test_fetch_lib_command_unregistered_lib_id_error_message -v
```
The test fails with:
```
AssertionError: Bug reproduced: error message uses 'None' instead of library name:
'Library None not found in Charmhub.'
```
Closes #2204
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.8-27b |
Impact:
35
Quick Win:
22.75
Staleness:
50
Complexity:
35
Confidence:
75
|
needs review | Adds failing unit test reproducing #2204 (fetch-lib prints 'Library None not found in Charmhub') plus a fix using lib_data.full_name fallback. Pending review, 0 reviewers, CI passing. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
75
Complexity:
10
Confidence:
80
|
needs review | Adds a failing unit test reproducing an unhelpful error message when fetching unregistered libraries. Author requested AI to generate a fix, but PR remains unreviewed and inactive for 90 days. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
85
Complexity:
15
Confidence:
80
|
close stale | Adds a failing unit test reproducing an unhelpful error message in charmcraft fetch-lib. Inactive for 76 days with no maintainer review or CI success; author requested an AI fix that was not pushed to the PR. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
65
Complexity:
15
Confidence:
80
|
needs review | Adds a failing unit test reproducing an unhelpful error message when fetching unregistered libraries. Author requested an AI-generated fix, but the branch remains inactive for 73 days with no maintainer review or CI confirmation. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
25
Complexity:
10
Confidence:
85
|
needs review | Reproduces and fixes a bug where charmcraft fetch-lib prints Library None not found instead of the actual library name for unregistered lib_ids. The fix updates error messages to use the library full name. Unresolved type checking warnings remain. |
Update history
No update history recorded yet.
Related work
-
Caused By:
canonical/charmcraft#2204
(confidence 95%)
PR body explicitly states 'Closes #2204' and the added test reproduces the exact 'Library None not found in Charmhub' error described in that issue.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2505 fix: fetch-lib error message showing "Library None not found" | charmcraft | open | Fixes 'Library None not found' error in deprecated fetch-lib command by using lib_data.full_name. Approved but 2 unresolved review comments, many CI failures, 266 days inactive. Bug still present in main. | |
| #2665 tests: add reproducer for upload crash outside project directory (#2492) | charmcraft | open | Adds failing unit test reproducing #2492 (charmcraft upload RuntimeError outside project dir) plus a try/except fix in UploadCommand.run(). Pending review, 0 reviewers, 128 days inactive. Bug still present in main. |