Skip to content

chore(ci): add schema validation workflow#230

Open
sakinaroufid wants to merge 1 commit intoUniversal-Commerce-Protocol:mainfrom
sakinaroufid:pr-a-schema-validation
Open

chore(ci): add schema validation workflow#230
sakinaroufid wants to merge 1 commit intoUniversal-Commerce-Protocol:mainfrom
sakinaroufid:pr-a-schema-validation

Conversation

@sakinaroufid
Copy link

Description

Adds a CI workflow (schema-validation.yml) that validates schemas and ensures generated/schema-types.ts stays in sync with the source schemas on every push and PR.

This also fixes a bug in generate_ts_schema_types.js where SOURCE_ROOT was set to 'spec' (a directory that doesn't exist), causing the generator to find 0 schemas and produce a stale output. The correct path is 'source'.

The new workflow:

  • Installs Node.js dependencies and ucp-schema
  • Runs ucp-schema lint source/ to validate schemas
  • Runs node generate_ts_schema_types.js and checks git diff --exit-code to catch desynchronized types

Note for reviewers: The large diff in generated/schema-types.ts is machine output from the generator path fix — no manual edits. Only schema-validation.yml (75 lines) and the one-line fix in generate_ts_schema_types.js need review.

This is part 1 of 3 from #13, split per maintainer request.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

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.

1 participant