Skip to content

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

Open
denik wants to merge 1 commit 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 1 commit 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.

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

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

18 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

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: d6a986b

Run: 30022431546

Env 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 4 4 322 1059 4:35
💚​ aws windows 4 4 324 1057 5:02
💚​ azure linux 4 4 322 1058 5:12
💚​ azure windows 4 4 324 1056 4:41
💚​ gcp linux 1 5 321 1060 6:02
💚​ gcp windows 1 5 323 1058 5:01
8 interesting tests: 4 RECOVERED, 4 SKIP
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
💚​ 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):
duration env testname
3:42 aws windows TestAccept
3:24 gcp windows TestAccept
3:20 azure windows TestAccept

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