-
-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix regression with multiple env substitutions for the same key #2873
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When the same variables appear across separate substitutions, it should not trigger chain detection.
Ensure that a true circular chain of env vars logs the correct error message.
Before the replacement parser rewrite, args was being copied in the `replace` function: https://github.com/tox-dev/tox/blob/955a7fb8864a9e682ec91589e0c10115ab6fa6a5/src/tox/config/loader/ini/replace.py#L35 This restores the previous behavior by copying `conf_args` at the beginning of `_replace_match`. This change also preseves chain detection logic by passing the copied `conf_args` back into `replace` when recursively expanding a previous replacement so that any values saved in the chain during the previous replace are present for the recursive replace (test case added in previous commit). Fix tox-dev#2869
gaborbernat
approved these changes
Jan 16, 2023
nedbat
added a commit
to nedbat/coveragepy
that referenced
this pull request
Jan 16, 2023
descope bot
referenced
this pull request
in descope/django-descope
Jan 30, 2023
This PR contains the following updates: | Package | Type | Update | Change | Pending | |---|---|---|---|---| | [tox](https://togithub.com/tox-dev/tox) ([changelog](https://tox.wiki/en/latest/changelog.html)) | dev | patch | `4.3.1` -> `4.3.2` | `4.4.2` (+5) | --- ### Release Notes <details> <summary>tox-dev/tox</summary> ### [`v4.3.2`](https://togithub.com/tox-dev/tox/releases/tag/4.3.2) [Compare Source](https://togithub.com/tox-dev/tox/compare/4.3.1...4.3.2) #### What's Changed - Fix rendering of `version_added` by [@​kurtmckee](https://togithub.com/kurtmckee) in [https://github.com/tox-dev/tox/pull/2867](https://togithub.com/tox-dev/tox/pull/2867) - Fix a RestructuredText typo by [@​kurtmckee](https://togithub.com/kurtmckee) in [https://github.com/tox-dev/tox/pull/2866](https://togithub.com/tox-dev/tox/pull/2866) - Fix typos in `{tox_root}` variable name by [@​kurtmckee](https://togithub.com/kurtmckee) in [https://github.com/tox-dev/tox/pull/2871](https://togithub.com/tox-dev/tox/pull/2871) - Fix regression with multiple env substitutions for the same key by [@​masenf](https://togithub.com/masenf) in [https://github.com/tox-dev/tox/pull/2873](https://togithub.com/tox-dev/tox/pull/2873) - Fix a incorrect config key name by [@​kurtmckee](https://togithub.com/kurtmckee) in [https://github.com/tox-dev/tox/pull/2868](https://togithub.com/tox-dev/tox/pull/2868) #### New Contributors - [@​kurtmckee](https://togithub.com/kurtmckee) made their first contribution in [https://github.com/tox-dev/tox/pull/2867](https://togithub.com/tox-dev/tox/pull/2867) **Full Changelog**: tox-dev/tox@4.3.1...4.3.2 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMDEuMCIsInVwZGF0ZWRJblZlciI6IjM0LjEwMS4wIn0=--> Co-authored-by: descope[bot] <descope[bot]@users.noreply.github.com>
This was referenced Sep 8, 2024
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix regression introduced in 4.3.0 which occured when a substitution expression for an environment variable that had previously been substituted appears in the ini file after a substitution expression for a different environment variable.
This situation erroneously resulted in an exception about "circular chain between set" of those variables.
Before the substitution parser rewrite, args was being copied in the
replace
function:tox/src/tox/config/loader/ini/replace.py
Line 35 in 955a7fb
This patch restores the previous behavior by copying
conf_args
at the beginning of_replace_match
.This change also preserves recursive chain detection logic by passing the copied
conf_args
back intoreplace
when recursively expanding a previous replacement so that any values saved in the chain during the previous replace are present for the recursive replace (test case added in previous commit).Fix #2869
Thanks for contribution
Please, make sure you address all the checklists (for details on how see
development documentation)!
tox -e fix
)docs/changelog
folder