Skip to content

fix(pull): exclude ObsessionDB metadata tables from pulled schema#199

Open
alvarogar4 wants to merge 1 commit into
mainfrom
alvaro/num-7479-pull-exclude-obsessiondb-metadata
Open

fix(pull): exclude ObsessionDB metadata tables from pulled schema#199
alvarogar4 wants to merge 1 commit into
mainfrom
alvaro/num-7479-pull-exclude-obsessiondb-metadata

Conversation

@alvarogar4

Copy link
Copy Markdown
Member

Summary

Fixes #126. chkit pull emitted ObsessionDB product-metadata tables — metadata_folder, metadata_table_folder, metadata_table_tag — as table(...) definitions. These are ObsessionDB internals provisioned inside customer databases, not part of the user's schema, so pulling them polluted the generated schema file and produced drift against tables the user does not own.

They are now excluded before rendering, on both introspection paths (the executor path and a custom introspector), and are not counted as skipped/unsupported objects — they vanish entirely.

One correctness detail: the filter treats an object as a table when it has kind === 'table' or no kind field at all, mirroring mapIntrospectedObjectToDefinition. Custom introspectors return bare table objects without a kind, so a naive kind === 'table' check would have missed metadata tables coming from that path.

Test plan

  • Regression test (excludes ObsessionDB metadata tables from pulled schema output): a mocked introspector returns a normal events table plus the three metadata tables → definitionCount is 1 (was 4), and the rendered content contains events but none of the metadata names
  • Mutation-checked — neutering the filter fails the test
  • typecheck + lint clean; full @chkit/plugin-pull suite green (incl. e2e)

Scope

A hardcoded denylist of the three known ObsessionDB metadata table names, matching the issue. No config surface added — if a user ever needs to pull a table genuinely named one of these, that's a future enhancement.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Biy2vG7iixRiBsBBsFg5Nu

chkit pull emitted ObsessionDB product-metadata tables (metadata_folder,
metadata_table_folder, metadata_table_tag) as schema definitions. These are
ObsessionDB internals provisioned inside customer databases, not the user's
schema, so pulling them polluted the schema file and produced drift against
tables the user does not own.

They are now filtered before rendering on both the executor and custom-
introspector paths, and excluded from the skipped-object summary (matching
mapIntrospectedObjectToDefinition's rule that a kind-less object is a table).

Closes #126

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Biy2vG7iixRiBsBBsFg5Nu
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.

bug: chkit pull includes ObsessionDB metadata tables

1 participant