← Back to issue list

Raise an error for unfiltered build plans

View original Github issue

Metadata

Project
craft-application
Number
#719
Type
issue
State
open
Author
mr-cal
Labels
Created
Updated
Closed

Current evaluation

create_build_plan() has undefined behavior when platforms, build_for, and build_on are all None (dedupes to one build-on per platform). Requests raising an error. No labels or maintainer reply beyond a Jira bot; behavior still present in current code.

Suggested action: needs triage

Reason: The issue has no labels, no assignee, and its only comment is the auto-generated Jira-sync bot (CRAFT-4458) — no maintainer has categorised or prioritised it. I confirmed the behavior is still present in craft_application/services/buildplan.py (create_build_plan does not raise when all filters are None), and noted lifecycle.py deliberately calls it with all-None as a fallback, so the fix needs a design decision. It is a valid, still-reproducible report that needs triage.

Impact: 40 Quick Win: 20.0 Staleness: 75 Complexity: 50 Confidence: 78 Support Request: 5

Issue body

### Overview [`create_build_plan()`](https://github.com/canonical/craft-application/blob/5cf3d4071569e281cf06f07a119e45659d00d3fb/craft_application/services/buildplan.py#L119) has undefined behavior when no filters are provided. ### Example With the following platforms snippet: ```yaml platforms: riscv64: build-on: [riscv64, amd64] s390x: build-on: s390x ``` and a call to `create_build_plan(platforms=None, build_for=None, build_on=None)` will create the following plan: ```python [ BuildInfo( platform='s390x', build_on=DebianArchitecture('s390x'), build_for=DebianArchitecture('s390x'), build_base=DistroBase(distribution='ubuntu', series='24.04'), ), BuildInfo( platform='riscv64', build_on=DebianArchitecture('amd64'), build_for=DebianArchitecture('riscv64'), build_base=DistroBase( distribution='ubuntu', series='24.04'), ), ] ``` This build plan has a subtle problem - only the first of the two `build-on`s for the `riscv64` platform is added to the plan. ### Problem Passing `None` for all three parameters is undefined. This is because `create_build_plan()` is designed to generate an actionable build plan that will create no more than one build item per platform. It isn't made to generate an unfiltered build plan, but that's not obvious and therefore it's easy to misuse this function. ### Solution Craft-application should raise an error if `platforms`, `build-on`, and `build-for` are all `None`.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 40
Quick Win: 20.0
Staleness: 75
Complexity: 50
Confidence: 78
Support Request: 5
needs triage create_build_plan() has undefined behavior when platforms, build_for, and build_on are all None (dedupes to one build-on per platform). Requests raising an error. No labels or maintainer reply beyond a Jira bot; behavior still present in current code.
qwen/qwen3.6-35b-a3b
Staleness: 85
Complexity: 15
Confidence: 75
Support Request: 5
needs triage Undefined behavior in create_build_plan() when all filter parameters are None. Proposed fix is to raise an error. Issue remains unlabelled and unassessed after over a year of inactivity.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 15
Confidence: 80
Support Request: 5
needs triage Unfiltered create_build_plan() calls silently drop platforms instead of raising an error. Proposed fix: enforce required filters. Currently untriaged and inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 78
Complexity: 20
Confidence: 85
Support Request: 10
needs triage create_build_plan() silently drops targets when called without filters. Should raise an error if platforms, build_on, and build_for are all None. Open, awaiting implementation. Internal Jira ticket CRAFT-4458 created.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.