fix: allow desktop files without an Exec key
Metadata
Current evaluation
⚠️ This summary may be outdated — the issue content or evaluation prompts have changed since this evaluation was made.
Fixes snapcraft rejecting valid desktop files missing an Exec key by making reformatting conditional. Updates tests. Currently awaiting maintainer review with passing CI and signed CLA.
Suggested action: needs review
Reason: The PR is a small, well-tested fix that resolves a valid desktop file handling issue. It has passed CI and meets contribution guidelines but has seen no maintainer engagement in 30 days. Review is needed to proceed.
Staleness:
45
Complexity:
15
Confidence:
85
Issue body
Fixes #5799
Desktop entries without an `Exec` key are valid when the application is D-Bus- or systemd-activated (often with `NoDisplay=true`), so the shell can still match an icon and metadata to a GUI that isn't launched directly. `desktop-file-validate` accepts such files, but snapcraft rejected them with `missing 'Exec' key`.
This makes the `Exec` reformatting conditional on the key being present instead of raising when it's absent, so the file is written through unchanged. The separate "missing Desktop Entry section" guard is untouched. The existing `test_missing_exec_entry` is converted from asserting rejection to asserting the file is written faithfully without an `Exec` line.
The issue suggested delegating validation to `desktop-file-validate` rather than encoding key requirements in snapcraft. I went with this minimal in-tree fix to keep it focused and avoid a new external dependency, but I'm happy to take the delegation approach if the team prefers it.
`ruff`, `ty`, and `make test-fast` (3628 passed, 0 failed) all pass. `make lint` fails locally only in its docs build (`TypeError: issubclass() arg 1 must be a class`, Sphinx on Python 3.14); I confirmed the same failure on a clean `upstream/main`, so it's pre-existing and unrelated to this change.
---
- [x] I've followed the [contribution guidelines](https://github.com/canonical/snapcraft/blob/main/CONTRIBUTING.md).
- [x] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/).
- [ ] I've successfully run `make lint && make test`. (Code linters and `make test-fast` pass; `make lint` docs build fails identically on clean `main`.)
- [ ] I've added or updated any relevant documentation. (n/a)
- [ ] In documents I changed, I added a meta description if one was missing. (n/a)
- [ ] I've updated the relevant release notes. (n/a)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b |
Staleness:
45
Complexity:
15
Confidence:
85
|
needs review | Fixes snapcraft rejecting valid desktop files missing an Exec key by making reformatting conditional. Updates tests. Currently awaiting maintainer review with passing CI and signed CLA. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
45
Complexity:
20
Confidence:
85
|
needs review | Makes Exec key reformatting conditional to accept valid desktop entries without Exec keys, fixing #5799. Updates tests. CI passes except pre-existing lint docs failure. Ready for maintainer review. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
5
Complexity:
15
Confidence:
85
|
needs review | Fixes snapcraft rejecting valid desktop files missing an Exec key by making reformatting conditional. Updates tests. CI passes. Awaiting maintainer review. |
Update history
| Date | Change |
|---|---|
| updated | |
| updated | |
| updated | |
| updated | |
| updated |
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2722 meta: fixes for desktop file handling | snapcraft | merged | Merged changes fixing desktop file handling for multiple sections and preserving Exec= arguments. Updates span two files (+101/-21 lines), approved by a reviewer with passing CI checks. |