Skip to content

Fix permissions: [] to add default IS_OWNER instead of being treated as absent#6046

Open
denik wants to merge 2 commits into
mainfrom
denik/permissions-empty-list-fix
Open

Fix permissions: [] to add default IS_OWNER instead of being treated as absent#6046
denik wants to merge 2 commits into
mainfrom
denik/permissions-empty-list-fix

Conversation

@denik

@denik denik commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Why

An explicit permissions: [] on a resource was collapsed to nil by
ApplyBundlePermissions and then skipped by FixPermissions, so it never got
the default IS_OWNER for the current user — it behaved as if the block were
absent. The jobs/pipelines empty_list acceptance fixtures documented this as
a known bug.

Changes

Track whether the permissions key was present and only collapse to nil when
it was absent. An explicit empty list now survives as an empty sequence, so
FixPermissions adds IS_OWNER, matching both a non-empty list and Terraform.

Also adds a parallel grants empty-list test. Grants have no default owner, so
grants: [] grants nothing (unlike permissions), but the test documents a
direct-vs-terraform divergence on create: direct emits a no-op PATCH with an
empty body while terraform emits no request.

ApplyBundlePermissions collapsed an empty permissions slice to nil, which
FixPermissions then skipped (AsSequence fails on nil), so an explicit
permissions: [] never got the default IS_OWNER for the current user. It
was indistinguishable from omitting the block entirely.

Track whether the permissions key was present and only collapse to nil
when it was absent. An explicit empty list now survives as an empty
sequence, so FixPermissions adds IS_OWNER, matching both a non-empty list
and Terraform. The jobs/pipelines empty_list fixtures documented this as
a known bug; that comment is now resolved.

Co-authored-by: Isaac
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

27 files changed
Suggested: @janniklasrose
Also eligible: @shreyas-goenka, @anton-107, @andrewnester, @lennartkats-db, @pietern

/bundle/ - needs approval

Files: bundle/config/mutator/resourcemutator/apply_bundle_permissions.go
Suggested: @janniklasrose
Also eligible: @shreyas-goenka, @anton-107, @andrewnester, @lennartkats-db, @pietern

General files (require maintainer)

Files: .nextchanges/bundles/permissions-empty-list.md
Based on git history:

  • @janniklasrose -- recent work in .nextchanges/bundles/, bundle/config/mutator/resourcemutator/, acceptance/bundle/resources/permissions/

Any maintainer (@andrewnester, @anton-107, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @janniklasrose, @lennartkats-db) can approve all areas.
See OWNERS for ownership rules.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: b466386

Run: 30106692779

Env 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🔄​ aws linux 1 4 4 324 1060 10:43
💚​ aws windows 4 4 327 1058 6:49
💚​ azure linux 4 4 325 1059 8:31
💚​ azure windows 4 4 327 1057 6:46
🔄​ gcp linux 1 1 5 323 1061 12:06
🔄​ gcp windows 1 1 5 325 1059 8:41
11 interesting tests: 4 RECOVERED, 4 SKIP, 3 flaky
Test Name aws linux aws windows azure linux azure windows gcp linux gcp 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
🔄​ TestSyncIncrementalFileOverwritesFolder ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f
🔄​ TestSyncIncrementalSyncFileToPythonNotebook ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p
🔄​ TestSyncNestedFolderSync 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R
Top 11 slowest tests (at least 2 minutes):
duration env testname
5:30 gcp windows TestAccept
3:21 azure windows TestAccept
3:19 aws windows TestAccept
2:40 gcp windows TestAccept/bundle/deploy/mlops-stacks/DATABRICKS_BUNDLE_ENGINE=terraform
2:34 gcp windows TestFilerWorkspaceFilesExtensionsReadDir
2:17 gcp linux TestFilerWorkspaceFilesExtensionsReadDir
2:15 aws windows TestImportDirDoesNotOverwrite
2:11 azure windows TestFilerWorkspaceFilesExtensionsDelete
2:04 aws windows TestAccept/bundle/deploy/mlops-stacks/DATABRICKS_BUNDLE_ENGINE=terraform
2:01 aws linux TestAccept/bundle/deploy/mlops-stacks/DATABRICKS_BUNDLE_ENGINE=terraform
2:01 gcp linux TestAccept/bundle/deploy/mlops-stacks/DATABRICKS_BUNDLE_ENGINE=terraform

Grants have no default owner (no FixPermissions analog), so grants: [] grants
nothing rather than injecting a principal, and validate shows [] vs null for
absent. The test also records a direct-vs-terraform divergence on create:
direct emits a no-op PATCH with an empty body, terraform emits no request.

Co-authored-by: Isaac
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.

2 participants