Repository navigation
Wait for grants and permissions before creating pipelines - #7142
Open
andrewnester wants to merge 9 commits into
Open
andrewnester wants to merge 9 commits into
andrewnester wants to merge 9 commits into
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/resources/grants/schemas/pipeline_run_as/DMS=: branch ✅ | main (e3aeacc) ❌ | latest (v1.26.0) ❌main (e3aeacc): latest (v1.26.0): same output as main (e3aeacc) TestAccept/bundle/resources/grants/schemas/pipeline_run_as/DMS=true: branch ✅ | main (e3aeacc) ❌ | latest (v1.26.0) ❌main (e3aeacc): latest (v1.26.0): TestAccept/bundle/resources/permissions/pipelines/depends_on/DMS=: branch ✅ | main (e3aeacc) ❌ | latest (v1.26.0) ❌main (e3aeacc): latest (v1.26.0): same output as main (e3aeacc) TestAccept/bundle/resources/permissions/pipelines/depends_on/DMS=true: branch ✅ | main (e3aeacc) ❌ | latest (v1.26.0) ❌main (e3aeacc): latest (v1.26.0): |
Collaborator
✅ Integration test reportCommit: 6917345
Top 3 slowest tests (at least 2 minutes):
|
denik
reviewed
Oct 21, 2026
andrewnester
force-pushed
the
fix/4573
branch
from
November 10, 2026 08:40
15aa688 to
8bca6d9
Compare
andrewnester
force-pushed
the
fix/4573
branch
from
November 10, 2026 15:14
8bca6d9 to
2c87aa9
Compare
andrewnester
enabled stacked auto-merge
November 10, 2026 15:16
A resource that depends on another resource, through a reference or through lifecycle.depends_on, now also depends on that resource's grants. The new CaptureGrantsDependencies mutator records this as a lifecycle.depends_on entry targeting the grants, e.g. schemas.src.grants, instead of adding edges to the deployment plan after the fact. A dependency that would create a cycle is skipped, e.g. when a schema grants privileges to the service principal of an app that refers to the schema. This requires lifecycle.depends_on to accept grants and permissions targets, which lands separately on the depends-on-grants branch. Co-authored-by: Isaac <no-reply@databricks.com>
The previous commit moved grants dependencies into the CaptureGrantsDependencies mutator, which records them as lifecycle.depends_on entries. It deleted the addGrantsDependencies helper but left its call in makePlan, which broke the build of bundle/direct and every job that compiles it. Remove the call so the plan relies only on the mutator output. Co-authored-by: Isaac <no-reply@databricks.com>
The mutator is about to be limited to pipelines, so name it after them. This commit only renames the mutator and its file; the behaviour changes next. Co-authored-by: Isaac <no-reply@databricks.com>
A pipeline cannot be created until the privileges it depends on are in place, for example its run_as principal's CREATE TABLE on the schema it writes to. Limit the implicit lifecycle.depends_on entries to pipelines, and make each pipeline wait for the grants and permissions of the resources it refers to, directly or through lifecycle.depends_on, when those exist. Entries are written through the typed config. A dependency that would create a cycle is still skipped, and the cycle check considers the whole graph. Co-authored-by: Isaac <no-reply@databricks.com>
The pipeline_run_as test checks the implicit depends_on in validate and plan and the schema request order on deploy. A new permissions test checks that a pipeline waits for the permissions of a job it refers to. The migrate test is restored to origin/main, since only pipelines get implicit entries now. Co-authored-by: Isaac <no-reply@databricks.com>
The fake's create-time 403 only fires in some runs without the mutator, so the plan assertion in the pipeline_run_as acceptance test is the regression guard. Revert the fake to origin/main. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
andrewnester
force-pushed
the
fix/4573
branch
from
November 15, 2026 18:15
06431c9 to
6917345
Compare
This branch has not been deployed
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
lifecycle.depends_on. The waits are added aslifecycle.depends_onentries byCapturePipelineDependencies, which replacesCaptureGrantsDependencies.Pipeline.Lifecycle.DependsOn, in sorted pipeline order with grants before permissions.Why
Creating a pipeline fails when its run_as principal has not yet been granted access to the schema in the same bundle. Ordering the pipeline after the grants and permissions it depends on fixes this.
Fixes #4573
Tests
TestCapturePipelineDependenciescovers pipeline-to-schema grants, the schema-not-catalog case, pipeline-to-job permissions, non-pipeline resources getting nothing, empty grants and permissions, a null pipeline entry not panicking, cycles through apps and permissions, lifecycle.depends_on, and idempotence across repeated runs.bundle/resources/grants/schemas/pipeline_run_as: thebundle plan -o jsondepends_on assertion is the regression guard. The deploy step's request summary shows the schema grants PATCH before the pipeline POST.bundle/resources/permissions/pipelines/depends_on: a pipeline that refers to a job waits for the job's permissions.This pull request and its description were written by Isaac.