← Back to issue list

Add a pydantic validator for common-id

View original Github issue

Metadata

Project
snapcraft
Number
#5624
Type
issue
State
open
Author
mr-cal
Labels
Status: Triaged Type: Enhancement
Created
Updated
Closed
—

Current evaluation

Enhancement to add a pydantic validator for App.common_id enforcing the AppStream desktop-app ID format, so bad IDs fail before a build environment starts. Still open at HEAD; two implementation PRs (#5625 closed unmerged, #5974 stalled) have failed so far.

Suggested action: keep open

Reason: The gap is confirmed in the current tree: `App.common_id` (snapcraft/models/project.py:478) is a plain `str | None` with only description/examples, schema/snapcraft.json declares it as an unconstrained string, and there is no common_id validator among the existing App validators (_validate_autostart_name, _validate_apps_section_content, etc.). The issue is labeled 'Status: Triaged', authored by maintainer mr-cal, tracked as SNAPCRAFT-1181, and soumyaDghosh volunteered to implement it, so it is valid and should stay open. It is not resolved: no commit adds such a validator (git log for 'common-id' only shows the original #1960 support), PR #5625 was closed unmerged with failing CI and five unresolved review comments, and successor PR #5974 is open but dormant with three unresolved review comments and three failing CI checks — suggesting the remaining friction is backward-compatibility/design detail (strictness vs. tolerated `.desktop`-suffixed and legacy non-conforming ids), not scope.

Evaluated by: mr-cal-bot

Impact: 38 Quick Win: 15 Complexity: 45 Confidence: 80 Actionability: 72

Issue body

### What needs to get done Add a validator for the `common-id` field based on https://www.freedesktop.org/software/appstream/docs/sect-Metadata-Application.html#tag-id-desktopapp. ### Why it needs to get done To speed up development by raising an error early, before launching a build environment.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 38
Quick Win: 15
Complexity: 45
Confidence: 80
Actionability: 72
keep open Enhancement to add a pydantic validator for App.common_id enforcing the AppStream desktop-app ID format, so bad IDs fail before a build environment starts. Still open at HEAD; two implementation PRs (#5625 closed unmerged, #5974 stalled) have failed so far.
qwen/qwen3.6-35b-a3b
Impact: 30
Quick Win: 19
Complexity: 20
Confidence: 80
Actionability: 80
keep open Enhancement to add a pydantic validator for the common-id field based on the AppStream specification. The issue is triaged and a contributor has volunteered to implement the change.
qwen/qwen3.8-27b
Impact: 35
Quick Win: 24
Staleness: 60
Complexity: 30
Confidence: 70
Support Request: 5
keep open Enhancement to add a pydantic validator for the common-id field (per appstream spec) to catch invalid values early. Triaged; PR #5974 targets it but is stalled with failing CI, and the validator is absent from main.
qwen/qwen3.6-35b-a3b
Staleness: 35
Complexity: 40
Confidence: 85
Support Request: 0
keep open Enhancement to add a pydantic validator for the common-id field to catch errors early. Issue is triaged, assigned to a contributor, and currently under development.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 20
Confidence: 80
Support Request: 0
keep open Enhancement to add a pydantic validator for the common-id field based on freedesktop specs. Triaged and assigned, but inactive for nearly a year.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft#5974 (confidence 88%)

    Open PR 'feat(project): add pydantic validator for common_id field' directly implements this issue; stalled with 3 unresolved review comments and 3 failing CI checks.

  • Related To: snapcraft#5625 (confidence 88%)

    Earlier attempt at the same change, closed unmerged with failing CI and five unresolved review comments.

Related issues

Issue Project State Summary Similarity
#5974 feat(project): add pydantic validator for common_id field snapcraft open Adds a pydantic validator for App.common_id enforcing appstream desktop-ID format, with unit tests and docs. Successor to closed #5625 for issue #5624. Dormant 252 days, 3 unresolved review comments, 3 CI checks failing.
84%
#2542 meta: Validate common ID against appstream metadata snapcraft merged Merged PR #2542 added validation that fails when an app's common-id is absent from AppStream metadata, preventing common-ID typos.
71%