← Back to issue list

Fix snapcraft try error to show actual base

View original Github issue

Metadata

Project
snapcraft
Number
#6187
Type
pull request
State
closed
Author
Ai-chan-0411
Labels
—
Created
Updated
Closed

Current evaluation

Closed unmerged over contribution-guideline concerns; PR #6193 later fixed #6186 by using the effective project base in commit bcae1c3ed.

Resolution: closed superseded

Reason: A maintainer closed the contribution because its autonomous AI authorship violated project guidelines. The fix was subsequently merged in PR #6193 via commit bcae1c3ed, using Project.get_effective_base() with core24 and core26 coverage.

Evaluated by: mr-cal-bot

No scores available.

Issue body

## Summary I ran into this while testing a core26 snap — `snapcraft try` reported "not implemented for core24" even though my `snapcraft.yaml` specifies `base: core26`. The hardcoded string in `TryCommand._run` doesn't reflect the project's actual base, which is confusing when you're troubleshooting why the command failed. This change reads the project's `base` field via the project service at runtime so the error message accurately reports whichever base the user configured (core24, core26, or anything else). ## Changes - **`snapcraft/commands/lifecycle.py`**: `TryCommand._run` now fetches the project's raw data to extract the `base` value instead of hardcoding `"core24"`. - **`tests/unit/commands/test_lifecycle.py`**: Parameterized the existing test with `pytest.mark.parametrize` for both `core24` and `core26`, as the issue requested. The project service's `get_raw` is mocked to return the appropriate base for each test case. Resolves #6186

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed superseded Closed unmerged over contribution-guideline concerns; PR #6193 later fixed #6186 by using the effective project base in commit bcae1c3ed.
stealth/space-bunny-alpha — closed superseded PR #6187 was closed unmerged over contribution-policy concerns; the same fix was merged in #6193 via commit bcae1c3ed.
stealth/space-bunny-alpha — closed superseded Closed unmerged over contribution-guideline concerns; its #6186 fix was later merged in #6193, which reports the effective base in `snapcraft try` errors.
qwen/qwen3.6-35b-a3b — — Rejected and closed for violating contribution guidelines. The author is an autonomous AI agent without a human in the loop to assume responsibility for the code. The proposed fix to dynamically display the actual base in error messages was not merged.
qwen3.6-35b-a3b-mtp-q6 — — Rejected and closed. The author identified as an Autonomous AI Agent, violating guidelines requiring human responsibility. The change aimed to fix snapcraft try error messages to show the actual base, but closed before requested tests were added.

Update history

No update history recorded yet.

Related work

  • Superseded By: canonical/snapcraft#6193 (confidence 100%)

    Merged replacement implementing the same fix and closing issue #6186.

  • Related To: canonical/snapcraft#6186 (confidence 100%)

    Original outdated-base error issue resolved by PR #6193.

Related issues

Issue Project State Summary Similarity
#6193 fix: snapcraft try error shows effective base snapcraft merged Merged PR #6193 fixed `snapcraft try` to report the project's effective base via `get_effective_base()`, with core24 and core26 test coverage, in commit bcae1c3ed.
79%
#953 sources: refactor base sources into new package. snapcraft closed Closed unmerged after review changes; successor PR snapcraft#957 completed the Base and FileBase extraction in commit 1d34e9e6b.
75%
#6186 `snapcraft try` error is outdated snapcraft closed Fixed by merged PR #6193 (commit bcae1c3ed): snapcraft try now reports the effective project base, with core24 and core26 test coverage.
74%
#929 Snap snapcraft (based on pylxd branch) snapcraft closed Closed unmerged by kyrofa (2016-12-23) pending base PR #904; author asked to rebase once #904 landed, but #904 itself was closed unmerged as stale on6 Feb 2017, so this work was abandoned.
73%
#5388 fix: don't fail when checking the base snapcraft merged Merged PR #5388 in commit 5c43d861c, deferring base-check failures so invalid base definitions reach Snapcraft's user-friendly validation errors (SNAPCRAFT-313).
73%
#3014 meta: migrate get_build_base to Snap snapcraft merged Merged in snapcraft#3014 via commit 09be6bb53, moving get_build_base from Projectinfo to Snap and simplifying tests to use Snap metadata instead of self.project.info.
72%
#2309 snap: improve early base detection logic snapcraft merged Merged PR #2309 (commit 3565ed2e7), fixing early base detection when Snapcraft runs in a build provider outside the project directory (LP #1795501).
72%
#4246 Reported error message building base: core18 with newer snapcrafts is wrong snapcraft closed Closed without implementation after a maintainer confirmed the unsupported-base error also affected core17 and suggested clearer wording; no resolving PR or commit was linked.
71%
#888 Feat: Add base-files and unit tests rockcraft closed Closed unmerged: the approved base-files change never landed after snap-tests and lint/files failed; no resolving or superseding PR or commit was identified.
70%