Skip to content

Do not write a dotted profile's keys into its parent section - #7266

Open
maksim-zuev-db wants to merge 3 commits into
mainfrom
databrickscfg-save-own-section-keys
Open

maksim-zuev-db wants to merge 3 commits into
mainfrom
databrickscfg-save-own-section-keys

Conversation

@maksim-zuev-db

@maksim-zuev-db maksim-zuev-db commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Changes

SaveToProfile and SaveResourcesToProfile now write keys with section.NewKey instead of section.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], and section.Key returns the parent's key when the child doesn't have it. So saving a new team.prod profile wrote the missing keys into [team]: databricks auth login rewrote its host, and databricks configure rewrote its host and token. SaveResourcesToProfile overwrote the parent's resources the same way.

Tests

  • TestSaveToProfile_DottedNameDoesNotWriteParentSection saves to team.prod next to an existing [team] and checks both sections. It fails without the fix.
  • libs/databrickscfg/..., cmd/auth and cmd/configure unit tests pass.

This pull request and its description were written by Isaac.

maksim-zuev-db and others added 2 commits October 30, 2026 15:10
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>
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 6ccc40a

Run: 41439445972

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 281 15 4:00
✅​ aws-windows-latest-4core-16gb 283 13 2:56
✅​ azure linux-2core-8gb 280 15 3:55
✅​ azure-windows-latest-4core-16gb 282 13 3:32
✅​ gcp linux-2core-8gb 281 15 4:05
✅​ gcp-windows-latest-4core-16gb 283 13 3:33
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:27 gcp-windows-latest-4core-16gb TestAccept
3:26 azure-windows-latest-4core-16gb TestAccept
2:40 aws-windows-latest-4core-16gb TestAccept

Co-authored-by: Isaac <no-reply@databricks.com>
@maksim-zuev-db
maksim-zuev-db marked this pull request as ready for review November 2, 2026 12:08
@maksim-zuev-db
maksim-zuev-db requested review from a team as code owners November 2, 2026 12:09

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants