Skip to content

direct: Fix jobs and pipelines RemoteType to be superset of StateType#4443

Merged
denik merged 18 commits intomainfrom
denik/jobs-pipelines-remotetype
Feb 8, 2026
Merged

direct: Fix jobs and pipelines RemoteType to be superset of StateType#4443
denik merged 18 commits intomainfrom
denik/jobs-pipelines-remotetype

Conversation

@denik
Copy link
Contributor

@denik denik commented Feb 4, 2026

Changes

Create JobRemote and PipelineRemote wrapper structs that embed the StateType (JobSettings and CreatePipeline respectively) so that most paths in StateType are valid paths in RemoteType. This ensures JSON plan paths work correctly on both types.

The wrapper structs include:

  • All fields from StateType via embedding
  • Remote-specific fields (job_id, created_time, state, etc.)
  • Custom MarshalJSON/UnmarshalJSON methods to properly serialize embedded struct fields alongside additional fields

Also include special "!drop" reason for id field on pipeline since it overlaps with builtin "id" and it output-only.

Why

See #4442 for explanation

Tests

Additional test for new types that checks that tracks SDK types and will catch a case when new fields are added to SDK that need to be added to custom types.

@denik denik temporarily deployed to test-trigger-is February 4, 2026 16:36 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is February 4, 2026 16:44 — with GitHub Actions Inactive
@eng-dev-ecosystem-bot
Copy link
Collaborator

eng-dev-ecosystem-bot commented Feb 4, 2026

Commit: 2091e1c

Run: 21801381281

Env 🟨​KNOWN 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 7 1 7 451 731 22:26
🟨​ aws windows 7 1 7 417 741 21:17
💚​ aws-ucws linux 12 5 704 584 44:56
🔄​ aws-ucws windows 4 12 5 663 595 46:13
💚​ azure linux 2 9 451 730 24:48
💚​ azure windows 2 9 417 740 19:35
🔄​ azure-ucws linux 3 6 7 663 595 36:12
🔄​ azure-ucws windows 2 5 7 628 606 36:55
💚​ gcp linux 2 9 440 736 21:10
💚​ gcp windows 2 9 406 746 19:51
24 interesting tests: 7 KNOWN, 7 flaky, 5 SKIP, 5 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 🟨​K 🟨​K 💚​R 💚​R 💚​R 💚​R 💚​R 🔄​f 💚​R 💚​R
🙈​ TestAccept/bundle/deployment/bind/alert 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestAccept/bundle/deployment/bind/dashboard/recreation ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p
🔄​ TestAccept/bundle/deployment/bind/dashboard/recreation/DATABRICKS_BUNDLE_ENGINE=terraform ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p
🙈​ TestAccept/bundle/generate/alert 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 💚​R 💚​R 🙈​S 🙈​S 💚​R 💚​R 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/alerts/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/alerts/with_file 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
🔄​ TestAccept/bundle/resources/postgres_projects/recreate 🙈​s 🙈​s ✅​p 🔄​f 🙈​s 🙈​s 🙈​s 🙈​s 🙈​s 🙈​s
🔄​ TestAccept/bundle/resources/postgres_projects/recreate/DATABRICKS_BUNDLE_ENGINE=direct ✅​p 🔄​f
🔄​ TestAccept/bundle/resources/quality_monitors/change_table_name 🙈​s 🙈​s ✅​p ✅​p 🙈​s 🙈​s 🔄​f 🔄​f 🙈​s 🙈​s
💚​ TestAccept/bundle/resources/synced_database_tables/basic 🙈​S 🙈​S 💚​R 💚​R 🙈​S 🙈​S 💚​R 💚​R 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R 💚​R
🔄​ TestAccept/bundle/templates/default-python/integration_classic ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
🔄​ TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_BUNDLE_ENGINE=direct/UV_PYTHON=3.11 ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
💚​ TestAccept/ssh/connection 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 50 slowest tests (at least 2 minutes):
duration env testname
7:52 aws-ucws linux TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
7:52 aws-ucws windows TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
7:44 aws-ucws linux TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
7:18 aws-ucws linux TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
7:18 aws-ucws windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
7:07 aws-ucws linux TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
7:05 aws-ucws windows TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct
6:52 aws-ucws linux TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform
6:41 aws-ucws windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
6:38 aws-ucws linux TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct
6:24 aws-ucws windows TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform
6:22 aws-ucws windows TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
6:15 aws-ucws linux TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
6:14 aws-ucws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:59 aws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:49 aws-ucws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:46 aws-ucws windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
5:45 aws-ucws windows TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
5:43 aws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:41 aws-ucws linux TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
5:34 azure-ucws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:32 aws-ucws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:30 gcp windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:21 aws-ucws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:21 gcp windows TestSecretsPutSecretStringValue
5:20 aws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:15 gcp windows TestAccept/ssh/connection
5:14 azure-ucws windows TestAccept/ssh/connection
5:12 gcp windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:10 gcp linux TestAccept/ssh/connection
5:10 aws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:08 aws linux TestAccept/ssh/connection
5:08 aws windows TestSecretsPutSecretStringValue
5:00 gcp linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
4:59 aws-ucws windows TestAccept/ssh/connection
4:58 aws-ucws linux TestAccept/ssh/connection
4:54 gcp linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
4:41 azure-ucws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
4:41 azure-ucws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
4:33 azure windows TestSecretsPutSecretStringValue
4:30 azure linux TestAccept/ssh/connection
4:27 azure-ucws linux TestAccept/ssh/connection
4:26 aws windows TestAccept/ssh/connection
4:24 azure-ucws windows TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
4:18 azure windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
4:17 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:12 azure linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
4:12 azure windows TestAccept/ssh/connection
4:07 azure-ucws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
4:06 azure windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform

@denik denik temporarily deployed to test-trigger-is February 5, 2026 09:04 — with GitHub Actions Inactive
@denik denik force-pushed the denik/statetype-remote-type branch from 4a33554 to e750721 Compare February 5, 2026 09:09
Base automatically changed from denik/statetype-remote-type to main February 5, 2026 09:37
@denik denik force-pushed the denik/jobs-pipelines-remotetype branch from 7212650 to 60b8dbb Compare February 5, 2026 09:46
@denik denik temporarily deployed to test-trigger-is February 5, 2026 09:47 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is February 5, 2026 10:28 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is February 5, 2026 10:37 — with GitHub Actions Inactive
@denik denik marked this pull request as ready for review February 5, 2026 10:37
@denik denik temporarily deployed to test-trigger-is February 5, 2026 10:44 — with GitHub Actions Inactive
@denik denik force-pushed the denik/jobs-pipelines-remotetype branch from 2df42b4 to ca1a7e5 Compare February 5, 2026 16:02
denik and others added 8 commits February 5, 2026 17:03
Create JobRemote and PipelineRemote wrapper structs that embed the
StateType (JobSettings and CreatePipeline respectively) so that all
paths in StateType are valid paths in RemoteType. This ensures JSON
plan paths work correctly on both types.

The wrapper structs include:
- All fields from StateType via embedding
- Remote-specific fields (job_id, created_time, state, etc.)
- Custom MarshalJSON/UnmarshalJSON methods to properly serialize
  embedded struct fields alongside additional fields

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@denik denik force-pushed the denik/jobs-pipelines-remotetype branch from ca1a7e5 to c85e127 Compare February 5, 2026 16:03
@denik denik temporarily deployed to test-trigger-is February 5, 2026 16:04 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is February 5, 2026 16:35 — with GitHub Actions Inactive
"myjob_id": "[NUMID]",
"myjob_name": "Test Migration Job",
"myjob_timeout": "",
"myjob_timeout": "0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Intentional?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see this wasn't resolved before, but now it is.

"action": "update",
"old": "0",
"new": "${resources.jobs.test_job.timeout_seconds}",
"remote": "0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this downgrade during deploy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't do any downgrades (yet).

"storage": "dbfs:/pipelines/[FOO_ID]"
},
"changes": {
"id": {
Copy link
Contributor

Choose a reason for hiding this comment

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

It's weird to see this both special cased and part of the response payload.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. I'd get rid of this field but it comes from embedded CreatePipeline.

We can instruct framework to drop this change from change list. We can have special reason in the config, e.g. "!drop" which causes change to disappear. Might impede debugging though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

EffectiveUsagePolicyId string `json:"effective_usage_policy_id,omitempty"`
JobId int64 `json:"job_id,omitempty"`
RunAsUserName string `json:"run_as_user_name,omitempty"`
TriggerState *jobs.TriggerStateProto `json:"trigger_state,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

How can we ensure this remains up to date?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could write a custom test that uses reflection to check that JobRemote & jobs.Job fields match.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@denik denik temporarily deployed to test-trigger-is February 6, 2026 13:27 — with GitHub Actions Inactive
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@denik denik requested a review from pietern February 6, 2026 15:28
@denik denik temporarily deployed to test-trigger-is February 6, 2026 15:28 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is February 6, 2026 15:39 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is February 6, 2026 15:43 — with GitHub Actions Inactive
@denik denik enabled auto-merge February 6, 2026 15:53
@denik denik temporarily deployed to test-trigger-is February 6, 2026 15:54 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is February 6, 2026 16:20 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is February 6, 2026 16:49 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is February 8, 2026 16:21 — with GitHub Actions Inactive
@denik denik added this pull request to the merge queue Feb 8, 2026
Merged via the queue into main with commit a93fc07 Feb 8, 2026
18 checks passed
@denik denik deleted the denik/jobs-pipelines-remotetype branch February 8, 2026 17:21
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