Skip to content

fix(paths): Resolve env vars before applying prefix to dependency paths - #303

Merged
micprog merged 1 commit into
pulp-platform:masterfrom
moshe-elastix:fix/envvar-prefix-paths
May 18, 2026
Merged

micprog merged 1 commit into
pulp-platform:masterfrom
moshe-elastix:fix/envvar-prefix-paths

Conversation

@moshe-elastix

Copy link
Copy Markdown
Contributor

PrefixPaths for String joins the consuming Bender.yml's parent directory onto the raw template string before env vars are substituted, so a ${VAR} that expands to an absolute path is treated as a relative segment and double-slashed (e.g. <parent>//repo/...). Direct absolute literals and relative env vars work; only absolute env-var expansions break.

This PR fixes the issue by:

  • Substituting env vars in PrefixPaths for String before deciding whether to prefix.
  • Skipping the prefix when the substituted result is already absolute; otherwise joining as before.

Fixes #302

`PrefixPaths for String` was joining the consuming Bender.yml's parent
directory onto the raw template string before env vars were substituted, so a
`${VAR}` that expands to an absolute path was treated as a relative segment
and double-slashed (e.g. `<parent>//repo/...`). Direct absolute literals and
relative env vars worked; only absolute env-var expansions broke.

Substitute env vars first; skip the prefix when the substituted result is
already absolute, otherwise join as before.

Fixes pulp-platform#302
@micprog
micprog merged commit 1d4de1b into pulp-platform:master May 18, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

prefix_paths double-slashes absolute env-var paths

2 participants