← Back to issue list

extensions: prepend and append functions for ENV

View original Github issue

Metadata

Project
snapcraft
Number
#3766
Type
pull request
State
merged
Author
sergio-costas
Labels
—
Created
Updated
Closed

Current evaluation

ENV prepend/append helpers were merged via snapcraft#3811 at commit c314fd967, avoiding stray separators when environment variables are empty.

Resolution: closed resolved

Reason: PR #3766 was merged and integrated through snapcraft#3811 via commit c314fd967. The change adds helpers that safely prepend or append paths to environment variables.

Evaluated by: mr-cal-bot

No scores available.

Issue body

This MR adds two functions that simplifies the management of environment variables, allowing to just pass the name of one variable and one or more paths, and they will return a piece of shell code that prepends or appends the paths to the variable, taking into account the case when the variable is empty, to avoid adding a trailing or leading colon. - [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] Have you successfully run `make lint`? - [x] Have you successfully run `pytest tests/unit`? -----

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved ENV prepend/append helpers were merged via snapcraft#3811 at commit c314fd967, avoiding stray separators when environment variables are empty.
stealth/space-bunny-alpha — closed resolved Merged in #3811 via c314fd967, adding ENV prepend/append helpers that manage path additions without stray leading or trailing colons.
qwen/qwen3.6-35b-a3b — — Merged into core22-gnome-extension. Added prepend and append functions for environment variables to safely manage path additions without trailing or leading colons. Approved by one reviewer, passed CI, and modified four files.
qwen3.6-35b-a3b-mtp-q6 — — Merged. Introduces prepend and append functions for environment variables in extensions, safely managing path additions without trailing or leading colons. Accepted despite a minor 0.01% coverage decrease.

Update history

No update history recorded yet.

Related work

Related issues

Issue Project State Summary Similarity
#3811 extensions: prepend and append functions for ENV snapcraft merged Merged PR #3811 in commit c314fd967, adding extension helpers to prepend or append paths to environment variables without introducing stray colons.
88%
#4925 add: extension env-injector snapcraft merged Merged PR #4925 added the experimental env-injector extension in commit af8bc1229, using canonical/snappy-env to inject snap-configured environment variables through command chains.
70%