mdcode: address KC pull review comments (post-merge follow-up) - #298
Merged
libei merged 2 commits intoAug 15, 2026
Merged
Conversation
Follow-up to the merged PR GoogleCloudPlatform#277 (semantic-model KC pull leg), addressing dlychagin-gg's inline review. Reader/orchestration/CLI only; the writer is untouched. - pull_kc: hard-fail on any entry-hydration fetch error and on a non-200 link lookup; an empty link list stays a silent no-op. - Enforce one semantic model per entry group: drop the `--pull --model` flag; >1 anchor is a hard error naming both. - Add `pull --force-remove` to authorize replacing a differently-named local model with the catalog's, rather than leaving two in the group. - Schema-join link type is a fixed built-in constant, never undefined. - push: warn when a relationship name will be normalized (KC stores it only in the link id, so a pull returns it lowercased/hyphenated). - Default untyped fields and metrics to Opaque (STRING + OTHER) instead of guessing STRING/NUMERIC; a typeless metric now round-trips un-typed. - osi_schema: exclude the expression-free .pull.golden.yaml fixtures from the OSI guardrail with a TODO(GoogleCloudPlatform#290); PR GoogleCloudPlatform#290 restores expressions on push+pull, at which point they can be schema-checked again. - Docs + tests + regenerated goldens to match.
Follow-up fixes from a review pass over the pull review-fixes PR: - pull reconcile compares local vs catalog models by their on-disk path, not the raw name, so a model name that sanitizes to the same file (e.g. 'a/b' -> 'a_b.yaml') is recognized as the same model rather than flagged as a stale conflict on every re-pull. - mapConcurrent stops claiming new items once a worker throws: Promise.all already rejects on the first failure, so the remaining fan-out was wasted fetches whose rejections surfaced as unhandled-rejection noise. - the OSI guardrail now validates .pull.golden.yaml fixtures too, tolerating ONLY the known missing-`expression` gap (TODO GoogleCloudPlatform#290) instead of skipping them by filename -- so unrelated schema drift is caught now, and the fixtures schema-check with no special-casing once GoogleCloudPlatform#290 restores expressions.
Collaborator
Author
|
Follow-up commit
Deferred, intentionally not in this commit:
|
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.
Follow-up to the merged #277 (semantic-model Knowledge Catalog pull leg), addressing the inline review comments left after merge. Reader / pull-orchestration / CLI only — the writer (#278) is untouched.
Changes
:81,:112).pull --modelflag; >1 anchor in a group is now a hard error naming both (:483,:261,:140).pull --force-remove: authorize replacing a differently-named local model with the catalog's, rather than silently leaving two models in the group (:269).undefined(:108,:182).:295).Opaque(STRING + OTHER) instead of guessing STRING/NUMERIC; a typeless metric round-trips un-typed (:296)..pull.golden.yamlfixtures come from a default (expression-free) KC push, so their fields/metrics lack the OSI-requiredexpression. They're excluded from the OSI schema check with aTODO(#290)— mdcode: store SQL expressions in the sql-expressions companion aspect #290 (the sql-expressions companion aspect) restores expressions on push+pull, at which point they can be schema-checked again.docs/semantic-model.md) + tests + regenerated goldens to match.Deferred (tracked as follow-ups, not in this PR)
ai_contexton pull → guidelines aspect.annotations.Testing
bun test— green (the one localajv/dist/2020load error is a borrowed-node_modulesartifact;ajv ^8.17.1is a declared devDependency so CI resolves it).