Skip to content

Fix nested null value overrides - #5185

Merged
scottrigby merged 1 commit into
helm:masterfrom
govau:fixnestednullcoalesce
Jun 3, 2019
Merged

scottrigby merged 1 commit into
helm:masterfrom
govau:fixnestednullcoalesce

Conversation

@aeijdenberg

Copy link
Copy Markdown

Closes #5184

What this PR does / why we need it:

This PR adds tests for setting nested values to null and ensure such values are actually deleted.

Special notes for your reviewer:

I've split this into 4 commits. They do the following:

  1. Adds some code to the tests to make it easier to add nested null values tests.
  2. Adds tests that fails.
  3. Does a fairly minimal fix - this is enough to make the tests pass.
  4. The last commit touches a bit more code, and attempts to simplify the coalescence more broadly by consolidating on to a single codepath, and being a bit more careful about which maps are mutated. Tests continue to pass - but I'm a little less confident about the full impact of this commit.

If applicable:

  • this PR contains unit tests

@helm-bot helm-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 18, 2019
@cdenneen

Copy link
Copy Markdown

@aeijdenberg can you fix this by adding metadata to the integration tests? Really want to get this fix in place.

@aeijdenberg
aeijdenberg force-pushed the fixnestednullcoalesce branch 2 times, most recently from 6c7105b to 01cd6a0 Compare March 27, 2019 04:40
@aeijdenberg

Copy link
Copy Markdown
Author

@cdenneen - I've found the missing metadata, added it, and removed the nil check. Let me know if you'd like that added back in.

(oh, and also re-based on latest master)

@cdenneen

Copy link
Copy Markdown

I’m okay with nil being valid “null” setting but that’s just me

@cdenneen

Copy link
Copy Markdown

@aeijdenberg can you add label bug and awaiting review

@cdenneen

cdenneen commented Apr 20, 2019 •

Copy link
Copy Markdown

@aeijdenberg can you please add those labels?

@bacongobbler

bacongobbler commented Apr 21, 2019 •

Copy link
Copy Markdown
Member

Only admins can attach labels. I've done the needful.

@bacongobbler bacongobbler added awaiting review bug Categorizes issue or PR as related to a bug. labels Apr 21, 2019
@cdenneen

Copy link
Copy Markdown

Thanks @bacongobbler

@scottrigby

scottrigby commented Apr 23, 2019 •

Copy link
Copy Markdown
Member

Hi I just saw this from #5184 👋 I'm late to the party

@cdenneen Quick reply to #5185 (comment): the reason I added these 5 lines in the test initially is that null, Null, NULL, and ~ are all valid when parsed, but different from empty string "". I think it's fine that these are already checked on these lines and don't need to be re-checked in the deeply nested test added by this PR 👍

@aeijdenberg re point 4 in the PR description, I'm also not fully sure about other possible impacts of this (second to last) commit: e69e888. @bacongobbler I'd like another set of eyes on that. But, it does fix the 🐛 (the updated tests are great, and I also manually tested with a few different scenarios I'm aware of from community helm/charts) - everything seems to work 💯

Comment thread pkg/chartutil/values.go Resolved
@aeijdenberg

Copy link
Copy Markdown
Author

Hi all, sorry to go quiet on this PR. Am back on deck now - let me know if any changes are desired.

scottrigby added a commit to codecademy-engineering/helm-charts that referenced this pull request May 4, 2019
- External port can always be handled by port-forwarding or Ingress
- Allows us to more easily move probes to values (use case: override probe for a
  sidekiq rails container)
- Temporarily comment out probes in order to use other handlers. Follow issue at
  helm/helm#5185

Signed-off-by: Scott Rigby <[email protected]>
@scottrigby

Copy link
Copy Markdown
Member

I resolved my last comment. This LGTM 👍 but would still like another set of eyes on the reorganizing commit I mentioned here #5185 (comment)

@thomastaylor312

Copy link
Copy Markdown
Contributor

Hey @aeijdenberg so that refactor commit looks pretty good, but I want to review it a little more in depth with @scottrigby to make sure it doesn't affect other things. Would you be willing to pop that commit off of this PR and open it as a separate PR? It would allow us to merge this fix and address the refactor in another PR.

Thanks for going through the refactoring effort with this code. We really appreciate it!

@aeijdenberg
aeijdenberg force-pushed the fixnestednullcoalesce branch from 01cd6a0 to 0181a36 Compare May 31, 2019 06:16
@helm-bot helm-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 31, 2019
- Add ability to test for nested non-existent keys
- Add test cases for nested null values
- Minimalist fix for nested null key test cases
- Add missing metadata to integration test

Signed-off-by: Adam Eijdenberg <[email protected]>
@aeijdenberg

Copy link
Copy Markdown
Author

@thomastaylor312 - done. I've rebased on latest master, squashed the commits (excluding the refactor), and have opened #5821 for the refactoring.

@scottrigby scottrigby left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for splitting this. Lgtm

@thomastaylor312 thomastaylor312 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, sorry for the delay. I was talking with some of the other maintainers to make sure that deleting a key wouldn't create any side effects. This LGTM. Thanks for the good work!

@scottrigby scottrigby added approved Indicates a PR has been approved by the required number of approvers and removed awaiting review labels Jun 3, 2019
@scottrigby
scottrigby merged commit 02ea889 into helm:master Jun 3, 2019
@aeijdenberg
aeijdenberg deleted the fixnestednullcoalesce branch June 4, 2019 01:50
@scottrigby scottrigby modified the milestones: 2.15.0, 2.14.2 Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by the required number of approvers bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nested null values don't remove keys as expected

7 participants