Skip to content

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

Open
moshe-elastix wants to merge 1 commit intopulp-platform:masterfrom
moshe-elastix:fix/envvar-prefix-paths
Open

fix(paths): Resolve env vars before applying prefix to dependency paths#303
moshe-elastix wants to merge 1 commit intopulp-platform:masterfrom
moshe-elastix:fix/envvar-prefix-paths

Conversation

@moshe-elastix
Copy link
Copy Markdown

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
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

1 participant