Skip to content

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

Open
denik wants to merge 17 commits intomainfrom
denik/jobs-pipelines-remotetype
Open

direct: Fix jobs and pipelines RemoteType to be superset of StateType#4443
denik wants to merge 17 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: 17aa0f1

Run: 21758545810

Env 🟨​KNOWN 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 7 1 7 451 731 25:43
🟨​ aws windows 7 1 7 417 741 24:48
🔄​ aws-ucws linux 3 11 5 702 584 52:51
💚​ aws-ucws windows 12 5 667 595 51:51
💚​ azure linux 2 9 451 730 25:20
💚​ azure windows 2 9 417 740 22:18
💚​ azure-ucws linux 6 7 666 595 47:22
💚​ azure-ucws windows 6 7 629 606 46:07
💚​ gcp linux 2 9 440 736 23:23
💚​ gcp windows 2 9 406 746 22:12
19 interesting tests: 7 KNOWN, 5 SKIP, 5 RECOVERED, 2 flaky
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 🔄​f 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/deployment/bind/alert 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ 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_endpoints/basic 🙈​s 🙈​s 🔄​f ✅​p 🙈​s 🙈​s 🙈​s 🙈​s 🙈​s 🙈​s
🔄​ TestAccept/bundle/resources/postgres_endpoints/basic/DATABRICKS_BUNDLE_ENGINE=terraform 🔄​f ✅​p
💚​ 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/ssh/connection 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 50 slowest tests (at least 2 minutes):
duration env testname
8:21 aws-ucws linux TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
7:37 aws-ucws linux TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
7:29 aws-ucws windows TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct
7:19 aws-ucws windows TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
7:19 aws-ucws windows TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
7:02 aws-ucws windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
7:01 aws-ucws linux TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
7:00 aws-ucws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
6:57 aws-ucws linux TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
6:54 aws-ucws windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
6:54 aws-ucws windows TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
6:47 aws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
6:31 aws-ucws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
6:30 aws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
6:26 gcp windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
6:22 azure-ucws windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
6:16 azure-ucws linux TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
6:15 aws-ucws windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
6:10 aws-ucws linux TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
5:54 azure linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:50 aws-ucws linux TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct
5:40 aws-ucws windows TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform
5:39 azure linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:38 aws-ucws linux TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform
5:34 azure-ucws linux TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
5:34 aws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:28 gcp windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:16 aws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:16 gcp linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:14 aws-ucws linux TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
5:09 gcp linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:01 azure-ucws windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
4:37 azure-ucws windows TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform
4:33 azure-ucws linux TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
4:20 azure-ucws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
4:11 azure-ucws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
4:07 azure-ucws windows TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct
3:52 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:40 azure-ucws linux TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
3:37 azure-ucws linux TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
3:34 azure-ucws windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
3:33 azure-ucws windows TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
3:32 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:22 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:21 azure-ucws windows TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
3:17 gcp linux 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:12 azure-ucws windows TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
3:10 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:05 azure-ucws linux TestAccept/bundle/resources/synced_database_tables/basic/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
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