Skip to content

[281#5] refactor(route): split GetByIDOrSpec into FindRouteBySpec and GetRouteByGUID#291

Closed
mpechkurov wants to merge 1 commit into
feat/metadata-wire-all-resourcesfrom
refactor/route-split-lookup
Closed

[281#5] refactor(route): split GetByIDOrSpec into FindRouteBySpec and GetRouteByGUID#291
mpechkurov wants to merge 1 commit into
feat/metadata-wire-all-resourcesfrom
refactor/route-split-lookup

Conversation

@mpechkurov
Copy link
Copy Markdown
Collaborator

What

  • Remove obsolete GetByIDOrSpec from Route service interface
  • Use dedicated FindRouteBySpec (backwards-compat when external name is empty) and GetRouteByGUID (primary path)
  • Simplify Org controller GUID validation (fail fast on invalid format)
  • Update controller test mocks and expectations

Why

The hybrid GetByIDOrSpec mixed two responsibilities (lookup by spec for adoption, and direct GUID fetch for normal operation). Splitting them clarifies intent and simplifies error handling.

Part of

Split from #281 — PR 5 of 6 (independent refactor). Depends on [281#3].

Merge order: [281#1] → [281#2] → [281#3] → [281#4] → [281#5] → [281#6]

…eByGUID

Replace the hybrid GetByIDOrSpec lookup with two dedicated methods:
- FindRouteBySpec: backwards-compat lookup when external name is empty
- GetRouteByGUID: direct GUID lookup (primary path)

Moves late-initialization to the backwards-compat block, running before
GUID validation. GetRouteByGUID returns (obs, exists, error) instead of
the old nil-check convention.

Also simplifies Org controller GUID validation (fails fast on invalid
format instead of attempting API calls).

[281#5]
@SatabdiG
Copy link
Copy Markdown
Collaborator

Closing as #281 received review comments.

@SatabdiG SatabdiG closed this May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants