Skip to content

Use resource.yml in field classification in config-remote-sync#4677

Open
ilyakuz-db wants to merge 9 commits intomainfrom
config-sync-migrate-to-resource-yml
Open

Use resource.yml in field classification in config-remote-sync#4677
ilyakuz-db wants to merge 9 commits intomainfrom
config-sync-migrate-to-resource-yml

Conversation

@ilyakuz-db
Copy link
Contributor

@ilyakuz-db ilyakuz-db commented Mar 6, 2026

Changes

  1. Use existing resource.yml classification in config-remote-sync instead of custom rules
  2. Update resource.yml with new fields

Why

This PR eliminates tech debt, config-remote-sync will be in sync with resource updates

Tests

Existing tests (one snapshot updated because underlying bug was fixed)

@ilyakuz-db ilyakuz-db temporarily deployed to test-trigger-is March 6, 2026 16:38 — with GitHub Actions Inactive
@eng-dev-ecosystem-bot
Copy link
Collaborator

eng-dev-ecosystem-bot commented Mar 6, 2026

Commit: 4045284

Run: 22947459598

Env 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 8 7 268 781 6:06
💚​ aws windows 8 7 270 779 5:20
🔄​ aws-ucws linux 2 7 7 364 696 7:09
🔄​ aws-ucws windows 2 7 7 366 694 6:33
💚​ azure linux 2 9 271 779 5:55
💚​ azure windows 2 9 273 777 3:59
🔄​ azure-ucws linux 6 1 9 365 692 9:48
🔄​ azure-ucws windows 2 1 9 371 690 5:30
💚​ gcp linux 2 9 267 782 6:07
💚​ gcp windows 2 9 269 780 4:47
20 interesting tests: 7 flaky, 7 SKIP, 6 RECOVERED
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
🔄​ TestAccept 💚​R 💚​R 💚​R 🔄​f 💚​R 💚​R 🔄​f 🔄​f 💚​R 💚​R
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/resources/postgres_branches/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/update_protected 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/without_branch_id 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_endpoints/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/synced_database_tables/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestAccept/ssh/connect-serverless-gpu 🙈​s 🙈​s 🔄​f 🔄​f 🙈​s 🙈​s 🔄​f 🔄​f 🙈​s 🙈​s
🔄​ TestAccept/ssh/connection 💚​R 💚​R 🔄​f 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🔄​ TestFilerReadDir ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p
🔄​ TestFilerReadDir/dbfs ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p
🔄​ TestFilerReadWrite ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p
🔄​ TestFilerReadWrite/dbfs ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p
Top 20 slowest tests (at least 2 minutes):
duration env testname
3:47 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:40 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:22 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:21 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:16 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:16 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:15 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:12 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:10 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:08 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:59 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:49 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:46 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:46 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:39 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:39 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:21 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:17 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:16 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:07 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct

@ilyakuz-db ilyakuz-db temporarily deployed to test-trigger-is March 7, 2026 11:01 — with GitHub Actions Inactive
email_notifications.on_failure[0]: replace
max_concurrent_runs: replace
tags['env']: remove
timeout_seconds: remove
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is expected, logic was incorrect previously - this case was skipped completely

// If a CLI-defaulted field is changed on remote and should be disabled
// (e.g. queueing disabled → remote field is nil), we can't define it
// in the config as "null" because the CLI default will be applied again.
var resetValues = map[string][]resetRule{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we include this logic in resources.yml?

reason: managed

backend_defaults:
# Backend returns PERFORMANCE_OPTIMIZED for serverless jobs when not set
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is set only for serverless jobs, probably, this should live in changes desc overrides

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this field ever set for non-serverless jobs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is, actually! I thought that it only applies to Serverless jobs because in UI we show this checkbox as disabled for non-Serverless, but looking at the settings object in the resource, we do have this field set to PERFORMANCE_OPTIMIZED


# Same as clusters.node_type_id — see clusters/resource_cluster.go#L333
# s.SchemaPath("node_type_id").SetComputed()
- field: tasks[*].new_cluster.node_type_id
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When I try to create new_cluster without node_type_id it fails with 400 error:

Endpoint: POST https://<host>/api/2.2/jobs/reset
HTTP Status: 400 Bad Request
API error_code: INVALID_PARAMETER_VALUE
API message: Cluster validation error: Unknown node type id

Considering that backend default is applied only when config value is nil, and for nil value we have 400 error - it doesn't make sense to keep it here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cc @denik

Copy link
Contributor

Choose a reason for hiding this comment

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

Question, if I don't specify new_cluster, can it be added by the backend when resource is fetched? I guess not, or some test would fail, but good to say it explicitly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In which case? You can either use existing_cluster_id fields or new_cluster object. node_type_id exists in new_cluster and it cannot be set independently. When you specify compute for a task, you have 3 options:

  1. select existing cluster (existing_cluster_id field)
  2. add new (new_cluster field)
  3. use serverless (doesn't have node_type_id)

@ilyakuz-db ilyakuz-db temporarily deployed to test-trigger-is March 8, 2026 23:18 — with GitHub Actions Inactive
@ilyakuz-db ilyakuz-db changed the title Config sync migrate to resource yml Use resource.yml in field classification in config-remote-sync Mar 9, 2026
@ilyakuz-db ilyakuz-db marked this pull request as ready for review March 9, 2026 09:54
ignore_remote_changes:
# edit_mode is set by CLI, not user-configurable
- field: edit_mode
reason: managed
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm using "managed" in other places to mean managed by backend, we should have another reason here.


jobs:
ignore_remote_changes:
# edit_mode is set by CLI, not user-configurable
Copy link
Contributor

Choose a reason for hiding this comment

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

You mean DABs override user setting? Do you know if that is intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I meant that the user can't specify this field in databricks.yml, it's not in the json schema

It's only set by CLI

Copy link
Contributor

Choose a reason for hiding this comment

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

Understood, although still not clear why ignore_remote_changes for it? What if CLI sets A and user updates to B, should we not act on that drift?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In config-remote-sync, we don't need to act, as this field only controls "Job is locked for edits" state. And when yaml sync feature is enabled, we always expect EDITABLE. We also set it explicitly during deployment:

job.EditMode = jobs.JobEditModeEditable

But for the bundle plan, perhaps it could make sense. Example use case - user clicks "Disconnect this job from DAB", which changes edit_mode: UI_LOCKED -> EDITABLE in the resource. When user deploys again - the change is edit_mode: EDITABLE -> UI_LOCKED

Maybe it makes sense to keep a separate option in resources.yml for such cases, for example: ignore_for_sync / ignore_in_sync

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to configsync package from here

reason: managed

backend_defaults:
# Backend returns PERFORMANCE_OPTIMIZED for serverless jobs when not set
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this field ever set for non-serverless jobs?

@ilyakuz-db ilyakuz-db requested a review from denik March 11, 2026 11:03
Copy link
Member

@simonfaltum simonfaltum left a comment

Choose a reason for hiding this comment

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

Review (automated, 2 agents)

Verdict: Not ready yet | 0 Critical | 1 Major | 1 Gap(Major) | 2 Nit | 1 Suggestion

[Major] Migration drops suppression behavior for ~16 fields

bundle/direct/dresources/resources.yml

The old serverSideDefaults handled timeout_seconds, email_notifications, webhook_notifications, task disabled, pipeline_task.full_refresh, single_user_name, data_security_mode, pipeline continuous, and others. These have no equivalent rules in resources.yml yet. After this PR, config-remote-sync will start surfacing these as drift.

Additionally, removing node_type_id from backend_defaults changes deploy plan behavior (not just config-sync), potentially causing spurious updates for clusters where the backend auto-fills node type. Note the asymmetry: driver_node_type_id is still in backend_defaults.

Suggestion: Add equivalent backend_defaults/ignore_remote_changes rules for the missing fields, or explain why removing them is safe.

[Gap (Major)] No regression tests for migrated configsync classification rules

bundle/configsync/diff_test.go (deleted), bundle/configsync/diff.go

The only unit test file was deleted (90 lines of matchPattern tests). No replacement tests for shouldClassifySkip, filterEntityDefaults, or convertChangeDesc. The new glue logic (synthetic ChangeDesc{Old: nil, New: nil, Remote: value}) has subtle interactions with the classification pipeline.

Suggestion: Add table-driven tests for shouldClassifySkip and convertChangeDesc covering backend defaults, zero/nil values, nested maps, and non-default values.

[Suggestion] Document the hasConfigValue behavioral change

bundle/configsync/diff.go:107

The change from hasConfigValue := cd.Old != nil || cd.New != nil to hasConfigValue := cd.New != nil is a correctness fix (confirmed by the acceptance test update), but there's no comment explaining why only cd.New is checked, making it easy for a future contributor to "fix" it back.

[Nit] Silent error swallowing in shouldClassifySkip

bundle/configsync/diff.go:60-63 - Classification errors silently return false. A debug log would help diagnose issues.

[Nit] Array handling in filterEntityDefaults preserves nil entries

bundle/configsync/diff.go:72-77 - Filtered arrays produce [nil, nil, nil] instead of nil, inconsistent with the map case that returns nil for empty maps. Low priority.

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.

4 participants