← Back to issue list

Remove `work_dir` argument from `ProviderService` methods

View original Github issue

Metadata

Project
craft-application
Number
#606
Type
issue
State
open
Author
mattculler
Labels
Created
Updated
Closed

Current evaluation

Refactor request to remove redundant work_dir arguments from ProviderService methods in favor of self._work_dir. Open since 593 days ago with only a bot ticket sync and a failed reproduction attempt; no labels or maintainer triage.

Suggested action: needs triage

Reason: The issue is a legitimate internal refactoring request filed by a maintainer (mattculler) but has no labels, no assignee, and no substantive maintainer response beyond a bot-created Jira ticket (CRAFT-3899) and a 'Could not reproduce' comment that merely failed to run the vi command. The code still shows the inconsistency: instance() and _get_instance_name() take work_dir parameters while clean_instances() uses self._work_dir, so the issue remains valid and needs proper triage.

Impact: 25 Quick Win: 13.75 Staleness: 75 Complexity: 45 Confidence: 80 Support Request: 5

Issue body

### Bug Description The `ProviderService` class's `__init__` takes a `work_dir` argument, stored as `self._work_dir`. Some `ProviderService` methods use this, but others take their own `work_dir` and use that instead. This situation is confusing at best, a source of potential bugs at worst. Ideally, all `work_dir` arguments to methods can be removed and replaced with `self._work_dir`. If some method(s) actually do need a different work dir, perhaps the argument should be named something different? Or if it truly should be called `work_dir` and methods need to take their own, comment(s) illuminating the situation should be added. This same situation doesn't exist on other `service` classes. ### To Reproduce `vi craft_application/services/provider.py`

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 25
Quick Win: 13.75
Staleness: 75
Complexity: 45
Confidence: 80
Support Request: 5
needs triage Refactor request to remove redundant work_dir arguments from ProviderService methods in favor of self._work_dir. Open since 593 days ago with only a bot ticket sync and a failed reproduction attempt; no labels or maintainer triage.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 15
Confidence: 90
Support Request: 0
close stale Inconsistency in ProviderService where some methods take a work_dir argument instead of using self._work_dir. Untriaged, inactive for over a year, with no maintainer follow-up.
qwen3.6-35b-a3b-mtp-q6
Staleness: 90
Complexity: 20
Confidence: 80
Support Request: 5
needs triage Inconsistency in ProviderService where some methods accept a work_dir argument while others use self._work_dir. Issue is open, unlabelled, and inactive for over a year with no maintainer resolution.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 15
Confidence: 85
Support Request: 0
close stale Inconsistent work_dir handling in ProviderService methods versus the constructor causes confusion and potential bugs. Suggests removing per-method arguments in favor of the instance variable. Open for 389 days, untriaged, and inactive.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#649 feat(ProviderService): deprecate work_dir on instance craft-application open Deprecates work_dir parameter on ProviderService.instance() in favor of self._work_dir. Approved but stale (451 days inactive) with failing CI (fast tests, lint, min deps). Related to open issue #606.
73%