Skip to content

acc: add empty-grants invariant config, disable failing migrate variant - #6055

Merged
radakam merged 1 commit into
mainfrom
radakam/invariant-empty-grants
Jul 24, 2026
Merged

acc: add empty-grants invariant config, disable failing migrate variant#6055
radakam merged 1 commit into
mainfrom
radakam/invariant-empty-grants

Conversation

@radakam

@radakamradakam commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Adds a schema_empty_grants acceptance invariant (a schema with grants: []), found by fuzz testing. Because Terraform records no grants resource for an empty list, the direct engine's post-migrate plan shows a spurious grants -> create, so that one migrate variant is disabled in migrate/test.toml (with the full error in a comment) while the other invariants keep running.

Adds a schema_empty_grants invariant config (schema with grants: [])
found by fuzz testing. The migrate variant fails because Terraform records
no grants resource for an empty list, so the direct plan shows a spurious
grants -> create after migrate. That variant is disabled in migrate/test.toml
with a comment containing the full error; the other invariants pass and keep
running it.
@radakam
radakam marked this pull request as ready for review July 24, 2026 07:40
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 51dbbc1

Run: 30075477166

Env💚​RECOVERED🙈​SKIP✅​pass🙈​skipTime
💚​aws linux4432210594:30
💚​aws windows4432410574:44
💚​azure linux4432210584:42
💚​azure windows4432410566:35
💚​gcp linux1532110604:22
💚​gcp windows1532310584:29
8 interesting tests: 4 RECOVERED, 4 SKIP
Test Nameaws linuxaws windowsazure linuxazure windowsgcp linuxgcp windows
💚​TestAccept💚​R💚​R💚​R💚​R💚​R💚​R
🙈​TestAccept/bundle/invariant/no_drift🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/ssh/connection🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
💚​TestFetchRepositoryInfoAPI_FromRepo💚​R💚​R💚​R💚​R🙈​S🙈​S
💚​TestFetchRepositoryInfoAPI_FromRepo/root💚​R💚​R💚​R💚​R
💚​TestFetchRepositoryInfoAPI_FromRepo/subdir💚​R💚​R💚​R💚​R
Top 3 slowest tests (at least 2 minutes):
durationenvtestname
4:32azure windowsTestAccept
3:37aws windowsTestAccept
3:30gcp windowsTestAccept

@radakam
radakam added this pull request to the merge queueJul 24, 2026
Merged via the queue into main with commit e5a3bb4Jul 24, 2026
27 checks passed
@radakam
radakam deleted the radakam/invariant-empty-grants branch July 24, 2026 08:02
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: e5a3bb4

Run: 30077539701

Env❌​FAIL🟨​KNOWN🔄​flaky💚​RECOVERED🙈​SKIP✅​pass🙈​skipTime
🔄​aws linux6621143879278:02
❌​aws windows61521082898349:30
🔄​azure linux6621038915203:47
❌​azure windows211052971934311:30
🔄​gcp linux6331026921239:08
🔄​gcp windows433967940298:33
46 interesting tests: 30 flaky, 8 FAIL, 5 RECOVERED, 2 SKIP, 1 KNOWN
Test Nameaws linuxaws windowsazure linuxazure windowsgcp linuxgcp windows
🟨​TestAccept💚​R🟨​K💚​R🟨​K💚​R💚​R
🔄​TestAccept/bundle/config-remote-sync/job_fields🔄​f🙈​s✅​p🙈​s✅​p🙈​s
🔄​TestAccept/bundle/config-remote-sync/job_fields/DATABRICKS_BUNDLE_ENGINE=direct🔄​f✅​p✅​p
🔄​TestAccept/bundle/config-remote-sync/resolve_variables✅​p🙈​s🔄​f🙈​s✅​p🙈​s
🔄​TestAccept/bundle/config-remote-sync/resolve_variables/DATABRICKS_BUNDLE_ENGINE=terraform✅​p🔄​f✅​p
🔄​TestAccept/bundle/deploy/snapshot-comparison✅​p✅​p🔄​f✅​p✅​p✅​p
🔄​TestAccept/bundle/deploy/snapshot-comparison/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p🔄​f✅​p✅​p✅​p
🔄​TestAccept/bundle/deployment/bind/pipelines/recreate🔄​f✅​p✅​p✅​p✅​p✅​p
🔄​TestAccept/bundle/deployment/bind/pipelines/recreate/DATABRICKS_BUNDLE_ENGINE=direct🔄​f✅​p✅​p✅​p✅​p✅​p
❌​TestAccept/bundle/invariant/delete_idempotent✅​p❌​F✅​p✅​p✅​p✅​p
❌​TestAccept/bundle/invariant/delete_idempotent/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=model_serving_endpoint.yml.tmpl/READPLAN=1✅​p❌​F✅​p✅​p✅​p✅​p
💚​TestAccept/bundle/invariant/no_drift💚​R💚​R💚​R💚​R💚​R💚​R
❌​TestAccept/bundle/resources/clusters/deploy/update-after-create✅​p❌​F✅​p✅​p✅​p✅​p
❌​TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform✅​p❌​F✅​p✅​p✅​p✅​p
🔄​TestAccept/bundle/resources/clusters/lifecycle-started-toggle✅​p✅​p✅​p✅​p🔄​f✅​p
🔄​TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct✅​p✅​p✅​p✅​p🔄​f✅​p
❌​TestAccept/bundle/resources/dashboards/change-name✅​p❌​F✅​p🔄​f✅​p✅​p
🔄​TestAccept/bundle/resources/dashboards/change-name/DATABRICKS_BUNDLE_ENGINE=direct✅​p✅​p✅​p🔄​f✅​p✅​p
❌​TestAccept/bundle/resources/dashboards/change-name/DATABRICKS_BUNDLE_ENGINE=terraform✅​p❌​F✅​p✅​p✅​p✅​p
🔄​TestAccept/bundle/resources/grants/schemas/all_privileges✅​p✅​p✅​p🔄​f✅​p✅​p
🔄​TestAccept/bundle/resources/grants/schemas/all_privileges/DATABRICKS_BUNDLE_ENGINE=direct✅​p✅​p✅​p🔄​f✅​p✅​p
🔄​TestAccept/bundle/resources/grants/schemas/change_privilege✅​p✅​p✅​p✅​p🔄​f✅​p
🔄​TestAccept/bundle/resources/grants/schemas/change_privilege/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p✅​p✅​p🔄​f✅​p
❌​TestAccept/bundle/resources/grants/schemas/duplicate_principals✅​p✅​p✅​p❌​F✅​p✅​p
❌​TestAccept/bundle/resources/grants/schemas/duplicate_principals/DATABRICKS_BUNDLE_ENGINE=direct✅​p✅​p✅​p❌​F✅​p✅​p
🔄​TestAccept/bundle/resources/grants/schemas/remove_principal✅​p✅​p✅​p✅​p🔄​f✅​p
🔄​TestAccept/bundle/resources/grants/schemas/remove_principal/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p✅​p✅​p🔄​f✅​p
🔄​TestAccept/bundle/resources/permissions/dashboards/create✅​p✅​p✅​p🔄​f🙈​s🙈​s
🔄​TestAccept/bundle/resources/permissions/dashboards/create/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p✅​p🔄​f
🔄​TestAccept/bundle/resources/permissions/jobs/delete_one✅​p✅​p🔄​f✅​p✅​p✅​p
🔄​TestAccept/bundle/resources/permissions/jobs/delete_one/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p🔄​f✅​p✅​p✅​p
🔄​TestAccept/bundle/resources/pipelines/allow-duplicate-names✅​p✅​p✅​p✅​p✅​p🔄​f
🔄​TestAccept/bundle/resources/pipelines/allow-duplicate-names/DATABRICKS_BUNDLE_ENGINE=direct✅​p✅​p✅​p✅​p✅​p🔄​f
🔄​TestAccept/bundle/resources/postgres_synced_tables/recreate🔄​f✅​p🙈​s🙈​s🙈​s🙈​s
🔄​TestAccept/bundle/resources/postgres_synced_tables/recreate/DATABRICKS_BUNDLE_ENGINE=terraform🔄​f✅​p
🔄​TestAccept/bundle/resources/quality_monitors/change_output_schema_name✅​p✅​p✅​p🔄​f✅​p🔄​f
🔄​TestAccept/bundle/resources/quality_monitors/change_output_schema_name/DATABRICKS_BUNDLE_ENGINE=direct✅​p✅​p✅​p🔄​f✅​p✅​p
🔄​TestAccept/bundle/resources/quality_monitors/change_output_schema_name/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p✅​p✅​p✅​p🔄​f
💚​TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name💚​R💚​R💚​R💚​R💚​R💚​R
🙈​TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🔄​TestAccept/bundle/select/basic✅​p✅​p✅​p🔄​f✅​p✅​p
🔄​TestAccept/bundle/select/basic/DATABRICKS_BUNDLE_ENGINE=direct/READPLAN=1✅​p✅​p✅​p🔄​f✅​p✅​p
🙈​TestAccept/ssh/connection🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
💚​TestFetchRepositoryInfoAPI_FromRepo💚​R💚​R💚​R💚​R🙈​S🙈​S
💚​TestFetchRepositoryInfoAPI_FromRepo/root💚​R💚​R💚​R💚​R
💚​TestFetchRepositoryInfoAPI_FromRepo/subdir💚​R💚​R💚​R💚​R
Top 50 slowest tests (at least 2 minutes):
durationenvtestname
14:29aws linuxTestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=terraform
13:52aws linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
13:05gcp windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
12:13aws windowsTestAccept/bundle/invariant/delete_idempotent/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=cluster_apply_policy_default_values.yml.tmpl/READPLAN=
12:01gcp linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
11:33aws windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
11:32gcp windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
9:49gcp linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
9:43aws linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
9:08aws windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:54gcp windowsTestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=yes/NBOOK=no/PY=yes/READPLAN=
8:34aws linuxTestAccept/bundle/invariant/delete_idempotent/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=pipeline_apply_policy_default_values.yml.tmpl/READPLAN=1
8:21aws windowsTestAccept/bundle/resources/apps/lifecycle-started-omitted/DATABRICKS_BUNDLE_ENGINE=direct
8:05aws windowsTestAccept/bundle/invariant/delete_idempotent/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=job_apply_policy_default_values_job_cluster.yml.tmpl/READPLAN=1
7:57gcp windowsTestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=yes/NBOOK=yes/PY=no/READPLAN=
7:41gcp linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
7:39gcp linuxTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
7:37gcp linuxTestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=direct
7:34gcp windowsTestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=yes/NBOOK=no/PY=no/READPLAN=
7:33aws linuxTestAccept/bundle/resources/clusters/resize-terminated-fallback/DATABRICKS_BUNDLE_ENGINE=direct
7:33gcp linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
7:31gcp windowsTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
7:25gcp windowsTestAccept/bundle/invariant/delete_idempotent/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=job_apply_policy_default_values_task_cluster.yml.tmpl/READPLAN=1
7:24aws linuxTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=direct
7:19azure linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:17gcp windowsTestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct/DLT=no/NBOOK=no/PY=yes/READPLAN=1
7:17azure linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
7:14azure windowsTestAccept/bundle/resources/clusters/deploy/data_security_mode/DATABRICKS_BUNDLE_ENGINE=direct
7:09azure windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:09aws windowsTestAccept/bundle/invariant/delete_idempotent/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=volume.yml.tmpl/READPLAN=1
7:08gcp windowsTestAccept/bundle/invariant/delete_idempotent/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=genie_space.yml.tmpl/READPLAN=
7:07azure linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:07gcp windowsTestAccept/bundle/resources/clusters/deploy/local_ssd_count/DATABRICKS_BUNDLE_ENGINE=direct
7:06aws linuxTestAccept/bundle/invariant/delete_idempotent/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=pipeline_apply_policy_default_values.yml.tmpl/READPLAN=
7:01aws windowsTestAccept/bundle/invariant/delete_idempotent/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=sql_warehouse.yml.tmpl/READPLAN=1
6:58aws windowsTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=terraform
6:57aws linuxTestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=direct
6:56gcp linuxTestAccept/bundle/resources/clusters/deploy/simple/DATABRICKS_BUNDLE_ENGINE=direct
6:55aws windowsTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
6:55azure linuxTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=terraform
6:52gcp windowsTestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=no/NBOOK=no/PY=no/READPLAN=
6:50azure windowsTestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=cluster_apply_policy_default_values.yml.tmpl/READPLAN=1
6:50azure windowsTestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=no/NBOOK=yes/PY=no/READPLAN=
6:48gcp linuxTestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=no/NBOOK=yes/PY=yes/READPLAN=
6:48aws linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
6:47azure windowsTestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct/DLT=yes/NBOOK=no/PY=yes/READPLAN=1
6:45aws windowsTestAccept/bundle/invariant/delete_idempotent/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=secret_scope_default_backend_type.yml.tmpl/READPLAN=1
6:42gcp linuxTestAccept/bundle/resources/clusters/deploy/local_ssd_count/DATABRICKS_BUNDLE_ENGINE=direct
6:41aws windowsTestAccept/bundle/apps/job_permissions/DATABRICKS_BUNDLE_ENGINE=terraform
6:41aws linuxTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct

janniklasrose pushed a commit that referenced this pull request Aug 5, 2026
)
## Changes
Add an optional `SkipCreate` to the direct engine's `IResource`: a
resource can report that a desired state needs no create, and `makePlan`
omits the node instead of planning one. `ResourceGrants` implements it
for an empty grants list.
It is only consulted for nodes with no state entry. A node that already
has state keeps its plan entry, so emptying a previously deployed
`grants:` list still plans the revoke.
## Why
Terraform writes no `databricks_grants` resource for an empty list, so
`bundle deployment migrate` records no state for the grants node, and
`bundle plan` showed a spurious `grants -> create` that contradicted
migrate's "no actions planned".
Normalizing empty grants away in config (as `apply_bundle_permissions`
does for permissions) would instead send an emptied list to the delete
branch, where grants' no-op `DoDelete` keeps the grants.
_Found by fuzz testing._
## Tests
* Re-enables the `schema_empty_grants` migrate invariant (excluded in
#6055 pending this fix).
* New `grants/schemas/remove_all` test: emptying a populated list still
revokes. Plan summary is per-engine since direct keeps the emptied node
in state as unchanged.
* Unit tests for the empty, unset, and populated cases, called through
the adapter.
Sign up for freeto 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.

3 participants

@radakam@eng-dev-ecosystem-bot@denik