Skip to content

osutil: add support for shell conditional syntax in envs - #15446

Merged
bboozzoo merged 6 commits into
canonical:masterfrom
sergio-costas:allow-conditional-environment-variables
Jun 11, 2026
Merged

osutil: add support for shell conditional syntax in envs#15446
bboozzoo merged 6 commits into
canonical:masterfrom
sergio-costas:allow-conditional-environment-variables

Conversation

@sergio-costas

@sergio-costas sergio-costas commented May 14, 2025

Copy link
Copy Markdown
Contributor

Bash has support for some conditionals that allow to append text
to environment variables in a more clever way than just blindly
appending it. This is a must, for example, when appending paths
to PATH or LD_LIBRARY_PATH, because if the original variables
are empty, the new paths must be added "as-is", but if the
original variables have a value, a colon is required between
the old value and the new one.

So, this patch allows to append extra paths to the current defined
ones directly in the 'environment' section of the snapcraft.yaml
file.

The new supported syntaxes are:

${VARIABLE:-XXXXXX}

if VARIABLE is defined, this will return the value of that
variable; but if it is undefined, it will return the expansion
of XXXXX (thus, if there are variables there, they will be
recursively expanded).

${VARIABLE:+YYYYY}

if VARIABLE is undefined, it will return an empty string;
but if it is defined, it will return the expansion of YYYYY.

Examples:

${PATH:+$PATH:}/usr/local/bin

If PATH is undefined or empty, it will return an empty string,
to with '/usr/local/bin' will be appended.
But if PATH contains, for example, /usr/bin:/bin, it will
return that plus a colon at the end, to which '/usr/local/bin'
will be appended, thus resulting in the expected value

/usr/bin:/bin:/usr/local/bin

/usr/local/bin${PATH:+:$PATH}

If PATH is undefined or empty, it will return an empty string,
which will be appended after '/usr/local/bin', thus resulting in only that path.
But if PATH contains, for example, /usr/bin:/bin, it will
return a colon plus that at the end, which will be appended after '/usr/local/bin', thus resulting in the expected value

/usr/local/bin:/usr/bin:/bin

Thanks for helping us make a better snapd!
Have you signed the license agreement and read the contribution guide?

@github-actions

github-actions Bot commented May 14, 2025

Copy link
Copy Markdown

Wed Jun 10 00:48:40 UTC 2026
The following results are from: https://github.com/canonical/snapd/actions/runs/27008267199

Failures:

Preparing:

  • garden:ubuntu-core-18-64:tests/core/
  • google-pro:ubuntu-fips-24.04-64:
  • google-pro:ubuntu-fips-22.04-64:
  • google-pro:ubuntu-fips-24.04-64:
  • google-pro:ubuntu-fips-22.04-64:

Executing:

  • openstack:opensuse-16.0-64:tests/main/security-logging
  • openstack:opensuse-tumbleweed-64:tests/main/security-logging
  • openstack:opensuse-tumbleweed-selinux-64:tests/main/security-logging
  • openstack:ubuntu-16.04-64:tests/unit/go:gcc
  • openstack:ubuntu-16.04-64:tests/unit/go:clang

Restoring:

  • garden:ubuntu-core-18-64:tests/core/
  • garden:ubuntu-core-18-64:

Skipped tests from snapd-testing-skip

If you wish to have any of the below tests run in your PR, in your PR description, add 'unskip:' followed by a copy-and-pasted list (without variants) of the below tests you wish to run (unskip plus test list must be valid yaml)

  • garden:ubuntu-25.10-64:tests/main/apparmor-prompting-support
  • openstack-arm:ubuntu-24.04-arm-64:tests/main/i18n
  • openstack-arm:ubuntu-core-24-arm-64:tests/main/i18n
  • openstack:debian-sid-64:tests/main/interfaces-network-status-classic
  • openstack:ubuntu-24.04-64:tests/main/i18n
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-flag-restart
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:audio_record_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:audio_record_timespan_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:audio_record_timespan_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_fd_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_path_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_write_write_same_path_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_conflict
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_defaults
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_safer
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:read_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:read_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:special_characters
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:timespan_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:timespan_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_allow_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_deny_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-prompt-restoration
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-snapd-startup
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-support
  • openstack:ubuntu-25.10-64:tests/main/interfaces-requests-activates-handlers
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-flag-restart
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:audio_record_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:audio_record_timespan_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:audio_record_timespan_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_fd_single_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_path_single_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_write_write_same_path_single_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:download_file_conflict
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:download_file_defaults
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:download_file_safer
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:read_single_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:read_single_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:special_characters
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:timespan_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:timespan_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_allow_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_deny_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:write_single_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:write_single_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-prompt-restoration
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_allow_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_allow_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_allow_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_allow_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_deny_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_deny_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_deny_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_deny_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_allow_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_allow_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_allow_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_allow_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_deny_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_deny_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_deny_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_deny_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-snapd-startup
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-support
  • openstack:ubuntu-26.04-64:tests/main/i18n
  • openstack:ubuntu-26.04-64:tests/main/interfaces-requests-activates-handlers

@codecov

codecov Bot commented May 14, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.10%. Comparing base (e8dc9de) to head (b929b7d).

Files with missing lines Patch % Lines
osutil/env.go 92.30% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #15446    +/-   ##
========================================
  Coverage   79.10%   79.10%            
========================================
  Files        1384     1384            
  Lines      192855   192991   +136     
  Branches     2466     2466            
========================================
+ Hits       152549   152672   +123     
+ Misses      31138    31134     -4     
- Partials     9168     9185    +17     
Flag Coverage Δ
unittests 79.10% <92.30%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sergio-costas
sergio-costas force-pushed the allow-conditional-environment-variables branch 2 times, most recently from 996085c to b906b45 Compare May 20, 2025 09:31
@bboozzoo
bboozzoo requested a review from zyga May 26, 2025 08:55
Comment thread osutil/env_test.go Outdated
Comment thread osutil/env.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs an update to the docs on the forum, does it work with snapcraft already?

Also IIRC this does not work "${FOO:-${BAR}}` and will need to be documented

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs an update in the docs, yes, because currently, putting that on an environment variable replaces it with an empty string. But I was waiting until a review for that.

Also, you are right, it won't work with ${FOO:-${BAR}}. I can do a full-fledged parser, but I think that it would be excessive, and that just by documenting that limitation should be enough.

@sergio-costas
sergio-costas force-pushed the allow-conditional-environment-variables branch 2 times, most recently from e281c28 to 9928edd Compare May 26, 2025 12:12

@zyga zyga left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the semantic to expand that in snap-exec?

Is there a specific use case you are after?

@zyga
zyga requested a review from pedronis May 28, 2025 12:51
@pedronis pedronis added ⛔ Blocked Needs Samuele review Needs a review from Samuele before it can land labels May 28, 2025
@sergio-costas

Copy link
Copy Markdown
Contributor Author

@zyga I wanted to add some extra paths in https://github.com/canonical/ubuntu-desktop-session-snap/pull/39/files , and tried that syntax, but at the end had to add all the required paths, and was James who pointed out that it won't work as I expected.

canonical/ubuntu-desktop-session-snap#39 (comment)

@sergio-costas

Copy link
Copy Markdown
Contributor Author

@zyga more details about why: the point is that, in some cases, you can't really know if an environment variable will be defined or not, so just doing VARIABLE: $VARIABLE:blah:blah/blah isn't safe, because if VARIABLE isn't defined, there would be a colon at the beginning and that breaks things in some cases. Even if, by trial, you see that the variable is undefined, that could change in the future, so I think that it's a good thing for forward compatibility.

@sergio-costas

Copy link
Copy Markdown
Contributor Author

@mr-cal mr-cal left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a useful feature. Snapcraft shouldn't need any changes to support this because it doesn't validate or evaluate these environment variables.

We can update Snapcraft's docs here to recommend using this syntax, since it's a safer practice.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for bash-style conditional parameter expansion in Environment.ExtendWithExpanded, enabling safer path-like concatenations in snapcraft.yaml-provided environment definitions.

Changes:

  • Introduce conditional expansion handling for ${VAR:-word} and ${VAR:+word} during environment expansion.
  • Route ExtendWithExpanded value expansion through the new conditional-aware expansion helper.
  • Add unit tests covering the new conditional expansion behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
osutil/env.go Adds conditional expansion parsing/handling and updates ExtendWithExpanded to use it.
osutil/env_test.go Adds tests validating conditional expansion results for various variables.

Comment thread osutil/env.go Outdated
Comment thread osutil/env.go Outdated
Comment thread osutil/env.go Outdated
Comment thread osutil/env_test.go Outdated
@bboozzoo

bboozzoo commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

@sergio-costas can you look at the latest comments and check whether there's anything to address? And let's try to land it for 2.76.

@bboozzoo bboozzoo added this to the 2.76 milestone Apr 2, 2026
@sergio-costas

Copy link
Copy Markdown
Contributor Author

@bboozzoo On it!

@sergio-costas
sergio-costas force-pushed the allow-conditional-environment-variables branch from 9928edd to 2b07c4a Compare April 6, 2026 11:34
@ernestl ernestl modified the milestones: 2.76, 2.77 May 21, 2026
@ernestl

ernestl commented May 21, 2026

Copy link
Copy Markdown
Member

Discussed with @sergio-costas, this is not very high priority. We will drop it from 2.76 release.

@sergio-costas
sergio-costas force-pushed the allow-conditional-environment-variables branch from a314876 to 2561706 Compare May 21, 2026 15:45
@pedronis
pedronis force-pushed the allow-conditional-environment-variables branch from 2561706 to 0909f8b Compare May 29, 2026 12:08
@pedronis

Copy link
Copy Markdown
Contributor

I did a bit of reviewing and pushed some tweaks myself

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@pedronis
pedronis requested a review from bboozzoo June 3, 2026 07:30
Comment thread osutil/env.go
Comment thread osutil/env.go
Comment thread osutil/env.go
Comment thread osutil/env_test.go Outdated
@pedronis pedronis changed the title env: Add support for shell conditional syntax osutil: add support for shell conditional syntax in envs Jun 5, 2026
@pedronis
pedronis requested a review from bboozzoo June 5, 2026 09:58

@bboozzoo bboozzoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@bboozzoo
bboozzoo requested review from ZeyadYasser and zyga June 8, 2026 08:13
sergio-costas and others added 5 commits June 8, 2026 10:17
Bash has support for some conditionals that allow to append text
to environment variables in a more clever way than just blindly
appending it. This is a must, for example, when appending paths
to PATH or LD_LIBRARY_PATH, because if the original variables
are empty, the new paths must be added "as-is", but if the
original variables have a value, a colon is required between
the old value and the new one.

This patch allows to append extra paths to the current defined
ones directly in the 'environment' section of the snapcraft.yaml
file.

The new supported syntaxes are:

  ${VARIABLE:-XXXXXX}

  if VARIABLE is defined, this will return the value of that
  variable; but if it is undefined, it will return the expansion
  of XXXXX (thus, if there are variables there, they will be
  recursively expanded).

  ${VARIABLE:+YYYYY}

  if VARIABLE is undefined, it will return an empty string;
  but if it is defined, it will return the expansion of YYYYY.

Example:

  ${PATH:+$PATH:}/usr/local/bin

  If PATH is undefined or empty, it will return an empty string,
  to with '/usr/local/bin' will be appended.
  But if PATH contains, for example, /usr/bin:/bin, it will
  return that plus a colon at the end, to which '/usr/local/bin'
  will be appended, thus resulting in the expected value

    /usr/bin:/bin:/usr/local/bin
Co-authored-by: Maciej Borzecki <maciek.borzecki@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sergio-costas
sergio-costas force-pushed the allow-conditional-environment-variables branch from 8d6b9f7 to c76b0ea Compare June 8, 2026 08:18
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sergio-costas
sergio-costas force-pushed the allow-conditional-environment-variables branch from c76b0ea to b929b7d Compare June 8, 2026 08:21
@sergio-costas

Copy link
Copy Markdown
Contributor Author

Rebased to trigger a test

@github-actions github-actions Bot added the Auto rerun spread Auto reruns spread up to 4 times in non-draft PRs w/ >=1 approval and <20 fails in any fund. system label Jun 8, 2026
@bboozzoo
bboozzoo requested a review from olivercalder June 9, 2026 14:09

@olivercalder olivercalder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@bboozzoo
bboozzoo merged commit 492f927 into canonical:master Jun 11, 2026
500 of 522 checks passed
@sergio-costas

Copy link
Copy Markdown
Contributor Author

Thanks! I'll add the documentation.

@sergio-costas

Copy link
Copy Markdown
Contributor Author

@olivercalder I think that here is the best place to put it: https://documentation.ubuntu.com/snapcraft/latest/reference/snapcraft-yaml/#environment . I think that I should add a snapd version number... which will be the next release version?

@olivercalder

Copy link
Copy Markdown
Member

@olivercalder I think that here is the best place to put it: https://documentation.ubuntu.com/snapcraft/latest/reference/snapcraft-yaml/#environment . I think that I should add a snapd version number... which will be the next release version?

Yes that looks like the right place. The change will be included in the snapd 2.77 release.

@sergio-costas

Copy link
Copy Markdown
Contributor Author

Added canonical/snapcraft#6290

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto rerun spread Auto reruns spread up to 4 times in non-draft PRs w/ >=1 approval and <20 fails in any fund. system Needs Samuele review Needs a review from Samuele before it can land

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants