Skip to content

[OCRVS-9135] Set up oRPC contract pipeline (commons → toolkit → countryconfig)#11799

Closed
rikukissa wants to merge 5 commits intodevelopfrom
rikukissa/chiang-mai
Closed

[OCRVS-9135] Set up oRPC contract pipeline (commons → toolkit → countryconfig)#11799
rikukissa wants to merge 5 commits intodevelopfrom
rikukissa/chiang-mai

Conversation

@rikukissa
Copy link
Copy Markdown
Member

Description

Establishes an end-to-end oRPC contract-first API pipeline:

  • Commons: Defines the example oRPC contract with input/output validation schemas using Zod
  • Toolkit: Re-exports contract and provides a pre-configured server instance via the new ./server export
  • Countryconfig: Imports the server and implements the example procedure with a handler

The pipeline enables type-safe API contracts with automatic validation, making it easy for country configurations to implement procedures using the toolkit.

Changes

  • Add @orpc/contract and @orpc/server dependencies to commons and toolkit
  • Define contract in packages/commons/src/countryconfig/contract.ts
  • Create packages/toolkit/src/server/index.ts that implements and re-exports the contract
  • Add tsconfig path mappings for @orpc modules to resolve types with old module resolution
  • Exclude toolkit/src/api from tsc compilation (pre-existing dependency on unbuilt events package)

Verification

All three packages now build and compile successfully:

  • yarn build in commons ✅
  • yarn build in toolkit ✅
  • yarn test:compilation in countryconfig ✅

Runtime test in countryconfig successfully creates a typed handler via oRPC's implementation pattern.

@github-actions
Copy link
Copy Markdown

Oops! Looks like you forgot to update the changelog. When updating CHANGELOG.md, please consider the following:

  • Changelog is read by country implementors who might not always be familiar with all technical details of OpenCRVS. Keep language high-level, user friendly and avoid technical references to internals.
  • Answer "What's new?", "Why was the change made?" and "Why should I care?" for each change.
  • If it's a breaking change, include a migration guide answering "What do I need to do to upgrade?".

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 11, 2026

ℹ️ Coverage metrics explained:
Statements — Executed code statements (basic logic lines)
Branches — Tested decision paths (if/else, switch, ternaries)
Functions — Functions invoked during tests
Lines — Source lines executed

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 11, 2026

📊 commons test coverage

Statements: 67.1%
Branches:   32.76%
Functions:  50%
Lines:      66.5%
Updated at: Wed, 11 Feb 2026 14:11:40 GMT

@rikukissa rikukissa changed the title Set up oRPC contract pipeline (commons → toolkit → countryconfig) [OCRVS-9135] Set up oRPC contract pipeline (commons → toolkit → countryconfig) Feb 11, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 11, 2026

📊 events test coverage

Statements: 86.17%
Branches:   84.4%
Functions:  92.66%
Lines:      86.17%
Updated at: Wed, 11 Feb 2026 14:16:47 GMT

@ocrvs-bot
Copy link
Copy Markdown
Contributor

Your environment is deployed to https://rikukissachiang-mai.e2e-k8s.opencrvs.dev

rikukissa and others added 2 commits February 11, 2026 12:50
Replace example contract with typed contracts for events, workqueue,
roles, application config, certificates, users, locations, trigger,
and content. Convert Roles from TS type to Zod schema. Add handler
stubs in countryconfig.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 4, 2026

This PR has been marked with label stale Since it has been inactive for 20 days. It will automatically be closed in 10 days if no further activity occurs.

@github-actions github-actions Bot added the Stale The pr is inactive label Mar 4, 2026
@github-actions
Copy link
Copy Markdown

This PR has been automatically closed because it has been inactive for 30 days. Please reopen if you are still working on it.

@github-actions github-actions Bot closed this Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stale The pr is inactive

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants