Repository navigation
Report workspace_id in bundle debug list-targets - #7182
Open
pavloKozlov wants to merge 3 commits into
Open
pavloKozlov wants to merge 3 commits into
pavloKozlov wants to merge 3 commits into
Conversation
`bundle debug list-targets` now reports each target's workspace ID next to its host. Both are normalized the same way authentication normalizes them: a ?o=, ?w= or ?workspace_id= query parameter in the host becomes the workspace ID, an explicit workspace.workspace_id takes precedence, and the query is removed from the host. Co-authored-by: Isaac <no-reply@databricks.com>
Contributor
|
Commit: Regression test reportSelected 3 changed tests (limit=20, 0 not selected) 6 tests: regression=6 unreleased=0 coverage=0 failing=0
TestAccept/bundle/debug/list-targets-root-workspace/DMS=: branch ✅ | main (c6bb214) ❌ | latest (v1.22.1) ❌main (c6bb214): latest (v1.22.1): same output as main (c6bb214) TestAccept/bundle/debug/list-targets-root-workspace/DMS=true: branch ✅ | main (c6bb214) ❌ | latest (v1.22.1) ❌main (c6bb214): latest (v1.22.1): TestAccept/bundle/debug/list-targets/DMS=: branch ✅ | main (c6bb214) ❌ | latest (v1.22.1) ❌main (c6bb214): latest (v1.22.1): same output as main (c6bb214) TestAccept/bundle/debug/list-targets/DMS=true: branch ✅ | main (c6bb214) ❌ | latest (v1.22.1) ❌main (c6bb214): latest (v1.22.1): same output as main (c6bb214) TestAccept/bundle/strict_profile_match/list_targets/DMS=: branch ✅ | main (c6bb214) ❌ | latest (v1.22.1) ❌main (c6bb214): latest (v1.22.1): same output as main (c6bb214) TestAccept/bundle/strict_profile_match/list_targets/DMS=true: branch ✅ | main (c6bb214) ❌ | latest (v1.22.1) ❌main (c6bb214): latest (v1.22.1): |
list-targets normalized only the target's own workspace section, so a target inherited neither the top-level host nor the top-level workspace_id. With a top-level workspace_id of 5678 and a target host of https://custom.test/?o=1234, it reported 1234 while authentication uses 5678. Merge the target's workspace over the top-level one, as MergeTargetOverrides does, before normalizing. Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
Integration test reportCommit: 145a770
Top 14 slowest tests (at least 2 minutes):
|
The value cases were already covered by the list-targets acceptance tests. Replace the check against MergeTargetOverrides with an acceptance test that compares the workspace ID list-targets reports with the one authentication uses for the same target. Co-authored-by: Isaac <no-reply@databricks.com>
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
bundle debug list-targetsnow reportsworkspace_idnext tohost. Both come from the target's workspace settings merged over the top-levelworkspace, the same way deploy merges them. They are then normalized the same way authentication does it: a?o=,?w=or?workspace_id=parameter in the host becomes the workspace ID, an explicitworkspace_idwins (also when inherited), and the query is removed from the host. Text output shows the ID asworkspace_id:<id>.Why
On a custom host, several workspaces share one host, so the host alone doesn't tell which workspace a target deploys to. Callers of this command also need the workspace ID, resolved by the same rules the CLI uses.
Tests
The
list-targetsacceptance tests cover an ID from the host's?o=query, an explicit ID taking precedence over the query, and a host and ID inherited from the top-levelworkspace. Astrict_profile_matchacceptance test checks that list-targets reports the same workspace ID that authentication uses, for a target whose inherited ID wins over?o=in its host.This pull request and its description were written by Isaac.