Repository navigation
[DECO-28500] Fix config-remote-sync writing run_as: {} on a principal kind switch - #7493
Merged
Merged
Conversation
Contributor
|
Commit: Regression test reportSelected 2 changed tests (limit=20, 0 not selected) 4 tests: regression=4 unreleased=0 coverage=0 failing=0
TestAccept/bundle/config-remote-sync/job_run_as/DMS=: branch ✅ | main (46546d1) ❌ | latest (v1.26.0) ❌main (46546d1): latest (v1.26.0): same output as main (46546d1) TestAccept/bundle/config-remote-sync/job_run_as/DMS=true: branch ✅ | main (46546d1) ❌ | latest (v1.26.0) ❌main (46546d1): latest (v1.26.0): same output as main (46546d1) TestAccept/bundle/config-remote-sync/job_run_as_sources/DMS=: branch ✅ | main (46546d1) ❌ | latest (v1.26.0) ❌main (46546d1): latest (v1.26.0): same output as main (46546d1) TestAccept/bundle/config-remote-sync/job_run_as_sources/DMS=true: branch ✅ | main (46546d1) ❌ | latest (v1.26.0) ❌main (46546d1): latest (v1.26.0): same output as main (46546d1) |
Collaborator
✅ Integration test reportCommit: 4e889ab
Top 4 slowest tests (at least 2 minutes):
|
petrapostelnicu-db
force-pushed
the
deco-28500-run-as-kind-switch
branch
from
November 12, 2026 15:30
30d51c4 to
c2002f7
Compare
petrapostelnicu-db
marked this pull request as ready for review
November 12, 2026 15:31
ilyakuz-db
approved these changes
Nov 12, 2026
petrapostelnicu-db
force-pushed
the
deco-28500-run-as-kind-switch
branch
2 times, most recently
from
November 13, 2026 12:09
8fc936c to
ecaf0b7
Compare
The plan skips a job's run_as keys that the config lacks as backend
defaults. When the remote switches principal kind, the new key is the
edit itself, so config-remote-sync removed the old key and dropped the
new one, leaving run_as: {}. Let skipped run_as keys through.
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
config-remote-sync is a hidden command used only by DABs in the workspace; changes to it do not get release notes. Co-authored-by: Isaac <no-reply@databricks.com>
petrapostelnicu-db
force-pushed
the
deco-28500-run-as-kind-switch
branch
from
November 13, 2026 12:17
043bb5d to
4e889ab
Compare
Collaborator
❌ Integration test reportCommit: e3aeacc
61 interesting tests: 37 FAIL, 13 flaky, 11 RECOVERED
Top 50 slowest tests (at least 2 minutes):
|
idelafuente-oc
pushed a commit
to idelafuente-oc/cli
that referenced
this pull request
Nov 16, 2026
…ion (databricks#7645) ## Changes - `config-remote-sync` now applies the direct engine's lifecycle metadata to every change, whatever action the plan gave it (`bundle/configsync/lifecycle.go`). A remote value is never written back when it falls under `ignore_remote_changes` (output-only, input-only, backend-managed), or when it's a backend default the config doesn't set. - When the plan reports a whole object (one side is nil), those fields are left out of it, and the change is skipped if nothing else differs. Inside a remote-only object, only backend defaults pinned to allowed values are dropped. A field like `node_type_id` in a task added in the UI may be the user's pick, so it's kept. - Job `run_as` keys are still synced, so a principal kind switch keeps working (databricks#7493). - Moved the backend-default matcher from `bundle/direct` to `dresources.ResourceLifecycleConfig.IsBackendDefault` so the plan and config sync share it. The plan's behavior doesn't change. ## Why Config sync only dropped changes the plan marked as skipped. Metadata-covered fields still reached the YAML whenever the plan reported an update, or reported the object that contains them: - A genie space's `etag` is `output_only`, but `OverrideChangeDesc` promotes etag drift to an update for deploy, so the etag ended up in the YAML. - Input-only fields are never returned by GET, so sync removed them when the config had an undeployed edit (a job's `trigger.table_update.condition`), or when the whole object was missing remotely (a serving endpoint's `telemetry_config.table_names`). - Output-only and backend-managed fields inside an object added in the UI were written as-is (for example `aws_attributes` under a for-each task's cluster). - Backend defaults were added back: a job's `format` once the config dropped it, or `spark.sql.ansi.enabled` inside a pipeline `configuration` map added remotely. ## Tests - New unit test in `diff_test.go` covering each case above, plus the `run_as` switch and a backend default with a non-default value. It fails without the fix. - `go test ./bundle/...`, the `config-remote-sync` acceptance tests and golangci-lint pass locally. This pull request and its description were written by Isaac. --------- Co-authored-by: Isaac <no-reply@databricks.com>
idelafuente-oc
pushed a commit
to idelafuente-oc/cli
that referenced
this pull request
Nov 20, 2026
…set (databricks#7494) ## Changes - `config-remote-sync` now writes a remote job `run_as` into a config that doesn't set one, unless it names the job's owner (`skipJobRunAs` in `bundle/configsync/runas.go`). It replaces the blanket `resources.jobs.*.run_as` skip. - The owner is the principal a job without `run_as` runs as, per the Jobs API (`run_as_user_name`): the `IS_OWNER` entry of the job's ACL, or `creator_user_name` when job access control is off. The ACL comes from: - the plan, for declared permissions; - the unmanaged-permissions read from databricks#7536, which now returns the raw ACL (the current user's `IS_OWNER`/`CAN_MANAGE` is still dropped before permissions are written); - a direct read, for declared permissions that were never deployed. - The whole-object `run_as` change is still skipped when: - the config sets `run_as` (the plan reports the edit key by key); - the remote has no `run_as`; - the owner is unknown because the ACL can't be read. - `applyLifecycle` no longer drops a job's whole `run_as` as a backend default; `skipJobRunAs` decides it. ## Why - A run-as change in the Jobs UI never reached a YAML without `run_as`, which is most bundles. - The Jobs UI always shows a principal (the owner when `run_as` is unset) and only saves a different one, so the owner check doesn't drop UI edits. - Jobs deployed with terraform carry `run_as` set to the owner ([provider code](https://github.com/databricks/terraform-provider-databricks/blob/76f95e4/jobs/resource_job.go#L844-L857)), so they are skipped. - A `run_as` removed from the config and deployed is written back: `jobs/reset` without `run_as` keeps the previous value, so the job still runs as that principal. - This replaces the `--sync-run-as-ids` flag from an earlier revision, so the caller needs no new flag. ## Tests - `config-remote-sync/job_run_as`: - remote `run_as` on a job without one → synced; - remote `run_as` naming the owner → not synced, both with the creator as owner and after an ownership transfer; - `run_as` removed from config and deployed → written back; - `run_as` added locally, not deployed, then changed remotely → one key-level change; - the kind-switch cases from databricks#7493 are unchanged; - a second sync is a no-op. - `config-remote-sync/terraform_state`: a terraform-pinned `run_as` naming the owner isn't reported. - Unit tests for `skipJobRunAs` and `jobOwners`. This pull request and its description were written by Isaac. --------- Co-authored-by: Isaac <no-reply@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
run_askeys that the plan skipped as backend defaults through to config-remote-sync (bundle/configsync/runas.go).Why
config-remote-syncafter a run-as change.run_askind (e.g.user_name→service_principal_name) removed the old key but dropped the new one: the plan marks arun_askey the config lacks as a backend default. The YAML ended up withrun_as: {}, and the next sync and plan reported no changes.run_as.Tests
config-remote-sync/job_run_as: user → user, user → creator, user → service principal.config-remote-sync/job_run_as_sources: bundle-levelrun_as, unchanged inherited job,${var}reference, target override, group.keepSkippedRunAsChange.This pull request and its description were written by Isaac.