Repository navigation
serving-endpoints: accept NAME as argument or in --json for create and update-config - #7665
Open
anshul0713 wants to merge 2 commits into
Open
anshul0713 wants to merge 2 commits into
anshul0713 wants to merge 2 commits into
Conversation
…d update-config
`create NAME` rejected NAME as an argument when --json was set ("no
positional arguments are allowed"), while `update-config` required the
argument and warned that "name" in --json is an unknown field. Users and
agents applied one command's rule to the other and got an error either
way. Both commands now take the name in either place. If create gets two
different names it fails rather than picking one; if update-config gets
no name at all it fails with the same error as before.
Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Anshul Gupta <anshul.gupta@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: Anshul Gupta <anshul.gupta@databricks.com>
Contributor
|
Commit: Regression test reportSelected 1 changed tests (limit=20, 0 not selected) 1 tests: regression=1 unreleased=0 coverage=0 failing=0
TestAccept/cmd/workspace/serving-endpoints/name-with-json: branch ✅ | main (620ea05) ❌ | latest (v1.26.0) ❌main (620ea05): latest (v1.26.0): same output as main (620ea05) |
Collaborator
✅ Integration test reportCommit: 24a74c2
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
serving-endpoints create NAME --json ...now works: the argument becomes the endpoint name. If the JSON also has a different"name", the command fails instead of picking one.create --json '{"name": ...}'with no argument works as before.serving-endpoints update-config --json '{"name": "my-endpoint", ...}'now works without the argument: the name is taken from the JSON and removed from the body, since the update body has nonamefield.update-config NAME --json ...works as before.--helpnow say that with--json, NAME can be the argument or"name"in the JSON.Why
The two commands had opposite rules, and each one's error only came after a failed call:
createsayscreate NAMEin its usage, but rejects the argument when--jsonis set:when --json flag is specified, no positional arguments are allowed. Provide 'name' in your JSON input.update-configrequires the argument and warnsunknown field: namewhen the name is in the body.In agent trials of serving-endpoint journeys, 3 of the 6 trials that created an endpoint hit this: agents applied one command's rule to the other and needed a failed call for each.
This PR fixes it for these two commands with an override. The same pattern exists in other generated commands, so the generator could make this behavior general later.
Backward compatibility
create NAME --jsonandupdate-config --jsonwith no NAME.update-config --jsonwith no name at all fails with the sameaccepts 1 arg(s), received 0error as before, and without--jsonNAME is still required for both commands.Notes
These overrides wrap the generated
RunE. #7659 (wait progress) replacesRunEfor the same two commands, so this file is named to sort afteroverrides.go: overrides run in fileinit()order. The file has a comment saying so.Tests
"name"from--json, including that large numbers survive and invalid or missing names leave the body unchanged.acceptance/cmd/workspace/serving-endpoints/name-with-jsoncovering each combination, including the recorded request bodies (nonamein the update body).create NAME --no-wait --json ...andupdate-config --no-wait --json '{"name": ...}'both reached the API with the right endpoint../task lintpasses.This pull request and its description were written by Isaac.