Commit 3570941
authored
Remove unused configuration fields from the profile
## 🥞 Stacked PR
Use this [link](https://github.com/databricks/sdk-js/pull/197/files) to
review incremental changes.
-
[**stack/remove-extra**](#197)
[[Files changed](https://github.com/databricks/sdk-js/pull/197/files)]
---------
## Summary
Removes 21 fields from the `Profile` interface in
`packages/core/src/profiles/` that were parsed from
`.databrickscfg`/environment variables and stored but never read by any
credential strategy, leaving only the fields that actually drive
authentication and workspace identity.
## Why
`Profile` was ported 1:1 from the Go SDK's `core/profiles` package,
which mirrors the full `.databrickscfg` schema. In the JS SDK, only PAT,
OAuth-M2M, and CLI/U2M credential strategies are wired up and use a
subset of parameters. The other parameters got completely ignored, which
is confusing, so this PR removes them. Some parameters will be added
when we actually use them.
## How is this tested?
All five CI stages pass for the affected packages
(`@databricks/sdk-core`, `@databricks/sdk-auth`): `format:check`,
`lint`, `typecheck`, `test` (core 339, auth 95), and `test:browser`
(core 249, auth 72). No new tests were added — this is a removal,
validated by the existing profile-resolution (`resolve.test.ts`) and
property-mapping (`profile.test.ts`) suites.
## AI Generated
## What changed
### Interface changes
Removed 21 optional fields from the `Profile` interface and their
corresponding `PROPERTY_DEFS` entries (env-var + INI-key mappings):
- Compute defaults: `clusterId`, `warehouseId`, `serverlessComputeId`
- Basic auth: `username`, `password`
- Azure: `azureClientId`, `azureClientSecret`, `azureTenantId`,
`azureResourceId`, `azureEnvironment`, `azureLoginAppId` (was
`@deprecated`), `azureUseMsi`
- Google: `googleCredentials`, `googleServiceAccount`
- OIDC / Workload Identity Federation: `discoveryUrl`, `oidcTokenEnv`,
`oidcTokenFilePath`, `tokenAudience`, `actionsIdTokenRequestUrl`,
`actionsIdTokenRequestToken`
- Metadata service: `metadataServiceUrl`
`Profile` now contains only: `name`, `host`, `workspaceId`, `accountId`,
`token`, `authType`, `clientId`, `clientSecret`, `databricksCliPath`,
and `extra`.
### Behavioral changes
INI keys for the removed fields (e.g. `cluster_id`, `azure_client_id`,
`password`) are no longer recognized as known fields and now fall
through to the `Profile.extra` map like any other unknown key; their
environment variables (e.g. `DATABRICKS_CLUSTER_ID`, `ARM_CLIENT_ID`)
are no longer read. No currently-wired authentication method is
affected, because the default-credentials chain consumes none of the
removed fields.
### Internal changes
- Deleted the `parseBool()` helper, which became unused once
`azureUseMsi` (the only boolean field) was removed; this also retired
the file's last `@typescript-eslint/no-deprecated` directives, which
existed solely for `azureLoginAppId`.
- `profile.test.ts`: removed the boolean round-trip and invalid-boolean
test cases and the boolean unset case, and simplified the "covers every
field" test (no boolean field remains).
- `resolve.test.ts` and `testdata/databrickscfg`: removed the `azure`
profile fixture, the `azure` resolve case, and `azure` from the
`listProfiles` expectation; also dropped `cluster_id`/`warehouse_id`
from the `workspace` fixture.
- `testdata/go-ini-reference.json` is intentionally left unchanged: it
cross-validates the raw INI parser (`ini.ts`) against Go's `ini.v1`,
independent of `Profile` field mapping.Profile (#197)1 parent bd20889 commit 3570941
5 files changed
Lines changed: 29 additions & 374 deletions
File tree
- packages/core
- src/profiles
- tests/profiles
- testdata
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments