← Back to issue list

snapcraft has more strict linting unexpectedly

View original Github issue

Metadata

Project
snapcraft
Number
#5017
Type
issue
State
closed
Author
dilyn-corner
Labels
—
Created
Updated
Closed

Current evaluation

Stricter linting after the Pydantic 2 migration rejected unquoted ints like apps.*.environment.foo: 1. Fixed by merged PR #5051 (commit 0e2cfbf56) bumping craft-grammar to 2.0.1 and craft-store to 3.0.1.

Resolution: closed resolved

Reason: Maintainer mr-cal closed the issue after merging PR #5051 (commit 0e2cfbf56, "build(deps): bump craft-grammar to 2.0.1"), which pulled in the craft-grammar 2.0.1 release restoring numeric-to-string coercion and shipped in snapcraft 8.4.1.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description When building a snap using at least revision 12523 to build snaps which built successfully with revisions like 12503 (latest/edge versus 8.x/edge), snapcraft will now emit some error messages. ### To Reproduce Install snapcraft from latest/edge, build the snap with `snapcraft`. ### Environment Ubuntu 23.10, building with `snapcraft --use-lxd`. ### snapcraft.yaml ```yaml name: my-snap-name # you probably want to 'snapcraft register <name>' base: core24 # the base snap is the execution environment for this snap version: '0.1' # just for humans, typically '1.2+git' or '1.3.2' summary: Single-line elevator pitch for your amazing snap # 79 char long summary description: | This is my-snap's description. You have a paragraph or two to tell the most important story about your snap. Keep it under 100 words though, we live in tweetspace and your description wants to look good in the snap store. grade: devel # must be 'stable' to release into candidate/stable channels confinement: devmode # use 'strict' once you have the right plugs and slots parts: my-part: # See 'snapcraft plugins' plugin: nil apps: my-app: command: bash environment: foo: 1 ``` ### Relevant log output ```shell dilyn@Ares:~/test -> snapcraft Starting snapcraft, version 8.3.2.post71+git3508cf39 Logging execution to '/home/dilyn/.local/state/snapcraft/log/snapcraft-20240905-191836.634265.log' Bad snapcraft.yaml content: - input should be a valid string (in field 'apps.my-app.environment.foo') ``` ### Additional context Quoting `1` results in successful builds (sans an error message unrelated to this issue).

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Stricter linting after the Pydantic 2 migration rejected unquoted ints like apps.*.environment.foo: 1. Fixed by merged PR #5051 (commit 0e2cfbf56) bumping craft-grammar to 2.0.1 and craft-store to 3.0.1.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #5051 (commit 0e2cfbf56): craft-grammar 2.0.1 restored numeric-to-string coercion after the Pydantic 2 migration.
qwen/qwen3.6-35b-a3b — — Fixed via PR #5051. Unexpected linting errors from pydantic 2 migration in snapcraft 8.x were resolved by merging upstream patches in craft-parts, craft-application, and craft-grammar.
qwen/qwen3.6-35b-a3b — — Fixed via PR #5051. Unexpected validation errors in snapcraft 8.x caused by pydantic 2 migration were resolved by integrating upstream fixes from craft-parts, craft-application, and craft-grammar, with regression tests added.
qwen/qwen3.6-35b-a3b — — Fixed via PR 5051 after upstream updates to craft-parts, craft-application, and craft-grammar. A Pydantic 2 migration caused unexpected strict linting errors for valid snapcraft.yaml environment variables.
qwen/qwen3.6-35b-a3b — — Fixed unexpected strict linting in snapcraft v8.x triggered by a pydantic 2 migration. Resolved via PR #5051 by integrating upstream updates to craft-parts, craft-application, and craft-grammar, restoring correct YAML environment value validation.
qwen3.6-35b-a3b-mtp-q6 — — Fixed via PR #5051. Unexpected validation errors in snapcraft 8.x, caused by a pydantic 2 migration, were resolved by integrating upstream fixes from craft-parts, craft-application, and craft-grammar.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/snapcraft#5051 (confidence 98%)

    Merged dependency bump PR (commit 0e2cfbf56) that fixed the regression; same PR also closed #4978.

  • Duplicate Of: canonical/snapcraft#4978 (confidence 92%)

    Reporter and lengau agreed both stem from the craft-grammar/Pydantic 2 coercion change; 4978 was also closed by #5051.

  • Blocked By: canonical/craft-grammar#49 (confidence 80%)

    Upstream bug requiring the craft-grammar 2.0.1 fix before snapcraft could resolve this.

  • Related To: canonical/craft-parts#816 (confidence 70%)

    Partial upstream fix shipped in snapcraft 8.4.0 for related coercion issues.

  • Related To: canonical/craft-application#450 (confidence 65%)

    craft-application fix noted as needed for 8.4.1 alongside the grammar bump.

Related issues

No related issues found above the similarity threshold.