Stop prefixing vector_search_endpoints names#5209
Open
janniklasrose wants to merge 5 commits intomainfrom
Open
Stop prefixing vector_search_endpoints names#5209janniklasrose wants to merge 5 commits intomainfrom
janniklasrose wants to merge 5 commits intomainfrom
Conversation
The vector search endpoint name is the resource's primary key — it's how GET, UPDATE, and DELETE address it. Prefixing it (via dev-mode or presets.name_prefix) changes the resource's identity rather than just its display name, which is the wrong semantic. Co-authored-by: Isaac
Capture the rule the previous commit relies on: prefixing only applies to display-name fields, never to fields the API treats as the primary key / object id. Also point future maintainers at TestAllNonUcResourcesAreRenamed as the enforcement mechanism. Co-authored-by: Isaac
…enamed The carve-out list now includes VectorSearchEndpoint, which isn't a UC resource, so the old name no longer matches what the test does. Also refactor the long OR chain that listed resource types to skip into a slices.Contains over a named slice, hoisted to the outer loop so the skip happens once per resource type instead of once per instance. Update the agent rule that referenced the old test name. Co-authored-by: Isaac
Approval status: pending
|
Co-authored-by: Isaac
Co-authored-by: Isaac
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
presets.name_prefix(and the dev-mode[dev <user>]rename) tovector_search_endpointsinbundle/config/mutator/resourcemutator/apply_presets.go..agent/rules/name-prefix.mdcapturing the principle (only prefix display-name fields; never primary-key / object-id Names), scoped via globs toapply_presets.go,apply_target_mode*.go, andbundle/direct/dresources/*.go. Mirror as.cursor/rules/name-prefix.mdc.TestAllNonUcResourcesAreRenamed→TestAppropriateResourcesAreRenamed(the carve-out list now includes a non-UC resource), and refactor the longresourceType ==OR chain into aslices.Containsover a named slice hoisted to the outer loop.NEXT_CHANGELOG.mdentry under Bundles.Why
The vector search endpoint name is the API primary key — it's how GET, UPDATE, and DELETE address the resource (
bundle/direct/dresources/vector_search_endpoint.go:id := config.Name;recreate_on_changesfor the resource doesn't listnameonly because there's no rename API at all, so a name change would silently drift). Prefixing it changed which remote endpoint the bundle pointed at, not just the label the user saw. The rule we want to encode is broader (display-name fields can be prefixed; identity-bearing Names cannot), but this PR only fixes the vector_search_endpoints case to keep the change focused; mlflow Models, ModelServingEndpoints, etc. have the same issue and are tracked for follow-up.Tests
go test ./bundle/config/mutator/resourcemutator/passes;TestProcessTargetModeDevelopmentnow assertsvs_endpoint1(notdev_lennart_vs_endpoint1), andTestAppropriateResourcesAreRenamedincludes*resources.VectorSearchEndpointin the carve-out list and verifies the Name doesn't pick up adevprefix.apply_presets.gocauses both the explicit assertion and the reflective sweep to fail with clear diffs../task fmt,./task checks,./task lint,./task testclean.This PR was written by Claude Code.