Commit 3ff74bd
authored
Stop prefixing vector_search_endpoints names (#5209)
## Changes
- Stop applying `presets.name_prefix` (and the dev-mode `[dev <user>]`
rename) to `vector_search_endpoints` in
`bundle/config/mutator/resourcemutator/apply_presets.go`.
- Add `.agent/rules/name-prefix.md` capturing the principle (only prefix
display-name fields; never primary-key / object-id Names), scoped via
globs to `apply_presets.go`, `apply_target_mode*.go`, and
`bundle/direct/dresources/*.go`. Mirror as
`.cursor/rules/name-prefix.mdc`.
- Rename `TestAllNonUcResourcesAreRenamed` →
`TestAppropriateResourcesAreRenamed` (the carve-out list now includes a
non-UC resource), and refactor the long `resourceType ==` OR chain into
a `slices.Contains` over a named slice hoisted to the outer loop.
- `NEXT_CHANGELOG.md` entry 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_changes` for the resource doesn't list `name`
only 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;
`TestProcessTargetModeDevelopment` now asserts `vs_endpoint1` (not
`dev_lennart_vs_endpoint1`), and `TestAppropriateResourcesAreRenamed`
includes `*resources.VectorSearchEndpoint` in the carve-out list and
verifies the Name doesn't pick up a `dev` prefix.
- Confirmed locally that re-introducing the prefix loop in
`apply_presets.go` causes both the explicit assertion and the reflective
sweep to fail with clear diffs.
- `./task fmt`, `./task checks`, `./task lint`, `./task test` clean.
_This PR was written by Claude Code._1 parent 2f25245 commit 3ff74bd
3 files changed
Lines changed: 45 additions & 36 deletions
File tree
- bundle/config/mutator/resourcemutator
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
300 | 296 | | |
301 | 297 | | |
302 | 298 | | |
| |||
Lines changed: 41 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
307 | | - | |
| 306 | + | |
| 307 | + | |
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
| |||
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
417 | | - | |
418 | | - | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
419 | 423 | | |
420 | 424 | | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
| 425 | + | |
425 | 426 | | |
426 | 427 | | |
427 | 428 | | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
428 | 444 | | |
429 | 445 | | |
430 | 446 | | |
| |||
433 | 449 | | |
434 | 450 | | |
435 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
436 | 465 | | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
458 | 470 | | |
459 | 471 | | |
460 | 472 | | |
| |||
0 commit comments