← Back to issue list

parts: add project-specific global variables

View original Github issue

Metadata

Project
rockcraft
Number
#302
Type
pull request
State
merged
Author
tigarmo
Labels
Created
Updated
Closed

Current evaluation

Merged implementation adding project-specific global variables (name and version) via a prologue callback, following Snapcraft. Closes #299. Approved by two reviewers with passing CI. Refactors tests and modifies nine files.

Suggested action:

No scores available.

Issue body

The implementation follows Snapcraft's: a prologue callback is used to fill the project info with the project's name and version (the other 'useful' variables are already provided by craft_parts). This lets parts use those variables (for example during their builds). A lot of the unit test changes come from a refactoring to make adding new parameters to parts.PartsLifecycle less painful in the future. Closes #299 - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? -----

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged implementation adding project-specific global variables (name and version) via a prologue callback, following Snapcraft. Closes #299. Approved by two reviewers with passing CI. Refactors tests and modifies nine files.
qwen3.6-35b-a3b-mtp-q6 Merged. Implements project-specific global variables (name, version) for parts via a prologue callback, following Snapcraft's approach. Includes test refactoring for PartsLifecycle. Closes #299.
qwen3.6-35b-a3b-mtp-q6 Merged implementation adding project-specific global variables (name and version) to parts via a prologue callback, aligning with Snapcraft's approach. Includes refactored unit tests for PartsLifecycle. Closes #299.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#3748 parts: define variables and expand them in snapcraft.yaml snapcraft merged Merged after approval and passing CI. Adds global and step-specific SNAPCRAFT_* variables for snapcraft.yaml and lifecycle execution, extending CRAFT_* support. A reviewer requested a spread test rerun for 22.04.
74%
#773 parser - Handle project name and version variables snapcraft merged Merged. Replaces $SNAPCRAFT_PROJECT_VERSION and $SNAPCRAFT_PROJECT_NAME with values from the origin snapcraft.yaml in remote parts, addressing LP:#1619418. Changes span 4 files with 86 additions and 27 deletions.
72%
#2122 many: introduce variables for part src and build snapcraft merged Merged following approval. Introduces new environment variables and replacements for part src and build directories, resolving LP #1763028. Consolidates SNAPCRAFT_* environment handling into a single location. Approved by one reviewer with passing CI checks.
71%
#872 feat: support nested project variables craft-application merged Merged following three approvals and successful CI checks. The update enables nested project variables, altering 22 files (+526/-62 lines). It relies on craft-parts PR #1220 and addresses SNAPCRAFT-1054.
71%
#5727 docs: document custom project vars (SNAPCRAFT-1053) snapcraft merged Merged documentation update for custom project variables (SNAPCRAFT-1053). Moved from craft-parts, approved by two reviewers, and passed CI checks. Author addressed feedback by updating entity names prior to merge.
70%
#757 Export important project variables snapcraft merged Merged. Exports SNAPCRAFT_PROJECT_NAME, VERSION, STAGE, and PART_INSTALL variables. Reviewers approved and noted a planned expand_env refactor. CI retests and coverage fixes were applied before final merge.
70%