Skip to content

fix(profile): empty allow_vars no longer strips all env vars#1204

Open
SequeI wants to merge 2 commits into
mainfrom
fixEnvVars
Open

fix(profile): empty allow_vars no longer strips all env vars#1204
SequeI wants to merge 2 commits into
mainfrom
fixEnvVars

Conversation

@SequeI

@SequeI SequeI commented Jun 19, 2026

Copy link
Copy Markdown
Member

Linked Issue

Ref #1203

Summary

When a profile contained an environment block without explicit allow_vars (e.g. only deny_vars or set_vars), allowed_env_vars resolved to Some([]) instead of None. Because Some([]) activates the allow-list filter with nothing in it, every inherited env var was silently stripped — including PATH and HOME.

Fix: change .map to .and_then and return None when allow_vars is empty, consistent with the existing deny_vars handling.

Test Plan

Checklist

  • An issue exists and is linked above
  • All commits are signed-off, using DCO
  • All new code follows the project's coding standards (CLAUDE.md) and is covered by tests
  • Public-facing changes are paired with documentation updates
  • Release note has been added to CHANGELOG.md if needed

@github-actions github-actions Bot added bug Something isn't working nono-cli size/small labels Jun 19, 2026
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

PR Review Summary

Size

Metric Value
Lines added +124
Lines removed -24
Total changed 148
Classification Medium (50–300 lines)

Affected crates

  • crates/nono-cli — CLI changes. Verify argument parsing, flag documentation, and UX behaviour across supported platforms.

Blast radius — Moderate

This PR touches: source code,documentation


Updated automatically on each push to this PR.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the environment variable filtering logic in profile_runtime.rs so that an empty allow_vars list returns None instead of activating an empty allow filter (which would block all environment variables). The feedback points out that the new tests duplicate production logic in a helper function, which can lead to test drift. It is recommended to refactor the tests to use the actual prepare_profile entry point with temporary files on disk to ensure the real production code path is validated.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread crates/nono-cli/src/profile_runtime.rs Outdated
When a profile contained an `environment` block without explicit
`allow_vars` (e.g. only `deny_vars` or `set_vars`), `allowed_env_vars`
resolved to `Some([])` instead of `None`. Because `Some([])` activates
the allow-list filter with nothing in it, every inherited env var was
silently stripped — including `PATH` and `HOME`.

Fix: change `.map` to `.and_then` and return `None` when `allow_vars`
is empty, consistent with the existing `deny_vars` handling.

Signed-off-by: Aleksy Siek <aleksy@alwaysfurther.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working nono-cli size/medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant