Skip to content

[DECO-28500] Sync a remote run_as on jobs whose config leaves it unset - #7494

Open
petrapostelnicu-db wants to merge 3 commits into
mainfrom
deco-28500-run-as-unset-config
Open

petrapostelnicu-db wants to merge 3 commits into
mainfrom
deco-28500-run-as-unset-config

Conversation

@petrapostelnicu-db

Copy link
Copy Markdown
Contributor

Stacked on #7493.

Changes

  • Remove the blanket resources.jobs.*.run_as skip from config-remote-sync.
  • Sync the remote run_as of a job whose config has none, unless:
    • the remote has no run_as (not synced before either);
    • it is unchanged since the last deploy;
    • it names the job's creator.

Why

  • A run-as change in the Jobs UI never reached a YAML without run_as, which is most bundles.
  • The skip filtered out terraform noise: the provider sends the job's identity back as an explicit run_as on every update (provider code), and the server keeps it across later resets. Jobs deployed before the switch to the direct engine still carry it.
  • The creator check keeps filtering that out. Known gap: after an ownership transfer the pinned value names the new owner and would be synced.

Tests

  • config-remote-sync/job_run_as: no run_as + service principal (synced), no run_as + creator (skipped).
  • config-remote-sync/terraform_state: a creator-pinned run_as after migration is not reported.
  • Unit tests for skipJobRunAs.

This pull request and its description were written by Isaac.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Commit: 9d7317e25 | Workflow run

Regression test report

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

3 tests: regression=2 unreleased=0 coverage=1 failing=0
test branch main (e3aeacc) latest (v1.26.0)
TestAccept/bundle/config-remote-sync/job_run_as/DMS= ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/job_run_as/DMS=true ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/terraform_state/DMS= ✅ ✅ ✅
TestAccept/bundle/config-remote-sync/job_run_as/DMS=: branch ✅ | main (e3aeacc) ❌ | latest (v1.26.0) ❌

main (e3aeacc):

acceptance_test.go:1374: Diff:
        --- bundle/config-remote-sync/job_run_as/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-syncjob_run_asDMS=2042642809/002/output.txt
        @@ -14,11 +14,8 @@
         === Detect and save changes
         
         >>> [CLI] bundle config-remote-sync --save
        -Detected changes in 4 resource(s):
        +Detected changes in 3 resource(s):
         
        -Resource: resources.jobs.no_run_as
        -  run_as: add
        -
         Resource: resources.jobs.user_to_creator
           run_as.user_name: replace
         
        @@ -34,28 +30,21 @@
         >>> diff.py databricks.yml.backup databricks.yml
         --- databricks.yml.backup
         +++ databricks.yml
        -@@ -12,4 +12,6 @@
        -             notebook_path: /Users/{{workspace_user_name}}/notebook
        -
        -+      run_as:
        -+        service_principal_name: [UUID]
        -     # The terraform provider pins run_as to the job's identity on every update,
        -     # so a remote run_as that names the creator is a default, not an edit.
        -@@ -24,5 +26,5 @@
        +@@ -24,5 +24,5 @@
                name: user-to-user-[UNIQUE_NAME]
                run_as:
         -        user_name: first-user@example.com
         +        user_name: second-user@example.com
                tasks:
                  - task_key: main
        -@@ -34,5 +36,5 @@
        +@@ -34,5 +34,5 @@
                name: user-to-creator-[UNIQUE_NAME]
                run_as:
         -        user_name: first-user@example.com
         +        user_name: [USERNAME]
                tasks:
                  - task_key: main
        -@@ -43,5 +45,5 @@
        +@@ -43,5 +43,5 @@
                name: user-to-sp-[UNIQUE_NAME]
                run_as:
         -        user_name: first-user@example.com

latest (v1.26.0):

acceptance_test.go:1374: Diff:
        --- bundle/config-remote-sync/job_run_as/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-syncjob_run_asDMS=4289315299/002/output.txt
        @@ -14,16 +14,12 @@
         === Detect and save changes
         
         >>> [CLI] bundle config-remote-sync --save
        -Detected changes in 4 resource(s):
        +Detected changes in 3 resource(s):
         
        -Resource: resources.jobs.no_run_as
        -  run_as: add
        -
         Resource: resources.jobs.user_to_creator
           run_as.user_name: replace
         
         Resource: resources.jobs.user_to_sp
        -  run_as.service_principal_name: add
           run_as.user_name: remove
         
         Resource: resources.jobs.user_to_user
        @@ -34,32 +25,26 @@
         >>> diff.py databricks.yml.backup databricks.yml
         --- databricks.yml.backup
         +++ databricks.yml
        -@@ -12,4 +12,6 @@
        -             notebook_path: /Users/{{workspace_user_name}}/notebook
        -
        -+      run_as:
        -+        service_principal_name: [UUID]
        -     # The terraform provider pins run_as to the job's identity on every update,
        -     # so a remote run_as that names the creator is a default, not an edit.
        -@@ -24,5 +26,5 @@
        +@@ -24,5 +24,5 @@
                name: user-to-user-[UNIQUE_NAME]
                run_as:
         -        user_name: first-user@example.com
         +        user_name: second-user@example.com
                tasks:
                  - task_key: main
        -@@ -34,5 +36,5 @@
        +@@ -34,5 +34,5 @@
                name: user-to-creator-[UNIQUE_NAME]
                run_as:
         -        user_name: first-user@example.com
         +        user_name: [USERNAME]
                tasks:
                  - task_key: main
        -@@ -43,5 +45,5 @@
        +@@ -42,6 +42,5 @@
        +     user_to_sp:
                name: user-to-sp-[UNIQUE_NAME]
        -       run_as:
        +-      run_as:
         -        user_name: first-user@example.com
        -+        service_principal_name: [UUID]
        ++      run_as: {}
                tasks:
                  - task_key: main
TestAccept/bundle/config-remote-sync/job_run_as/DMS=true: branch ✅ | main (e3aeacc) ❌ | latest (v1.26.0) ❌

main (e3aeacc):

acceptance_test.go:1374: Diff:
        --- bundle/config-remote-sync/job_run_as/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-syncjob_run_asDMS=true2031169242/002/output.txt
        @@ -14,11 +14,8 @@
         === Detect and save changes
         
         >>> [CLI] bundle config-remote-sync --save
        -Detected changes in 4 resource(s):
        +Detected changes in 3 resource(s):
         
        -Resource: resources.jobs.no_run_as
        -  run_as: add
        -
         Resource: resources.jobs.user_to_creator
           run_as.user_name: replace
         
        @@ -34,28 +30,21 @@
         >>> diff.py databricks.yml.backup databricks.yml
         --- databricks.yml.backup
         +++ databricks.yml
        -@@ -12,4 +12,6 @@
        -             notebook_path: /Users/{{workspace_user_name}}/notebook
        -
        -+      run_as:
        -+        service_principal_name: [UUID]
        -     # The terraform provider pins run_as to the job's identity on every update,
        -     # so a remote run_as that names the creator is a default, not an edit.
        -@@ -24,5 +26,5 @@
        +@@ -24,5 +24,5 @@
                name: user-to-user-[UNIQUE_NAME]
                run_as:
         -        user_name: first-user@example.com
         +        user_name: second-user@example.com
                tasks:
                  - task_key: main
        -@@ -34,5 +36,5 @@
        +@@ -34,5 +34,5 @@
                name: user-to-creator-[UNIQUE_NAME]
                run_as:
         -        user_name: first-user@example.com
         +        user_name: [USERNAME]
                tasks:
                  - task_key: main
        -@@ -43,5 +45,5 @@
        +@@ -43,5 +43,5 @@
                name: user-to-sp-[UNIQUE_NAME]
                run_as:
         -        user_name: first-user@example.com
        
FAIL

latest (v1.26.0):

acceptance_test.go:1374: Diff:
        --- bundle/config-remote-sync/job_run_as/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-syncjob_run_asDMS=true2932452177/002/output.txt
        @@ -14,16 +14,12 @@
         === Detect and save changes
         
         >>> [CLI] bundle config-remote-sync --save
        -Detected changes in 4 resource(s):
        +Detected changes in 3 resource(s):
         
        -Resource: resources.jobs.no_run_as
        -  run_as: add
        -
         Resource: resources.jobs.user_to_creator
           run_as.user_name: replace
         
         Resource: resources.jobs.user_to_sp
        -  run_as.service_principal_name: add
           run_as.user_name: remove
         
         Resource: resources.jobs.user_to_user
        @@ -34,32 +25,26 @@
         >>> diff.py databricks.yml.backup databricks.yml
         --- databricks.yml.backup
         +++ databricks.yml
        -@@ -12,4 +12,6 @@
        -             notebook_path: /Users/{{workspace_user_name}}/notebook
        -
        -+      run_as:
        -+        service_principal_name: [UUID]
        -     # The terraform provider pins run_as to the job's identity on every update,
        -     # so a remote run_as that names the creator is a default, not an edit.
        -@@ -24,5 +26,5 @@
        +@@ -24,5 +24,5 @@
                name: user-to-user-[UNIQUE_NAME]
                run_as:
         -        user_name: first-user@example.com
         +        user_name: second-user@example.com
                tasks:
                  - task_key: main
        -@@ -34,5 +36,5 @@
        +@@ -34,5 +34,5 @@
                name: user-to-creator-[UNIQUE_NAME]
                run_as:
         -        user_name: first-user@example.com
         +        user_name: [USERNAME]
                tasks:
                  - task_key: main
        -@@ -43,5 +45,5 @@
        +@@ -42,6 +42,5 @@
        +     user_to_sp:
                name: user-to-sp-[UNIQUE_NAME]
        -       run_as:
        +-      run_as:
         -        user_name: first-user@example.com
        -+        service_principal_name: [UUID]
        ++      run_as: {}
                tasks:
                  - task_key: main
         
        
FAIL

@eng-dev-ecosystem-bot

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

Copy link
Copy Markdown
Collaborator

❌ Integration test report

Commit: 9d7317e

Run: 43742388761

Env ❌​FAIL 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 270 17 3:47
💚​ aws-windows-latest-4core-16gb 1 272 15 3:30
💚​ azure linux-2core-8gb 1 269 17 3:43
❌​ azure-windows-latest-4core-16gb 47 1 224 15 12:31
💚​ gcp linux-2core-8gb 1 270 17 3:42
💚​ gcp-windows-latest-4core-16gb 1 272 15 3:05
48 interesting tests: 47 FAIL, 1 RECOVERED
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
❌​ TestSetupLocalUnpublishedVersion ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsCat ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsCat/uc-volumes ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsCpErrorsWhenSourceIsDirWithoutRecursiveFlag ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsCpErrorsWhenSourceIsDirWithoutRecursiveFlag/dbfs ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsCpSourceIsDirectoryButTargetIsFile ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsCpSourceIsDirectoryButTargetIsFile/uc-volumes_to_uc-volumes ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsLs ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsLs/dbfs ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsLs/uc-volumes ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsLsForNonexistingDir ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsLsForNonexistingDir/dbfs ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsLsForNonexistingDir/uc-volumes ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsLsOnEmptyDir ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsLsOnEmptyDir/dbfs ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsLsOnEmptyDir/uc-volumes ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsLsOnFile ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsLsOnFile/dbfs ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsLsOnFile/uc-volumes ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsLsWithAbsolutePaths ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsLsWithAbsolutePaths/dbfs ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsLsWithAbsolutePaths/uc-volumes ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsMkdir ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsMkdir/dbfs ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsMkdir/uc-volumes ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsMkdirCreatesIntermediateDirectories ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsMkdirCreatesIntermediateDirectories/dbfs ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsMkdirCreatesIntermediateDirectories/uc-volumes ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsMkdirWhenDirectoryAlreadyExists ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsMkdirWhenDirectoryAlreadyExists/dbfs ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsMkdirWhenDirectoryAlreadyExists/uc-volumes ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsMkdirWhenFileExistsAtPath ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsMkdirWhenFileExistsAtPath/dbfs ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsMkdirWhenFileExistsAtPath/uc-volumes ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsRmDirRecursively ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsRmDirRecursively/dbfs ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsRmDirRecursively/uc-volumes ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsRmEmptyDir ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsRmEmptyDir/dbfs ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsRmEmptyDir/uc-volumes ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsRmFile ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsRmFile/dbfs ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsRmFile/uc-volumes ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsRmForNonExistentFile ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsRmForNonExistentFile/uc-volumes ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsRmNonEmptyDirectory ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestFsRmNonEmptyDirectory/uc-volumes ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:25 aws-windows-latest-4core-16gb TestAccept
3:00 gcp-windows-latest-4core-16gb TestAccept
2:41 azure-windows-latest-4core-16gb TestAccept

@petrapostelnicu-db
petrapostelnicu-db force-pushed the deco-28500-run-as-unset-config branch from c83ff1d to cc6cc1c Compare November 12, 2026 15:30
@petrapostelnicu-db
petrapostelnicu-db marked this pull request as ready for review November 12, 2026 15:31
@petrapostelnicu-db
petrapostelnicu-db requested review from a team as code owners November 12, 2026 15:31
@github-actions github-actions Bot added the DABs DABs related issues label Nov 12, 2026
@petrapostelnicu-db
petrapostelnicu-db force-pushed the deco-28500-run-as-unset-config branch 3 times, most recently from f712989 to 759b252 Compare November 13, 2026 12:17

@Sankalp-Mittal Sankalp-Mittal 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.

🤖 AI review from review-factory: 3 independent reviewer models (Claude Opus 5.5, Claude Fable 5.2, Claude Sonnet 5.5) with cross-verification. Only findings that reviewers agreed on are posted.

Syncs a remote job run_as into configs lacking one; reviewers confirmed a removed-and-redeployed run_as is written back, plus a redundant whole-object replace.

Findings: 1 major, 1 minor.

return true
}
// The config has no run_as. Skip one unchanged since the last deploy.
if structdiff.IsEqual(cd.Old, cd.Remote) {

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.

major: A run_as removed from config and deployed is written back to YAML by the next sync

The structdiff.IsEqual(cd.Old, cd.Remote) check at runas.go:41 is meant to skip a remote run_as that is unchanged since the last deploy. But cd.Old is the saved state, and the direct engine saves the config-derived state (saveState in bundle/direct/apply.go), not what the server holds. The check can therefore only match while the saved state still has a run_as that the config no longer has. That is a local removal that has not been deployed yet.

The Jobs API keeps the previous run_as when jobs/reset omits it. acceptance/bundle/run_as/job_default (Cloud = true) records this as Badness ("run_as is still set even though it's not in bundle and not in reset request"), and libs/testserver/jobs.go:211-218 mirrors it.

Scenario: deploy a job with run_as: {user_name: U}, where U is not the deployer (or a job that inherits a bundle-level run_as). Delete run_as from the YAML and deploy. The saved state now has no run_as, but the remote still has U. On the next bundle config-remote-sync:

  • the plan entry at run_as is Old=nil, New=nil, Remote=U, classified backend_default (bundle/direct/bundle_plan.go shouldSkipBackendDefault; bundle plan reports the job unchanged);
  • keepSkippedRunAsChange now keeps the whole-object path;
  • IsEqual(nil, U) is false, and isCreatorRunAs is false unless U is the job's creator.

The result is run_as: add, and --save writes back the run_as the user just removed. This repeats on every run, because nothing in state records U. Removing a bundle-level run_as (often a service principal that is not the deployer) hits every job that inherited it. Before this PR, the resources.jobs.*.run_as: alwaysSkip entry in defaults.go stopped this.

The PR description lists only ownership transfer as a known gap, and says a run_as unchanged since the last deploy is not synced. Neither the unit tests nor the acceptance tests cover the Old == Remote branch end to end. The terraform_state case reaches the creator check instead, because migrated state is built from the config and has no run_as.

Please decide whether writing the identity back is intended, since the remote job really does run as that principal. Then either filter this case, or document it as a known limitation next to the ownership-transfer gap. Either way, add an acceptance case to config-remote-sync/job_run_as: deploy with run_as, remove it from the YAML, deploy again, then run sync. The fake server already reproduces the cloud behavior.

Agreed by 3 reviewer model(s).

// skipJobRunAs reports whether a change to the run_as object as a whole must
// not be synced. The plan diffs a run_as set on both sides key by key, so a
// change to the whole object means one side has none.
func skipJobRunAs(path string, cd *deployplan.ChangeDesc, remoteState any) bool {

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.

minor: skipJobRunAs never checks cd.New, so a config that already has run_as gets a redundant whole-object replace

The comments at runas.go:28-30 and :40 assume a whole-object run_as change means the config has none, but skipJobRunAs never checks cd.New. The plan also records a whole-object change at run_as when the saved state has no run_as and the config now has one. That happens when run_as was added locally (or inherited from a new bundle-level run_as) and not yet deployed. In that case the local diff gives Old=nil, New=<config value>, Remote=<remote value>. If the remote also has a run_as that differs, the remote diff runs key by key (run_as.user_name and so on), so the parent entry stays as an Update.

Before this PR the alwaysSkip entry for resources.jobs.*.run_as in defaults.go dropped this parent entry. Now, when the remote principal is not the creator, skipJobRunAs returns false. convertChangeDesc (diff.go:94) then emits run_as: replace with the whole remote object, next to the existing per-key run_as.<key> changes.

The PR's own flow can reach this: a sync adds run_as to the YAML, nothing is deployed, the run-as is changed again in the Jobs UI, and sync runs again. The final YAML is the same, because ResolveChanges applies deeper paths first (resolve.go:226-246). The cost is a duplicated change in the command output and telemetry, and a whole-node rewrite of the run_as block.

Suggested fix: return true from skipJobRunAs when cd.New != nil, since the per-key entries carry the change. Add a unit case to TestSkipJobRunAs with New and Remote both set (no current row has both).

Agreed by 3 reviewer model(s).

Base automatically changed from deco-28500-run-as-kind-switch to main November 15, 2026 17:38
petrapostelnicu-db and others added 3 commits November 15, 2026 17:38
config-remote-sync skipped a job's run_as entirely, so a run-as change
made in the Jobs UI never reached a config without run_as. Replace the
blanket skip with a rule for the whole run_as object: sync it unless the
remote has none, it is unchanged since the last deploy, or it names the
job's creator. Jobs updated by the terraform engine carry an explicit
run_as set to the job's identity, which the creator check filters out.

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
petrapostelnicu-db force-pushed the deco-28500-run-as-unset-config branch from 759b252 to 9d7317e Compare November 15, 2026 17:38

@Sankalp-Mittal Sankalp-Mittal 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.

🤖 AI review (Claude Fable 5.2 + Claude Opus 5.5, cross-verified). Only points the reviewers agreed on are posted.

return true
}
// The config has no run_as. Skip one unchanged since the last deploy.
if structdiff.IsEqual(cd.Old, cd.Remote) {

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.

Major: After run_as is removed from YAML and deployed, the job keeps it remotely and state has none, so every sync re-adds it. Intended? Either way, please add a job_run_as acceptance case.

// skipJobRunAs reports whether a change to the run_as object as a whole must
// not be synced. The plan diffs a run_as set on both sides key by key, so a
// change to the whole object means one side has none.
func skipJobRunAs(path string, cd *deployplan.ChangeDesc, remoteState any) bool {

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.

With run_as in config but not in state and a non-creator remote, this emits run_as: replace beside the per-key changes. Can it return true when cd.New != nil?

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.

3 participants