Skip to content

Fix circular reference issues with OptsDict/NamedLoaderContext#69005

Open
lkubb wants to merge 2 commits intosaltstack:3008.xfrom
lkubb:fix-optsdict-loadercontext
Open

Fix circular reference issues with OptsDict/NamedLoaderContext#69005
lkubb wants to merge 2 commits intosaltstack:3008.xfrom
lkubb:fix-optsdict-loadercontext

Conversation

@lkubb
Copy link
Copy Markdown
Contributor

@lkubb lkubb commented Apr 28, 2026

What does this PR do?

Makes safe_opts_copy account for being passed a NamedLoaderContext instance by unwrapping its current value before returning the derivative dict.

Note:

  • I hope this fix is correct, please review it carefully.
  • No changelog because this issue is not present in any stable release.

What issues does this PR fix or reference?

Fixes: #68973

Previous Behavior

Possible circular references because an OptsDict could become its own base transitively via a NamedLoaderContext instance returning it.

New Behavior

NamedLoaderContext instances are resolved before creating a derivative dict.

Merge requirements satisfied?

Commits signed with GPG?

Yes

@lkubb lkubb requested a review from a team as a code owner April 28, 2026 18:09
@lkubb lkubb changed the title Fix optsdict loadercontext Fix circular reference issues with OptsDict/NamedLoaderContext Apr 28, 2026
@lkubb lkubb force-pushed the fix-optsdict-loadercontext branch from 3e1136b to 175a422 Compare April 28, 2026 18:30
@dwoz dwoz added the test:full Run the full test suite label Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants