Skip to content

feat(verification): add Docker-based codegen verification for TypeScript and JSON Schema#246

Open
apoorv7g wants to merge 5 commits into
accordproject:mainfrom
apoorv7g:CI-Implementation
Open

feat(verification): add Docker-based codegen verification for TypeScript and JSON Schema#246
apoorv7g wants to merge 5 commits into
accordproject:mainfrom
apoorv7g:CI-Implementation

Conversation

@apoorv7g

@apoorv7g apoorv7g commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

This PR introduces a verification pipeline that validates generated TypeScript and JSON Schema output using real toolchains (tsc, ajv). It adds local Mocha verification tests, per-target Docker images with the Concerto CLI, and GitHub Actions workflows to run verification on every pull request.

Changes

  • Add local verification test suite under test/verification/ with shared fixtures in cases.js and compile/validate tests for TypeScript (tsc) and JSON Schema (ajv)
  • Add verification/corpus/ with a manifest-driven test corpus (Docker corpus is metamodel-only for now; local tests cover the full fixture set under test/codegen/fromcto/data/model/)
  • Add Docker verification images:
    • verification/docker/base/ - Node 20, Concerto CLI, branch-linked @accordproject/concerto-codegen
    • verification/docker/typescript/ - generate via CLI + tsc --noEmit
    • verification/docker/jsonschema/ - generate via CLI + ajv compile
  • Add scripts/verification/docker-run.js and npm scripts: verify:docker, verify:docker:typescript, verify:docker:jsonschema
  • Add .github/workflows/verify-codegen.yml - matrix workflow (typescript, jsonschema) on PR/push to main
  • Add .github/workflows/publish-verify-images.yml - publish verification images to GHCR on merge to main / version tags
  • Add .dockerignore, verification/templates/tsconfig.json, and verification/docker/targets.json (registry for future targets)

Flags

  • Docker corpus currently contains only the metamodel case; additional CTO fixtures will be added to verification/corpus/ in follow-up PRs
  • publish-verify-images.yml does not run on PRs - GHCR publishing happens after merge to main; PR verification uses verify-codegen.yml only
  • PRs from forks may require a maintainer to approve the GitHub Actions workflow run before checks execute
  • When expanding the Docker corpus beyond metamodel, the base image may need a stronger symlink so concerto compile uses this repo's codegen (not the CLI's bundled npm copy)

Screenshots or Video

Local Docker verification (metamodel):

JSONSchema
image

TypeScript
image

npm run verify:docker

==> GENERATE metamodel -> Typescript
==> VERIFY metamodel with tsc
==> GENERATE metamodel -> JSONSchema
==> VERIFY metamodel with ajv
schema /work/metamodel/schema.json is valid

Local Mocha verification:

npm run test:verify
14 passing

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to main from fork:CI-Implementation

@apoorv7g apoorv7g force-pushed the CI-Implementation branch from 2e71d8e to 9bad6db Compare June 9, 2026 08:49

@ekarademir ekarademir left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think overall very good progress, few comments.

Comment thread .github/workflows/publish-verify-images.yml Outdated
@@ -0,0 +1,86 @@
name: Publish Verification Images

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this action needed? The other action build and verifies the build no?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure if we'd ever need t publish these images. What would be the use of it?

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.

Okay, I suggested in my proposal to publish these images, for future reference. If its not necessary , I can omit this, please let me know @ekarademir .

apoorv7g added 5 commits June 10, 2026 22:36
…JSON Schema generation

- Introduced Docker workflows for publishing verification images and verifying code generation.
- Added .dockerignore to exclude unnecessary files from Docker context.
- Created Dockerfiles and entrypoint scripts for TypeScript and JSON Schema verification.
- Implemented verification cases and corresponding tests for TypeScript and JSON Schema generation.
- Added a manifest for verification cases and a template for TypeScript configuration.

This commit enhances the verification process by leveraging Docker, ensuring consistent environments for testing and validation.

Signed-off-by: Apoorv <130035517+APOORV7G@users.noreply.github.com>
- Added entries to .gitignore to exclude verification output directories.
- Introduced new npm scripts for verification testing and Docker-based verification for TypeScript and JSON Schema.

These changes streamline the verification process and ensure unnecessary files are not tracked.

Signed-off-by: Apoorv <130035517+APOORV7G@users.noreply.github.com>
- Added detailed JSDoc comments to functions in docker-run.js for better understanding and maintainability.
- Implemented new functions to streamline the process of building and running Docker images for verification targets.
- Updated test cases to include skip reasons and environment variable settings for verification runs.

These changes improve the clarity and usability of the verification scripts, facilitating easier contributions and modifications in the future.

Signed-off-by: Apoorv <130035517+APOORV7G@users.noreply.github.com>
- Removed GitHub Container Registry login steps and simplified the image build process.
- Introduced a new BASE_IMAGE_TAG environment variable for better image tagging.
- Updated the Docker build commands to use local image references instead of registry URLs, enhancing build efficiency.

These changes streamline the Docker verification workflow and improve maintainability.

Signed-off-by: Apoorv <130035517+APOORV7G@users.noreply.github.com>
- Added a step to harden the runner by auditing outbound calls.
- Updated Docker actions to their latest versions for improved functionality and security.

Signed-off-by: Apoorv <130035517+APOORV7G@users.noreply.github.com>
@apoorv7g apoorv7g force-pushed the CI-Implementation branch from f4c7579 to 3bfefca Compare June 10, 2026 17:07
@apoorv7g apoorv7g requested a review from ekarademir June 11, 2026 02:50
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.

2 participants