Repository navigation
List run_as-unsupported resource types in one place - #7352
Draft
janniklasrose wants to merge 1 commit into
Draft
janniklasrose wants to merge 1 commit into
janniklasrose wants to merge 1 commit into
Conversation
Replace the hand-written block per resource type in validateRunAs with a single list of unsupported resource groups. Iterating AllResources keeps the diagnostics in the same order and at the same locations as before. Dashboards stay a per-resource check because only those with embed_credentials set are rejected. Add a test that every supported resource type is classified exactly once in allowList or the unsupported list, so a new type forces a decision. Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
Integration test reportCommit: 331de0b
Top 3 slowest tests (at least 2 minutes):
|
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
validateRunAshad one hand-written block per resource type whose API does not support deploying as a different principal. They are replaced by a single list of unsupported resource groups, iterated inAllResources()order so the diagnostics keep their order and locations. Dashboards keep their per-resource check, since only those withembed_credentialsset are rejected.A new test asserts that every supported resource type appears in exactly one of the test's allow list or the unsupported list, and that every listed name is a real resource type. Adding a resource type now fails until a run_as decision is made explicitly.
Why
Opting a new resource type into or out of
run_assupport was a copy-paste block that nothing checked for completeness. A type wrongly placed on the allow list was caught by nothing.Tests
go test ./bundle/config/mutator/resourcemutator -run 'TestRunAs' -count=1, including the newTestRunAsSupportListsAreComplete.go test ./bundle/config/... -count=1.acceptance/bundle/run_asandacceptance/bundle/runpass without regenerating goldens, so diagnostics are unchanged.This pull request and its description were written by Isaac.