Skip to content

for_each_task checks on databricks bundle validate - #4104

Open
idelafuente-oc wants to merge 8 commits into
databricks:mainfrom
idelafuente-oc:validate/for_each_task_validation
Open

idelafuente-oc wants to merge 8 commits into
databricks:mainfrom
idelafuente-oc:validate/for_each_task_validation

Conversation

@idelafuente-oc

@idelafuente-oc idelafuente-oc commented Dec 5, 2025 •

Copy link
Copy Markdown

Closes: #3977

Changes

Adds to the databricks bundle validate the ability to detect properties wrongly added to the parent task in for_each_task.
Currently it checks for:

  • max_retries (errors)
  • min_retry_interval_millis (warning)
  • retry_on_timeout (warning)

Can easily be extended to other configs with it's custom check.

Why

Currently databricks bundle validate doesn't detect this kind of issues, only on deployment this error was thrown. I think it's a good idea to add to the validate logic this typos of checks to prevent issues early on.

Tests

I have tested this changes by building the wheel locally with the changes implemented, here is the output of a validate run over code with the issue:
517134763-5a6f7f40-dbf6-408a-ad75-2765e25c73f4
I also added the unit tests for this.

@idelafuente-oc idelafuente-oc changed the title Validate/for each task validation for_each_task checks on databricks bundle validate Dec 5, 2025
@andrewnester

Copy link
Copy Markdown
Contributor

Hi @idelafuente-oc ! Thanks for the PR! Contributing to Databricks CLI requires you to sign a CLA If that's something you're okay with, please send a request to sign the CLA to [email protected], and we'll take it from there. Thank you!

@idelafuente-oc

idelafuente-oc commented Dec 9, 2025 •

Copy link
Copy Markdown
Author

Hi @idelafuente-oc ! Thanks for the PR! Contributing to Databricks CLI requires you to sign a CLA If that's something you're okay with, please send a request to sign the CLA to [email protected], and we'll take it from there. Thank you!

Hello @andrewnester! Since the CLA has been completed, is this good to be reviewed? I added a commit with a small change for a few lines that the gh linter was complaining about. Thank you!

@idelafuente-oc

Copy link
Copy Markdown
Author

Thank you for the feedback @andrewnester, Is there anything missing to merge this?

@andrewnester andrewnester 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.

The branch is based on a February main (about 2000 commits behind). On current main the acceptance matrix is DMS instead of DATABRICKS_BUNDLE_ENGINE, so the three out.test.toml files will not match after a rebase, and user-visible changes now need a fragment under .nextchanges/bundles/ (see .nextchanges/README.md). Can you rebase, re-run ./task test-update for these tests, and add the fragment?

Comment thread bundle/config/validate/for_each_task.go Resolved
Comment thread bundle/config/validate/for_each_task.go Resolved
Comment thread bundle/config/validate/for_each_task.go Resolved
@idelafuente-oc
idelafuente-oc force-pushed the validate/for_each_task_validation branch from b7ebe59 to dd98f35 Compare November 11, 2026 13:57
@idelafuente-oc
idelafuente-oc requested review from a team as code owners November 11, 2026 13:57
@idelafuente-oc

Copy link
Copy Markdown
Author

Rebased onto upstream main at 7ac220c and pushed review fixes in dd98f35.

  • Diagnostics now point to the exact retry field using the current structpath/GetLocationsOf APIs, without the redundant task-name prefix.
  • Consolidated the three acceptance directories into for_each_task with three targets and traced commands. The warning-only target confirms the accepted-but-ineffective API settings do not block validation; the valid target covers nested retries and ordinary tasks.
  • Regenerated expected output and the DMS matrix; added the bundles changelog fragment.
  • Confirmed Jobs API behavior against a real workspace and cleaned up all disposable job definitions; details are in the inline thread.

Validation passed:

  • go test ./bundle/config/validate
  • go test ./acceptance -run '^TestAccept/bundle/validate/for_each_task$' -update -tail -test.v
  • go test ./acceptance -run '^TestAccept/bundle/validate/' -timeout 20m (all validation acceptance tests, including both DMS variants)
  • ./task fmt
  • ./task lint
  • ./task checks
  • git diff --cached --check

The full repository test suite was not run.

@github-actions github-actions Bot added the DABs DABs related issues label Nov 11, 2026
Comment thread bundle/config/validate/for_each_task.go Resolved
Comment thread bundle/config/validate/for_each_task.go Resolved
Sort retry diagnostics by configuration path and describe unsupported or ineffective settings in their summaries.

Co-authored-by: Copilot <[email protected]>

@andrewnester andrewnester 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.

The two remaining comments above are nits; everything from the earlier rounds is addressed. Approving.

@idelafuente-oc

idelafuente-oc commented Nov 13, 2026 •

Copy link
Copy Markdown
Author

@andrewnester FYI, I already signed the CLA last year when I originally opened this 😄

@github-actions

Copy link
Copy Markdown
Contributor

An authorized user can trigger integration tests manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 4104
  • Commit SHA: b3d37096c356f889e888c6d1ac06321b2c8819a7

Checks will be approved automatically on success.

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

DABs DABs related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validate doesn't detect issues on for_each_task

2 participants