Skip to content

acc: record dropped short-form variable override under environments - #8182

Merged
denik merged 1 commit into
mainfrom
denik/acc-environments-var-shorthand
Nov 30, 2026
Merged

denik merged 1 commit into
mainfrom
denik/acc-environments-var-shorthand

Conversation

@denik

@denik denik commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Changes

New test acceptance/bundle/variables/environments_shorthand. It records that target variable overrides written in the short form under the deprecated environments key are dropped with a warning, so the root value is used:

Warning: expected map, found string
  at environments.dev.variables.short
  in databricks.yml:18:14

Warning: unknown field: key
  at environments.dev.variables.complex
  in databricks.yml:22:9

{"complex":{"key":"root_value"},"full":"target_value","short":"root_value"}

The same overrides under targets, or in the full form ({default: ...}), work. Badness in test.toml says what is wrong and what is right.

Why

This PR was created by analyzing coverage gaps. Coverage: http://go/cli/dashboard/coverage/file/bundle/config/root.go (rewriteShorthands, the shorthand rewrite that (*Root).MergeTargetOverrides relies on).
environments is still accepted. The JSON schema marks it deprecated, but there is no warning at runtime. A bundle that still uses it and overrides a variable in the short form gets the root value without an error. For example, it deploys with the default catalog instead of the target's. No existing test combines environments with variables.

Fix: #8183

A new small test directory, because environments and targets can't be in the same configuration. It runs one bundle validate (about 0.1s per DMS variant locally).

Gaps and risks

  • Only bundle validate is covered. Every other bundle command goes through the same loader.
  • Risk: low (test only).

🤖 AI agent (opus5.5, isaac_claude)

This pull request and its description were written by Isaac.

@github-actions github-actions Bot added DABs DABs related issues test-only-fix PRs that update failing of flaky tests without changing CLI code. labels Nov 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Regression test report ✅

Commit: 5f584e495 | Workflow run

Selected 1 changed tests (limit=20, 0 not selected)

2 tests: regression=0 unreleased=0 coverage=2 failing=0
test branch main (3442593) latest (v1.28.0)
TestAccept/bundle/variables/environments_shorthand/DMS= ✅ ✅ ✅
TestAccept/bundle/variables/environments_shorthand/DMS=true ✅ ✅ ✅

@eng-dev-ecosystem-bot

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

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 5f584e4

Run: 46423490208

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 91 7 2:45
✅​ aws-windows-latest-4core-16gb 91 7 3:12
✅​ azure linux-2core-8gb 91 7 2:33
✅​ azure-windows-latest-4core-16gb 91 7 3:14
✅​ gcp linux-2core-8gb 91 7 4:11
✅​ gcp-windows-latest-4core-16gb 91 7 2:49
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:12 azure-windows-latest-4core-16gb TestAccept
3:10 aws-windows-latest-4core-16gb TestAccept
2:48 gcp-windows-latest-4core-16gb TestAccept

@denik
denik marked this pull request as ready for review November 30, 2026 00:53
@denik
denik requested review from a team as code owners November 30, 2026 00:53

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated review at 655d23a. Each finding was verified against the code.

No blocking issues found.

This PR adds the acceptance test acceptance/bundle/variables/environments_shorthand. It records that short-form and complex variable overrides under the deprecated environments key get dropped with a normalizer warning, so the root value is used instead. The recorded output matches the current loader: rewriteShorthands in bundle/config/root.go only rewrites under targets, and EnvironmentsToTargets runs after normalization has already dropped the values. The warning line and column numbers also match databricks.yml. The wrong result is marked under Badness, and I found nothing that needs changing before merge.

A target variable written in the short form under the deprecated
'environments' key is dropped with a warning, so the root value is used.

Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik force-pushed the denik/acc-environments-var-shorthand branch from 655d23a to 5f584e4 Compare November 30, 2026 12:55
@denik
denik added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 240a234 Nov 30, 2026
27 checks passed
@denik
denik deleted the denik/acc-environments-var-shorthand branch November 30, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DABs DABs related issues factory-generated test-only-fix PRs that update failing of flaky tests without changing CLI code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants