Skip to content

sync spec: add fullyResolved param to model yaml GET/POST (#47)#48

Merged
n8agrin merged 5 commits into
mainfrom
sync-spec-fully-resolved
Apr 28, 2026
Merged

sync spec: add fullyResolved param to model yaml GET/POST (#47)#48
n8agrin merged 5 commits into
mainfrom
sync-spec-fully-resolved

Conversation

@n8agrin
Copy link
Copy Markdown
Contributor

@n8agrin n8agrin commented Apr 28, 2026

Summary

  • Picks up the fullyResolved query/body param on modelsYamlGet and modelsYamlCreate (only valid with mode=combined), exposed by the upstream change in exploreomni/omni#48617.
  • Side-effects of the full sync: modelsUpdate (PATCH /api/v1/models/{modelId} for renames), folder_paths content-validator param, and a cursor param on dbt-exposures.
  • Adds /update-from-api-spec, a project slash command that captures the spec-sync flow (resolve source spec → branch → sync → build/test → validate --help → commit → open PR) so future bumps don't have to be redone by hand.

Fixes #47

Test plan

  • make test
  • ./bin/omni models yaml-get --help shows --fullyresolved
  • Live verification: ./bin/omni models yaml-get <model-id> --fullyresolved=true --mode combined returns expanded YAML

🤖 Generated with Claude Code

n8agrin and others added 2 commits April 28, 2026 15:26
Picks up the fullyResolved query/body param on modelsYamlGet and
modelsYamlCreate (only valid with mode=combined). Also pulls in
modelsUpdate (PATCH /api/v1/models/{modelId}) for renames, the
folder_paths content-validator param, and the cursor param on
dbt-exposures as a side effect of the full sync.

Fixes #47

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Captures the spec-sync flow as a reusable slash command: resolve the
source spec, preview the diff, branch, sync, build, test, validate the
new commands/flags, then commit and open a PR. Replaces the manual
sequence we ran for #47.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

1. Path passed in `$ARGUMENTS`.
2. `$OMNI_OPENAPI_SPEC` env var.
3. `~/src/omni/packages/bi-app/app/types/api/openapi/openapi.json` (common local checkout).
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this, that's my personal checkout.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 856535e — dropped the hardcoded fallback. Resolution is now $ARGUMENTS$OMNI_OPENAPI_SPEC → ask the user.


If the user gave a specific endpoint or param in `$ARGUMENTS`, confirm it actually appears in the new diff. If it doesn't, stop and tell the user — the upstream change probably hasn't been merged into their monorepo checkout yet.

3. **Branch** — Create a topic branch off the current default branch:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if you're in a worktree? Will this work? No need to branch a branch.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — fixed in 856535e. The branch step now checks git branch --show-current first: if you're already on a non-default branch (worktree or topic), it stays put. It only creates a new branch when you're on main.

n8agrin and others added 2 commits April 28, 2026 15:42
- Drop the hardcoded ~/src/omni fallback. Resolution is now $ARGUMENTS
  → $OMNI_OPENAPI_SPEC → ask the user. Don't bake one developer's
  checkout layout into a shared skill.
- Make the branch step worktree-aware: if already on a non-default
  branch (worktree, existing topic), stay on it instead of branching a
  branch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a subsection under "Updating the OpenAPI Spec" so the slash
command is discoverable from the dev guide, with example invocations
and a pointer to the skill file for editing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drops the requirement for a local omni-monorepo checkout. `make sync-spec`
now fetches openapi.json from exploreomni/omni@main via `gh api` by
default. Two overrides remain for the cases that actually need them:

- OMNI_OPENAPI_SPEC=/local/path  — test an unmerged spec change.
- OMNI_OPENAPI_REF=branch-or-sha — pin to a non-default ref.

Renames the slash command from /update-from-api-spec to /update-api
and rewrites the skill so the make target owns resolution. The skill
just drives it. DEVELOPMENT.md updated to match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@n8agrin n8agrin merged commit 829530b into main Apr 28, 2026
2 checks passed
@n8agrin n8agrin deleted the sync-spec-fully-resolved branch April 28, 2026 22:53
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.

Sync spec: add fullyResolved param to GET and POST model yaml end points

2 participants