ci: add opt-in dataset schema sync check to PR workflow#36
Draft
Matej Jurčák (JMatej) wants to merge 1 commit intomasterfrom
Draft
ci: add opt-in dataset schema sync check to PR workflow#36Matej Jurčák (JMatej) wants to merge 1 commit intomasterfrom
Matej Jurčák (JMatej) wants to merge 1 commit intomasterfrom
Conversation
Adds a Dataset Schema Sync Check step to the unitTest job that runs `npm run dataset-schema:check` only when the script is defined in the repo's package.json. Repos without the script silently skip the step, matching the opt-in-by-presence pattern already used for build-check, prettier, and knip/ts-unused-exports.
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.
Summary
Today the only thing guarding against the dataset schema (
*/dataset_schema.json) drifting out of sync with the TS dataset-item types is the huskypre-commithook inapify-store/booking(npm run dataset-schema:check). That hook can be bypassed (--no-verify) or simply not installed, so an out-of-sync schema can land onmasterwithout CI noticing.This PR adds a new Dataset Schema Sync Check step to the
unitTestjob in the reusablepr-build-test.yamlworkflow. To stay safe for the other repos that consume this workflow but don't have a dataset schema script, the step is opt-in by presence: it runsnpm run dataset-schema:checkonly when that script is defined in the consumer'spackage.json, otherwise it logs a skip message and exits 0.This matches the pattern already used in this file for
build-check,prettier, andknip/ts-unused-exports.How to enroll a repo
No workflow change needed — just define the script in the consumer's
package.json:apify-store/bookingalready has this script, so it will start enforcing on the next PR after this merges.Test plan
apify-store/bookingwith a deliberately out-of-syncdataset_schema.jsonand confirm the new step fails theunitTestjob.dataset-schema:check(e.g. another consumer of this reusable workflow) and confirm the step logs the skip message and the job stays green.apify-store/bookingwhere the schema is in sync and confirm the step passes.Drafted while paired with Claude — leaving as draft until the test plan above is exercised.
Generated by Claude Code