-
Notifications
You must be signed in to change notification settings - Fork 0
GH Action to validate registry.json structure on each PR or push #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces automated validation for the image registry structure by adding a JSON schema, a TypeScript validation script, and a GitHub Actions workflow that runs on pull requests and pushes.
Key Changes
- Added JSON schema and Zod-based validation script to enforce registry.json structure
- Integrated schema validation into the API via a new endpoint
- Created GitHub Actions workflow to automatically validate registry changes
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/image/registry.schema.json | Defines JSON Schema for validating registry.json structure with comprehensive type definitions |
| backend/src/scripts/validate-registry.ts | Implements Zod-based validation script that parses and validates registry.json against defined schemas |
| backend/src/routes/validation.routes.ts | Adds new API endpoint to expose the registry validation schema |
| backend/package.json | Adds npm script for running registry validation |
| .vscode/settings.json | Configures VS Code to use the JSON schema for registry.json files |
| .github/workflows/validate-registry.yml | Creates CI workflow to validate registry on relevant file changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| console.error(`Failed to read registry file at ${registryPath}`); | ||
| console.error(error); | ||
| process.exit(1); | ||
| return; |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return statement after process.exit(1) is unreachable and serves no purpose. Remove this line to improve code clarity.
| console.error('registry.json is not valid JSON'); | ||
| console.error(error); | ||
| process.exit(1); | ||
| return; |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return statement after process.exit(1) is unreachable and serves no purpose. Remove this line to improve code clarity.
| console.error('registry.json does not match the expected schema'); | ||
| console.error(JSON.stringify(result.error.format(), null, 2)); | ||
| process.exit(1); | ||
| return; |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return statement after process.exit(1) is unreachable and serves no purpose. Remove this line to improve code clarity.
|
merged into #58 |
No description provided.