Repository navigation
Do not write a dotted profile's keys into its parent section - #7266
Open
maksim-zuev-db wants to merge 3 commits into
Open
maksim-zuev-db wants to merge 3 commits into
maksim-zuev-db wants to merge 3 commits into
Conversation
go-ini treats [team.prod] as a child of [team], and Section.Key returns the parent's key when the child doesn't have it. So saving host to a new [team.prod] next to an existing [team] rewrote [team]'s host and left [team.prod] without it. SaveResourcesToProfile had the same problem. Section.NewKey only looks at the section's own keys. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
Integration test reportCommit: 6ccc40a
Top 3 slowest tests (at least 2 minutes):
|
Co-authored-by: Isaac <no-reply@databricks.com>
This branch has not been deployed
This file contains hidden or 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
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.
Changes
SaveToProfileandSaveResourcesToProfilenow write keys withsection.NewKeyinstead ofsection.Key, so they only touch the target section's own keys.Why
Follow-up to this review comment on #7196.
go-ini treats
[team.prod]as a child of[team], andsection.Keyreturns the parent's key when the child doesn't have it. So saving a newteam.prodprofile wrote the missing keys into[team]:databricks auth loginrewrote itshost, anddatabricks configurerewrote itshostandtoken.SaveResourcesToProfileoverwrote the parent'sresourcesthe same way.Tests
TestSaveToProfile_DottedNameDoesNotWriteParentSectionsaves toteam.prodnext to an existing[team]and checks both sections. It fails without the fix.libs/databrickscfg/...,cmd/authandcmd/configureunit tests pass.This pull request and its description were written by Isaac.