← Back to issue list

Config service should check whether the program is running in the app's snap

View original Github issue

Metadata

Project
craft-application
Number
#816
Type
issue
State
open
Author
lengau
Labels
Created
Updated
Closed

Current evaluation

SnapConfigHandler uses snaphelpers.is_snap() instead of checking the app's specific snap name; the is_running_from_snap() utility exists but is unused here. Unaddressed for 410 days with no labels or maintainer response.

Suggested action: needs triage

Reason: The bug is confirmed in current code (line 106 still uses snaphelpers.is_snap()), and the is_running_from_snap() utility in util/snap_config.py already provides the correct app-specific check, but the issue has no labels, no maintainer comments, and no assignee after 410 days.

Impact: 35 Quick Win: 28.0 Staleness: 78 Complexity: 20 Confidence: 82 Support Request: 0

Issue body

### Bug Description https://github.com/canonical/craft-application/blob/86fcd4078907cf084367d38fceda1b8a52b97911/craft_application/services/config.py#L91-L97 Currently we just check if we're running in *a* snap, we should check if we're running in the app's snap. ### To Reproduce Set the `SNAP` environment variable ### part yaml ```shell ``` ### Relevant log output ```shell n/a ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 35
Quick Win: 28.0
Staleness: 78
Complexity: 20
Confidence: 82
Support Request: 0
needs triage SnapConfigHandler uses snaphelpers.is_snap() instead of checking the app's specific snap name; the is_running_from_snap() utility exists but is unused here. Unaddressed for 410 days with no labels or maintainer response.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 20
Confidence: 85
Support Request: 10
needs triage Config service incorrectly checks for any snap instead of the app's specific snap. Open for 369 days with no labels or maintainer response, awaiting triage.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 20
Confidence: 80
Support Request: 0
needs triage Config service incorrectly checks if running in any snap instead of the app's specific snap. Open with no labels or maintainer comments.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 30
Confidence: 60
Support Request: 5
needs triage Config service checks for any snap instead of the app's specific snap, causing incorrect behavior when the SNAP environment variable is set. Open for 334 days with no activity. Requires triage and code updates to validate the correct snap context.

Update history

No update history recorded yet.

Related work

  • Related To: craft-application#239 (confidence 75%)

    Added is_running_from_snap() in util/snap_config.py which performs the exact app-name check this issue requests, but SnapConfigHandler was never updated to use it.

Related issues

No related issues found above the similarity threshold.