tests: add reproducer for upload crash outside project directory (#2492)
Metadata
Current evaluation
Adds failing unit test reproducing upload crash outside project dir (#2492); Copilot added try/except fix. Stale branch, 163 days inactive, type-check failing.
Suggested action: close stale
Reason: 163 days inactive with zero reviewers and no author follow-up; the branch has diverged from main (large -311-line diff and ty errors in unrelated files like init.py:33 and lifecycle.py:119), so it needs a rebase before review. Bug #2492 remains open and should be addressed in a fresh PR.
Evaluated by: mr-cal-bot
Impact:
55
Quick Win:
11
Complexity:
45
Confidence:
55
Actionability:
35
Issue body
## Summary
Adds a failing unit test that reproduces #2492: `charmcraft upload` crashes with an internal `RuntimeError` when run from outside a charm project directory.
## Bug
`UploadCommand.run()` calls `self._services.get("project").get()` unconditionally at line 586 after a successful upload. When no `charmcraft.yaml` is present in the current directory, the project service raises `RuntimeError('Project not configured yet.')` — this propagates as an unhandled internal error instead of completing gracefully.
## Reproducer
```
uv run python -m pytest tests/unit/commands/test_store.py::test_upload_outside_project_dir_no_runtime_error -v
```
The test fails with:
```
RuntimeError: Project not configured yet.
```
Closes #2492
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| ~deepseek/deepseek-pro-latest |
Impact:
55
Quick Win:
11
Complexity:
45
Confidence:
55
Actionability:
35
|
close stale | Adds failing unit test reproducing upload crash outside project dir (#2492); Copilot added try/except fix. Stale branch, 163 days inactive, type-check failing. | |
| qwen/qwen3.6-35b-a3b |
Impact:
10
Quick Win:
2
Complexity:
5
Confidence:
85
Actionability:
20
|
close superseded | Adds a failing unit test reproducing issue #2492 where charmcraft upload crashes with RuntimeError outside a project directory. The bug has been fixed by PR #2497. | |
| qwen/qwen3.8-27b |
Impact:
45
Quick Win:
29
Staleness:
55
Complexity:
35
Confidence:
65
|
needs review | 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. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
75
Complexity:
15
Confidence:
80
|
needs review | Adds a failing unit test reproducing a RuntimeError in charmcraft upload when run outside a project directory. Currently pending maintainer review with no follow-up on the requested fix. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
70
Complexity:
20
Confidence:
65
|
needs review | Adds a failing unit test reproducing an upload crash outside a project directory. An AI-generated fix was committed to address the RuntimeError, but the PR lacks maintainer review and has been inactive for 76 days. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
55
Complexity:
10
Confidence:
75
|
needs review | Adds a unit test reproducing a RuntimeError crash during upload outside a project directory. A maintainer requested a fix via Copilot, which claims to have patched it, but the PR has been inactive for over two months without human verification. |
Update history
No update history recorded yet.
Related work
-
Related To:
charmcraft#2492
(confidence 95%)
The bug this PR reproduces and partially fixes; still open.
-
Related To:
charmcraft#2497
(confidence 85%)
Earlier fix attempt for the same bug, closed unmerged with CI failures.
-
Related To:
charmcraft#2667
(confidence 80%)
Similar reproducer-only PR, closed unmerged; its fix landed separately in #2681.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2666 tests: add reproducer for fetch-lib unhelpful error message (#2204) | charmcraft | open | Adds failing unit test reproducing #2204's 'Library None not found' error; Copilot comment claims fix in commit 4a4d0d4 but PR remains test-only and inactive 163 days. | |
| #2669 tests: add reproducer for pack retaining deleted files between builds (#710) | charmcraft | open | Reproducer test for #710 (pack retains deleted files) plus Copilot-generated PartsLifecycle._clean_stale_parts workaround; +112/-310, 4 files, open 163 days, 0 reviewers, snap-tests and title-policy checks failing. | |
| #2664 tests: add reproducer for reactive plugin missing .build.manifest (#872) | charmcraft | open | Adds failing unit test reproducing #872 and Copilot fix copying .build.manifest to install dir; 163 days old, 0 reviewers, pending review | |
| #2667 tests: add reproducer for remote-build ProjectService AttributeError (#2598) | charmcraft | closed | Closed unmerged; the reproducer was superseded by merged PR #2681 (dea7d9a0), which fixed the ProjectService lookup for remote builds and resolved #2598. |