Migrate OCP to canton-dev-tools prepare-build (0.1.5) - #309
Conversation
Use the shared install-dpm-sdks and verify-dars CLI, and re-export dar-utils /
policy primitives from @fairmint/canton-dev-tools/daml. Keep local backup,
upgrade-compat, and OCP deployment-gate scripts because this repo builds
in-place under {pkg}/.daml/dist/ and the shared CLI still expects generated/build.
Co-authored-by: hardlydiff <hardlydiff@gmail.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe repository now uses ChangesCanton tooling migration
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/publish.yml:
- Around line 53-57: In the workflow steps around “Install DAML SDK (dpm)”, move
“Install dependencies” so npm i runs before invoking canton-dev-tools, then
update the DAML SDK step to use the installed local CLI and assert that
./node_modules/.bin/canton-dev-tools exists before running it.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 8299be1d-e766-41cf-99c7-451b65d60d39
📒 Files selected for processing (12)
.github/workflows/ci.yml.github/workflows/publish.yml.github/workflows/release.yml.github/workflows/replay-ocf-database.yml.github/workflows/upload-dar-ledger.ymlREADME.mdpackage.jsonscripts/check-upgrade-compatibility.tsscripts/dar-utils.tsscripts/dar-version-policy.tsscripts/install-dpm-sdks.shscripts/verify-dars.ts
💤 Files with no reviewable changes (2)
- scripts/install-dpm-sdks.sh
- scripts/verify-dars.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fab83aa63d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Migrates duplicated DAML tooling to @fairmint/canton-dev-tools@0.1.2 while retaining repository-specific DAR lifecycle orchestration.
Changes:
- Replaced local SDK installation and DAR verification scripts with shared CLI commands.
- Reused shared DAR utilities and version-policy primitives through local adapters.
- Updated documentation, dependency version, CI workflows, and cache keys.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/verify-dars.ts |
Removes the local DAR verifier. |
scripts/install-dpm-sdks.sh |
Removes the local SDK installer. |
scripts/dar-version-policy.ts |
Imports shared deployment-policy primitives. |
scripts/dar-utils.ts |
Wraps shared DAR utilities for the in-place layout. |
scripts/check-upgrade-compatibility.ts |
Uses shared semantic-version comparison. |
README.md |
Documents shared SDK installation. |
package.json |
Updates the tool dependency and verifier command. |
.github/workflows/upload-dar-ledger.yml |
Uses the shared SDK installer and cache key. |
.github/workflows/replay-ocf-database.yml |
Updates tooling and SDK installation. |
.github/workflows/release.yml |
Uses the shared SDK installer and cache key. |
.github/workflows/publish.yml |
Migrates publishing setup to shared tooling. |
.github/workflows/ci.yml |
Migrates CI SDK installation and caching. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Move npm install ahead of install-dpm-sdks in publish.yml so the pinned @fairmint/canton-dev-tools binary is available. Upgrade CI, DAR-check, publish, release, and upload workflows to Node 22 to match canton-dev-tools 0.1.2 engines, invoke the local CLI via npm exec, and document Node 22+ in package.json and README. Co-authored-by: hardlydiff <hardlydiff@gmail.com>
|
Addressed bot review in 6c61e83:
|
Workflows that invoke install-dpm-sdks now echo $HOME/.dpm/bin to GITHUB_PATH so later steps (e.g. detect-factory-need) can run bare dpm. Bump @fairmint/canton-dev-tools to 0.1.3. Co-authored-by: hardlydiff <hardlydiff@gmail.com>
Ensure LocalNet CLI now uses canton-dev-tools from npm install when present, otherwise reads the version from package.json with a 0.1.3 fallback for pre-cutover SHAs. Record committed package.json hash before any optional npm install so Daml SDK and LocalNet cache keys match the checked-out target_sha contents. Co-authored-by: hardlydiff <hardlydiff@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/replay-ocf-database.yml:
- Around line 131-133: Update the installation flow around dev_tools_ver,
node_sdk_ver, and the npm install command to use a workflow-owned,
integrity-pinned lockfile or equivalent artifact for every supported target_sha.
Ensure both the normal and fallback installation paths install from that pinned
dependency definition rather than resolving transitive packages from the
registry.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 5758a31b-60b4-49eb-b5fe-3b1abd2c2962
📒 Files selected for processing (1)
.github/workflows/replay-ocf-database.yml
Co-authored-by: hardlydiff <hardlydiff@gmail.com>
….1.1 Replay checks out historical target_sha package.json, which may pin canton-dev-tools 0.1.1 without install-dpm-sdks. Use the local shell script when the installed CLI lacks that subcommand. Co-authored-by: hardlydiff <hardlydiff@gmail.com>
Adopt generated/build via prepare-build, sync-splice-dars (drop splice submodule), shared DAR policy/backup/upgrade-compat CLIs, and codegen-js from buildDir. Watch scripts/codegen and libs/splice for DAR version policy. Co-authored-by: hardlydiff <hardlydiff@gmail.com>
codegen build:ts failed after prepare-build migration because getDarPath now requires the generated build directory for fresh DAR lookup. Co-authored-by: hardlydiff <hardlydiff@gmail.com>
…back Call checkDarVersionPolicy in-process so tag_exists reaches GITHUB_OUTPUT for release/upload workflow gates. Conditionally init libs/splice on replay when the checked-out target_sha still declares that submodule. Co-authored-by: hardlydiff <hardlydiff@gmail.com>
Delete run-backup-dar / run-check-dar-deployment wrappers. Point backup-dar and deployment gates at canton-dev-tools with OpenCapTable-v34 discovery names. Co-authored-by: hardlydiff <hardlydiff@gmail.com>
Deferred items — addressed on tipThe PR body’s Deferred section is stale relative to tip
CI: No further code changes needed for those tooling deferrals. |
|
@coderabbitai resume PR tip is |
Ensure prepared daml.yaml codegen.js.output-directory resolves to repo-root generated/js before dpm codegen-js (source path is wrong under generated/build). Always run prepare-build in prelint:daml so lint does not use a stale generated tree. Co-authored-by: hardlydiff <hardlydiff@gmail.com>
Always running prepare-build in prelint:daml deletes generated/build (including .daml/dist DARs), so check-upgrade-compat fails after lint. Restore conditional prepare (sibling repos' pattern); CI already prepares via npm run build before lint. Keep the codegen output-path fix. Co-authored-by: hardlydiff <hardlydiff@gmail.com>
|
CI failed on Fixed in |
CapTable.daml is gitignored; pretest only synced Splice DARs, so a clean npm test skipped generation before prepare-build/dpm build. Mirror prebuild and run generate-captable in pretest. Co-authored-by: hardlydiff <hardlydiff@gmail.com>
libs/splice/ is gitignored after sync-splice-dars, so it never fires the DAR version-policy extra watch paths. Watch package.json instead (canton- dev-tools pin drives the shared Splice DAR set). Improve remove-participant- dar's missing-proto error to describe the post-submodule layout. Co-authored-by: hardlydiff <hardlydiff@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d9b3582. Configure here.
Hardcoded OpenCapTable-v34 in release/upload deployment preflight could diverge from the package being uploaded on the next major line. Pass the resolved daml.yaml package name from release_tag / package metadata instead. Co-authored-by: hardlydiff <hardlydiff@gmail.com>

Summary
Migrate Open Cap Table Protocol DAML tooling onto
@fairmint/canton-dev-tools0.1.5:prepare-build/generated/build/for build, test, lint, and clean (no more in-place{pkg}/.daml/dist/builds).sync-splice-dars(MainNet pin from canton-dev-tools); remove thelibs/splicegit submodule. Replay keeps a conditional submodule fallback for older target SHAs that still declare it.backup-dar,verify-dars,check-dar-version-policy,check-upgrade-compat,install-dpm-sdks) and delete the local implementations / wrappers.scripts/run-backup-dar.tsandscripts/run-check-dar-deployment.ts; callcanton-dev-toolsdirectly (discovery nameOpenCapTable-v34).canton-dev-toolsand append~/.dpm/bintoPATH.Intentionally local
scripts/packages.tsand OCP-specific codegen / factory / deploy / upload scripts (repo-specific, not shared tooling).Out of scope
Test plan
npx canton-dev-tools install-dpm-sdksnpm run build/npm testviaprepare-build+generated/build/npm run verify-dars/npm run test:dar-version-policybackup-dar,check:dar-version-policy -- --deployment,check-upgrade-compat) — no local DAR lifecycle wrappersdaml-buildon9ef48d7)Note
High Risk
Touches the full build pipeline, DAR backup/version-policy gates, and release/deploy CI paths. A regression could break builds, DAR integrity checks, or network uploads.
Overview
Migrates Open Cap Table Protocol tooling onto
@fairmint/canton-dev-tools0.1.5, so build/test/lint/clean run throughprepare-buildintogenerated/build/instead of in-place package dirs.Removes the
libs/splicegit submodule and fetches Splice DARs viasync-splice-dars. Replay keeps a conditional submodule fallback for older target SHAs. Local DAR lifecycle scripts (backup-dar,verify-dars, version-policy, upgrade-compat, SDK install) are deleted and npm scripts call the shared CLI instead.Requires Node 22+. CI/publish/release/upload/replay install SDKs via
canton-dev-tools, drop recursive submodule checkout, and point deployment gates atcheck:dar-version-policy -- --deployment. Remaining OCP scripts (packages, upload, factory, codegen) now resolve DARs frombuildDir.Reviewed by Cursor Bugbot for commit 9ef48d7. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
Improvements
Documentation