Skip to content

Fix #33437: Prevent None values from overwriting existing pillar data - #68533

Open
dwoz wants to merge 2 commits into
saltstack:3008.xfrom
dwoz:issue/33437/3006.x
Open

dwoz wants to merge 2 commits into
saltstack:3008.xfrom
dwoz:issue/33437/3006.x

Conversation

@dwoz

@dwoz dwoz commented Dec 14, 2025

Copy link
Copy Markdown
Contributor

When merging pillar data, None values were overwriting existing non-empty dictionaries. This fix adds a _filter_none_overwrites function that filters out None values during pillar merging to preserve existing data.

  • Added _filter_none_overwrites function to Pillar.render_pillar
  • Added test case to test_pillar.py to verify the fix

Fixes #33437

@dwoz
dwoz requested a review from a team as a code owner December 14, 2025 01:04
@dwoz
dwoz force-pushed the issue/33437/3006.x branch from 254c753 to f298ff7 Compare December 14, 2025 01:37
@dwoz dwoz added the test:full Run the full test suite label Dec 14, 2025
@dwoz
dwoz force-pushed the issue/33437/3006.x branch from f298ff7 to 6e99078 Compare December 14, 2025 02:22
@dwoz
dwoz changed the base branch from master to 3006.x December 14, 2025 02:35
@dwoz
dwoz force-pushed the issue/33437/3006.x branch from 05c16d7 to a5924d1 Compare June 8, 2026 02:21
@twangboy

twangboy commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

We are no longer accepting Bugfix releases on the 3006.x branch. Please rebase this on the 3008.x branch.

@dwoz

dwoz commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

@dwoz 3006.x has entered security only. Please rebase these changes on 3008.x

dwoz and others added 2 commits October 29, 2026 11:09
…llar data

When merging pillar data, if one pillar file is empty (e.g., due to
conditional rendering that produces no output), None values were
overwriting existing non-empty dictionaries.

This fix adds a _filter_none_overwrites function that recursively
removes None values that would overwrite existing non-empty dicts
during the pillar merge process.

- Added _filter_none_overwrites function to salt/pillar/__init__.py
- Applied filter before merging pillar state
- Added test case to test_pillar.py to verify the fix
@Sxderp

Sxderp commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

The current patch doesn't seem to take implicit vs explicit null into account.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 96.22642% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.72%. Comparing base (3be1879) to head (d7bed38).
⚠️ Report is 51 commits behind head on 3008.x.

Files with missing lines Patch % Lines
salt/pillar/__init__.py 90.48% 1 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           3008.x   #68533      +/-   ##
==========================================
- Coverage   73.78%   73.72%   -0.06%     
==========================================
  Files        2585     2585              
  Lines      369632   369685      +53     
  Branches    48817    48825       +8     
==========================================
- Hits       272704   272521     -183     
- Misses      83499    83776     +277     
+ Partials    13429    13388      -41     
Flag Coverage Δ
salt 60.16% <90.48%> (-0.10%) ⬇️
tests 87.76% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
tests/pytests/unit/pillar/test_pillar.py 100.00% <100.00%> (ø)
salt/pillar/__init__.py 75.23% <90.48%> (+0.43%) ⬆️

... and 58 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch was previously deployed

1 inactive deployment
ci — d7bed384 Deployed Oct 29, 2026 by twangboy via Build Onedir Packages / DEB (x86_64) #28070
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:coverage test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merging pillars when one is empty gives empty result

4 participants