← Back to issue list

Feature request: support dynamically setting top-level `version` during build

View original Github issue

Metadata

Project
rockcraft
Number
#1153
Type
issue
State
open
Author
srbouffard
Labels
Created
Updated
Closed

Current evaluation

Feature request to allow dynamically setting the top-level version field in rockcraft.yaml during build, enabling rock versions computed from workload version plus packaging increment. No maintainer response yet.

Suggested action: needs triage

Reason: The issue is a well-structured feature request with a clear use case (Mattermost packaging with rock revision), but has zero comments, no labels, and no maintainer acknowledgment after 164 days. The craftctl set version command already exists in the snap build hook (snap/snapcraft.yaml:171), suggesting the underlying mechanism may partially exist but needs verification for rockcraft.yaml top-level version support. This requires maintainer assessment of whether the feature is feasible within the current craft-application architecture.

Impact: 45 Quick Win: 27.0 Staleness: 55 Complexity: 40 Confidence: 60 Support Request: 10

Issue body

### Check existing issues - [x] I've verified that this request isn't described by any existing issues. ### Request ### **Feature Request** We would like a mechanism (for example via `craftctl set version`) to **dynamically update the top-level `version:` field** in `rockcraft.yaml` during the build. Currently, the top-level `version:` field is static, and there is no supported way to override it dynamically. Being able to set it during the build would allow the rock version to be computed from a combination of upstream workload version plus packaging increment (rock revision). ### The problem it solves ### **Problem / Use Case** Suppose we are packaging Mattermost 10.11.6 with a local packaging increment (rock revision 1). We define the version in a single external file or CI variable: ```bash # version.env WORKLOAD_VERSION=10.11.6 ROCK_REV=1 ROCK_VERSION="${WORKLOAD_VERSION}-${ROCK_REV}" ``` During the build, we dynamically set the top-level rock version and reference the workload version in all parts: ```bash # dynamically set top-level version craftctl set version=$ROCK_VERSION ``` ```yaml parts: backend: source: https://releases.mattermost.com/$WORKLOAD_VERSION/mattermost-$WORKLOAD_VERSION-linux-amd64.tar.gz webapp: source-tag: v$WORKLOAD_VERSION ``` Benefits: * The **workload version is defined once**, outside the rock * The **top-level version automatically includes the rock revision** * All parts reference the workload version consistently, avoiding duplication * Incrementing the rock revision produces a new rock version without changing upstream references

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 45
Quick Win: 27.0
Staleness: 55
Complexity: 40
Confidence: 60
Support Request: 10
needs triage Feature request to allow dynamically setting the top-level version field in rockcraft.yaml during build, enabling rock versions computed from workload version plus packaging increment. No maintainer response yet.
qwen/qwen3.6-35b-a3b
Staleness: 65
Complexity: 65
Confidence: 85
Support Request: 5
needs triage Feature request to dynamically set the top-level version in rockcraft.yaml during build via craftctl. Currently unlabelled and inactive for 123 days with no maintainer response.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 65
Confidence: 85
Support Request: 10
needs triage Feature request to dynamically set the top-level version field in rockcraft.yaml during build via craftctl. Currently unlabelled, inactive for 109 days with no maintainer response.
qwen3.6-35b-a3b-mtp-q6
Staleness: 70
Complexity: 50
Confidence: 90
Support Request: 10
needs triage Feature request to dynamically set the top-level version field in rockcraft.yaml during build via craftctl. Currently static. Untriaged with no maintainer response after 106 days.
qwen3.6-35b-a3b-mtp-q6
Staleness: 65
Complexity: 50
Confidence: 85
Support Request: 10
needs triage Feature request to dynamically set the top-level version in rockcraft.yaml during build, combining upstream workload versions with local rock revisions. Open 87 days, unassigned, zero comments.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.