← Back to issue list

Projects with no parts are always repacked

View original Github issue

Metadata

Project
craft-application
Number
#844
Type
issue
State
open
Author
jonathan-conder
Labels
Status: Triaged Type: Bug
Created
Updated
Closed

Current evaluation

Bug: with always_repack=False, projects with no parts always repack because prime_state_timestamp is None. Triaged (Status: Triaged, Type: Bug), internal ticket CRAFT-4693 created. Current code (commit dc14f0e1, PR #1164 'fix: don't package projects with no parts') now skips packing entirely for no-parts projects, so the unnecessary repack no longer occurs.

Suggested action: keep open

Reason: The issue is triaged (Status: Triaged, Type: Bug) and a maintainer acknowledged it ('another weird repacking edge case') with an internal ticket CRAFT-4693. The current code at HEAD (commit dc14f0e1, PR #1164 'fix: don't package projects with no parts') now early-returns in _run_pack when there are no parts, emitting 'No packages created' instead of repacking — which resolves the core complaint, though the reporter expected 'Already packed'. Keeping open pending confirmation that #1164 is the intended resolution and the issue is closed accordingly.

Impact: 40 Quick Win: 24.0 Staleness: 45 Complexity: 40 Confidence: 70 Support Request: 5

Issue body

### Bug Description In an application with `always_repack=False`, at least one part is needed to ensure `prime_state_timestamp` is not `None`: https://github.com/canonical/craft-application/blob/109efee05914b24832763335c1d7064af4ed21f5/craft_application/commands/lifecycle.py#L470-L475 ### To Reproduce ```bash cat <<'EOF' >testcraft.yaml name: temp version: "0.1" base: ubuntu@24.04 platforms: amd64: EOF testcraft pack testcraft pack cat <<'EOF' >testcraft.yaml name: temp version: "0.1" base: ubuntu@24.04 platforms: amd64: parts: foo: plugin: nil EOF testcraft pack testcraft pack ``` Expected behaviour: the second and fourth `testcraft pack` calls should print `Already packed: temp-0.1-amd64.testcraft`. Actual behaviour: only the fourth one does. ### part yaml ```shell {} ``` ### Relevant log output ```shell :: 2025-08-06 12:49:51.687 Could not find prime state timestamps. ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 40
Quick Win: 24.0
Staleness: 45
Complexity: 40
Confidence: 70
Support Request: 5
keep open Bug: with always_repack=False, projects with no parts always repack because prime_state_timestamp is None. Triaged (Status: Triaged, Type: Bug), internal ticket CRAFT-4693 created. Current code (commit dc14f0e1, PR #1164 'fix: don't package projects with no parts') now skips packing entirely for no-parts projects, so the unnecessary repack no longer occurs.
qwen/qwen3.6-35b-a3b
Staleness: 75
Complexity: 45
Confidence: 85
Support Request: 5
keep open Bug where always_repack=False causes projects without parts to always be repacked due to missing prime_state_timestamp. Triaged, acknowledged by maintainers, and tracked internally.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 35
Confidence: 80
Support Request: 5
keep open Bug where projects with no parts always repack despite always_repack=False due to missing prime_state_timestamp. Triaged, acknowledged, awaiting fix.
qwen3.6-35b-a3b-mtp-q6
Staleness: 70
Complexity: 30
Confidence: 85
Support Request: 10
keep open Projects with no parts always repack despite always_repack=False because prime_state_timestamp remains None. The bug is triaged, acknowledged, and tracked internally as CRAFT-4693. Awaiting development.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: craft-application#1164 (confidence 75%)

    Commit dc14f0e1 'fix: don't package projects with no parts (#1164)' adds an early return in _run_pack for no-parts projects, eliminating the always-repack behavior described in the issue.

Related issues

No related issues found above the similarity threshold.