← 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

The requested guard remains unimplemented: create_build_plan() still accepts three None filters and selects one build-on per platform; LifecycleService also depends on that fallback.

Suggested action: needs triage

Reason: The issue has no labels and its only comment is an automated Jira notification, so there is no evidence of maintainer triage. Current code and tests still permit all-None filters, but LifecycleService.setup() intentionally calls that form as a fallback, meaning the proposed blanket error requires resolving an internal caller and defining the intended fallback behavior first.

Evaluated by: mr-cal-bot

Impact: 42 Quick Win: 15 Complexity: 52 Confidence: 92 Actionability: 74

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
stealth/space-bunny-alpha
Impact: 42
Quick Win: 15
Complexity: 52
Confidence: 92
Actionability: 74
needs triage The requested guard remains unimplemented: create_build_plan() still accepts three None filters and selects one build-on per platform; LifecycleService also depends on that fallback.
qwen/qwen3.6-35b-a3b
Impact: 40
Quick Win: 29
Complexity: 10
Confidence: 75
Actionability: 80
needs triage Raise an error in create_build_plan() when platforms, build_on, and build_for are all None to prevent undefined behavior with unfiltered build plans.
qwen/qwen3.8-27b
Impact: 40
Quick Win: 20
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.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.