Skip to content

serving-endpoints: accept the endpoint name in permissions commands - #7662

Open
anshul0713 wants to merge 6 commits into
mainfrom
anshul0713/serving-endpoints-permissions-by-name
Open

anshul0713 wants to merge 6 commits into
mainfrom
anshul0713/serving-endpoints-permissions-by-name

Conversation

@anshul0713

@anshul0713 anshul0713 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Changes

databricks serving-endpoints get-permissions, set-permissions and update-permissions now also accept the endpoint name. When the argument isn't shaped like an endpoint ID (32 lowercase hex characters), the CLI looks the endpoint up with serving-endpoints get and uses its ID.

$ databricks serving-endpoints get-permissions my-endpoint
{"object_id": "/serving-endpoints/31ee674b7e6643f6930d5e12148fbe6f", ...}

get-permission-levels already worked with a name, so it isn't changed.

Why

Every other serving-endpoints command takes the endpoint name, and the ID only appears in get output. Passing the name to a permissions command failed with 'my-endpoint' is not a valid Inference Endpoint ID. In agent trials of a governance journey, agents had to discover this and then fetch the ID first.

Backward compatibility

  • An ID-shaped argument (root or 32 hex characters, the only values the API accepts) is passed through unchanged, with no extra request.
  • If the name doesn't resolve, the command returns the lookup error (for example Endpoint with name '...' does not exist.) instead of the API's is not a valid Inference Endpoint ID. An endpoint with no ID, such as a pay-per-token endpoint, gets its own error.
  • Today any non-ID value fails, so the behavior changes are that names now work and failures explain why. Exit codes, request bodies, output and flags are unchanged. Usage now reads NAME_OR_ID instead of SERVING_ENDPOINT_ID.

Tests

  • Unit test for the ID-shape check.
  • New acceptance test acceptance/cmd/workspace/serving-endpoints/permissions-by-name covering set and get by name, get by ID, and an unknown name.
  • The fake server now returns the real API's is not a valid Inference Endpoint ID error when serving endpoint permissions are requested with a value that isn't an ID. It accepts root, and dashed UUIDs because that's how it mints endpoint IDs.
  • The acceptance test passes a literal 32-character ID and root, and the recorded requests show no lookup for them.
  • Unit tests cover passthrough, a resolved name, a failed lookup, and an endpoint without an ID. Existing bundle tests for serving endpoints and permissions pass unchanged.
  • The bundle/direct/dresources permissions fixture used the endpoint name as the permissions object ID, which the real API rejects and the fake now rejects too. It now uses the endpoint ID, matching what the direct engine does (endpoint_id).
  • Checked against a staging workspace: get, update and set by name on a real endpoint. A typo in the name returns the lookup error, and a pay-per-token endpoint returns the no-ID error.
  • ./task lint passes.

This pull request and its description were written by Isaac.

The permissions API only accepts a serving endpoint's ID, but every other
serving-endpoints command takes the name, and the ID only shows up in
`get` output. Passing the name failed with "is not a valid Inference
Endpoint ID". Resolve a value that isn't shaped like an ID to the
endpoint's ID with a get; IDs and names that don't resolve are passed
through unchanged, so the API's own error is still what the user sees.

The fake server now rejects non-ID values for serving endpoint
permissions the way the real API does.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Anshul Gupta <anshul.gupta@databricks.com>
@anshul0713
anshul0713 requested a review from a team as a code owner November 16, 2026 07:18
@anshul0713
anshul0713 requested a review from rclarey November 16, 2026 07:18
Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Anshul Gupta <anshul.gupta@databricks.com>
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Commit: 53b30a076 | Workflow run

Regression test report

Selected 1 changed tests (limit=20, 0 not selected)

1 tests: regression=1 unreleased=0 coverage=0 failing=0
test branch main (479098f) latest (v1.26.0)
TestAccept/cmd/workspace/serving-endpoints/permissions-by-name ✅ ❌ ❌
TestAccept/cmd/workspace/serving-endpoints/permissions-by-name: branch ✅ | main (479098f) ❌ | latest (v1.26.0) ❌

main (479098f):

acceptance_test.go:1380: Diff:
        --- cmd/workspace/serving-endpoints/permissions-by-name/output.txt
        +++ /tmp/TestAcceptcmdworkspaceserving-endpointspermissions-by-name2119605917/002/output.txt
        @@ -2,75 +2,6 @@
         === Permissions commands accept the endpoint name
         
         >>> [CLI] serving-endpoints set-permissions my-endpoint --json {"access_control_list": [{"group_name": "users", "permission_level": "CAN_QUERY"}]}
        -{"group_name":"users","permission_level":"CAN_QUERY"}
        +Error: 'my-endpoint' is not a valid Inference Endpoint ID.
         
        ->>> [CLI] serving-endpoints get-permissions my-endpoint
        -{"object_id":"/serving-endpoints/[ENDPOINT_ID]"}
        -
        -=== A 32-character ID and root are passed through with no lookup
        -
        ->>> [CLI] serving-endpoints get-permissions 0123456789abcdef0123456789ABCDEF
        -{"object_id":"/serving-endpoints/0123456789abcdef0123456789ABCDEF"}
        -
        ->>> [CLI] serving-endpoints get-permissions root
        -{"object_id":"/serving-endpoints/root"}
        -
        -=== A name that doesn't resolve returns the lookup error
        -
        ->>> musterr [CLI] serving-endpoints get-permissions no-such-endpoint
        -Error: "no-such-endpoint" is not a serving endpoint ID, and looking it up as an endpoint name failed: Resource serving.ServingEndpointDetailed not found: no-such-endpoint
        -
        -=== Help shows the name is accepted
        -
        ->>> [CLI] serving-endpoints get-permissions --help
        -    NAME_OR_ID: The name or ID of the serving endpoint for which to get or manage
        -  databricks serving-endpoints get-permissions NAME_OR_ID [flags]
        -
        ->>> print_requests.py //serving-endpoints //permissions --get
        -{
        -  "method": "POST",
        -  "path": "/api/2.0/serving-endpoints",
        -  "body": {
        -    "name": "my-endpoint"
        -  }
        -}
        -{
        -  "method": "GET",
        -  "path": "/api/2.0/serving-endpoints/my-endpoint"
        -}
        -{
        -  "method": "GET",
        -  "path": "/api/2.0/serving-endpoints/my-endpoint"
        -}
        -{
        -  "method": "PUT",
        -  "path": "/api/2.0/permissions/serving-endpoints/[ENDPOINT_ID]",
        -  "body": {
        -    "access_control_list": [
        -      {
        -        "group_name": "users",
        -        "permission_level": "CAN_QUERY"
        -      }
        -    ]
        -  }
        -}
        -{
        -  "method": "GET",
        -  "path": "/api/2.0/serving-endpoints/my-endpoint"
        -}
        -{
        -  "method": "GET",
        -  "path": "/api/2.0/permissions/serving-endpoints/[ENDPOINT_ID]"
        -}
        -{
        -  "method": "GET",
        -  "path": "/api/2.0/permissions/serving-endpoints/0123456789abcdef0123456789ABCDEF"
        -}
        -{
        -  "method": "GET",
        -  "path": "/api/2.0/permissions/serving-endpoints/root"
        -}
        -{
        -  "method": "GET",
        -  "path": "/api/2.0/serving-endpoints/no-such-endpoint"
        -}
        +Exit code: 1
        
FAIL

latest (v1.26.0): same output as main (479098f)

anshul0713 and others added 2 commits November 16, 2026 07:26
Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Anshul Gupta <anshul.gupta@databricks.com>
The fake server now rejects non-ID values for serving endpoint
permissions, like the real API. The direct engine already uses the
endpoint ID (endpoint_id); only this test fixture used the name.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Anshul Gupta <anshul.gupta@databricks.com>
@anshul0713
anshul0713 requested a review from a team as a code owner November 16, 2026 07:44
@github-actions github-actions Bot added the DABs DABs related issues label Nov 16, 2026
Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Anshul Gupta <anshul.gupta@databricks.com>
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 53b30a0

Run: 44014827993

Env 🔄​flaky 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 270 16 3:59
💚​ aws-windows-latest-4core-16gb 1 272 14 3:43
💚​ azure linux-2core-8gb 1 269 16 3:34
💚​ azure-windows-latest-4core-16gb 1 271 14 3:27
🔄​ gcp linux-2core-8gb 2 1 268 16 4:04
💚​ gcp-windows-latest-4core-16gb 1 272 14 3:28
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🔄​ TestFilerWorkspaceNotebook ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p
🔄​ TestFilerWorkspaceNotebook/sqlNb.sql ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:39 aws-windows-latest-4core-16gb TestAccept
3:24 gcp-windows-latest-4core-16gb TestAccept
3:22 azure-windows-latest-4core-16gb TestAccept

@Sankalp-Mittal Sankalp-Mittal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI review (Claude Fable 5.2 + Claude Opus 5.5, cross-verified). Only points the reviewers agreed on are posted.

Comment thread libs/testserver/permissions.go Resolved
Address review feedback on permissions-by-name:
- A failed name lookup now returns that error instead of passing the
  value through to the API's "not a valid Inference Endpoint ID" error.
  The API only accepts root or 32 hex characters, so such values always
  failed; only the message changes. Endpoints without an ID get a clear
  error too.
- The fake server accepts "root", and its comment explains why dashed
  UUIDs pass.
- The acceptance test passes a literal 32-character ID and root and shows
  no lookup request for them.
- Usage and help say NAME_OR_ID.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Anshul Gupta <anshul.gupta@databricks.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DABs DABs related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants