← Back to issue list

Refactor platform validation

View original Github issue

Metadata

Project
rockcraft
Number
#502
Type
issue
State
open
Author
mr-cal
Labels
Created
Updated
Closed

Current evaluation

Code debt: consolidate platform validation from BuildPlanner into Project model. BuildPlanner no longer exists in the codebase; platform validation is now in Project using craft_application's Platform model. Inactive for 381 days, no labels or maintainer engagement.

Suggested action: close stale

Reason: The issue targets consolidating platform validation from rockcraft.models.BuildPlanner into rockcraft.models.Project, but BuildPlanner no longer exists in the codebase (grep returns zero matches). The craft-platform refactoring (PR #715, commit 516d29e5) and subsequent 'use default build planner' commit (5f898b32) already consolidated platform handling into Project, which now uses craft_application.models.Platform with a single _validate_all_platforms field validator. The specific code structure the issue references is gone, making the task moot.

Impact: 15 Quick Win: 9.0 Staleness: 75 Complexity: 40 Confidence: 65 Support Request: 0

Issue body

### What needs to get done `platform` validation occurs in `rockcraft.models.BuildPlanner` and `rockcraft.models.Project`. This can be combined in `rockcraft.models.Project`. Scope of work: - [ ] move and rework validation code - [ ] adjust unit tests - [ ] adjust types in both models and satisfy the type checkers ### Source It feels that we handle this by defining a platform model separately and let pydantic do the heavylifting of hierarchically validating `platforms` as a list of platform models, isn't that possible? It would reduce the complexity of this validator. _Originally posted by @cmatsuoka in https://github.com/canonical/snapcraft/pull/4630#discussion_r1517943384_ ### Why it needs to get done Code debt

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 15
Quick Win: 9.0
Staleness: 75
Complexity: 40
Confidence: 65
Support Request: 0
close stale Code debt: consolidate platform validation from BuildPlanner into Project model. BuildPlanner no longer exists in the codebase; platform validation is now in Project using craft_application's Platform model. Inactive for 381 days, no labels or maintainer engagement.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 40
Confidence: 75
Support Request: 5
close stale Refactor platform validation logic in rockcraft models into a single location. Unassigned, unlabeled, and inactive for over a year due to internal code debt.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 40
Confidence: 75
Support Request: 5
needs triage Unlabelled refactoring issue proposing to consolidate platform validation logic into the Project model, update tests, and fix types. No maintainer assessment or recent activity in over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 40
Confidence: 75
Support Request: 0
close stale Refactor platform validation logic by consolidating it into the Project model, updating tests and types to reduce code debt. Currently inactive for over a year with no maintainer action or labels.
qwen3.6-35b-a3b-mtp-q6
Staleness: 88
Complexity: 45
Confidence: 80
Support Request: 5
close stale Consolidate platform validation from BuildPlanner into the Project model using a dedicated Pydantic model for hierarchical validation. Reduces code complexity and technical debt. Currently open and awaiting implementation.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: rockcraft#715 (confidence 70%)

    PR 'refactor: use craft-platform for the build plans' was merged and resolved issue #698, replacing the custom BuildPlanner with craft-platform's default build planner, effectively consolidating platform validation into Project.

Related issues

Issue Project State Summary Similarity
#4650 Refactor `platform` validation snapcraft closed Platform validation refactoring completed. The build planner was restructured with craft-application 5 and craft-platforms, rendering the original scope obsolete. Validation logic was consolidated and cleaned up.
84%