← Back to issue list

tests: add reproducer for remote-build ProjectService AttributeError (#2598)

View original Github issue

Metadata

Project
charmcraft
Number
#2667
Type
pull request
State
closed
Author
lengau
Labels
—
Created
Updated
Closed

Current evaluation

Closed unmerged; the reproducer was superseded by merged PR #2681 (dea7d9a0), which fixed the ProjectService lookup for remote builds and resolved #2598.

Resolution: closed superseded

Reason: PR #2667 added a reproducer but was closed without merging. PR #2681 delivered the actual fix in commit dea7d9a0 and resolved #2598.

Evaluated by: mr-cal-bot

No scores available.

Issue body

## Summary Adds a failing unit test that reproduces #2598: `charmcraft remote-build` crashes with `AttributeError: 'ProjectService' object has no attribute 'name'`. ## Bug In `charmcraft/application/commands/remote.py`, line 109: ```python project = cast(models.Charm, self._services.project) ``` `self._services.project` returns the `ProjectService` instance (via `ServiceFactory.__getattr__`), not the actual project model. The `cast` is a no-op at runtime, so calling `project.name` on a `ProjectService` raises `AttributeError`. The fix is to call `self._services.project.get()` instead. ## Reproducer ``` uv run python -m pytest 'tests/unit/commands/test_lifecycle.py::test_remote_build_project_name_attribute_error' -v ``` The test fails with: ``` AttributeError: 'ProjectService' object has no attribute 'name' ``` Closes #2598

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed superseded Closed unmerged; the reproducer was superseded by merged PR #2681 (dea7d9a0), which fixed the ProjectService lookup for remote builds and resolved #2598.
stealth/space-bunny-alpha — closed superseded The reproducer-only PR was closed unmerged; the remote-build fix landed in merged PR #2681 (dea7d9a0), resolving #2598 by retrieving the project model from ProjectService.
qwen/qwen3.6-35b-a3b — — A failing test reproducing a ProjectService AttributeError in remote-build was added. The bug was fixed in commit 5904d87 by calling .get() on the project service in remote.py and lifecycle.py to retrieve the actual model. The reproducer now passes.
qwen/qwen3.8-27b
Impact: 35
Quick Win: 28
Staleness: 75
Complexity: 20
Confidence: 82
close stale Adds failing unit test reproducing #2598 (remote-build AttributeError) plus fix in remote.py and lifecycle.py. Superseded: #2681 already fixed remote.py and added its own regression test. lifecycle.py fix still unmerged. Inactive 128 days.
qwen3.6-35b-a3b-mtp-q6
Staleness: 55
Complexity: 15
Confidence: 85
needs review Adds a reproducer test and a proposed fix for a ProjectService AttributeError in remote-build. Currently pending maintainer review with zero approvals and no recent human activity.
qwen3.6-35b-a3b-mtp-q6
Staleness: 70
Complexity: 10
Confidence: 85
needs review Adds a failing unit test reproducing a ProjectService AttributeError in remote-build. Inactive for 76 days, awaiting maintainer decision on merging the test or applying the fix.
qwen3.6-35b-a3b-mtp-q6
Staleness: 55
Complexity: 15
Confidence: 80
needs review Adds a reproducer and fix for a remote-build AttributeError where self._services.project returns a ProjectService instead of the model. The fix calls .get() in remote.py and lifecycle.py. Awaiting maintainer review after ~2.5 months of inactivity.

Update history

Date Change
closed

Related work

  • Superseded By: canonical/charmcraft#2681 (confidence 100%)

    Merged PR #2681 replaced the reproducer-only change with the production fix in commit dea7d9a0.

  • Related To: canonical/charmcraft#2598 (confidence 100%)

    The reproducer targeted the remote-build AttributeError reported in #2598.

Related issues

Issue Project State Summary Similarity
#2665 tests: add reproducer for upload crash outside project directory (#2492) charmcraft open Adds failing unit test reproducing upload crash outside project dir (#2492); Copilot added try/except fix. Stale branch, 163 days inactive, type-check failing.
70%