Skip to content

fix(dashmate): re-sync stale 3.x Drive and rs-dapi images#3898

Open
thepastaclaw wants to merge 4 commits into
dashpay:v4.0-devfrom
thepastaclaw:fix-dashmate-rc-image-migration
Open

fix(dashmate): re-sync stale 3.x Drive and rs-dapi images#3898
thepastaclaw wants to merge 4 commits into
dashpay:v4.0-devfrom
thepastaclaw:fix-dashmate-rc-image-migration

Conversation

@thepastaclaw

@thepastaclaw thepastaclaw commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

Fixes #3889.

Dashmate configs upgraded from the 3.x line to 4.0.0-rc.2 could keep stale protocol-11 Drive ABCI and rs-dapi Docker image tags (dashpay/drive:3*, dashpay/rs-dapi:3*). Those images crash-loop after protocol 12 activation.

What was done?

  • Added a dashmate config migration that re-syncs stale shipped Drive ABCI and rs-dapi image tags from the current defaults.
  • Keyed the migration at 4.0.0-rc.3 so configs already stamped 4.0.0-rc.2 can be repaired on the next release bump instead of being skipped by the same-version short-circuit.
  • Preserved custom/private/manually-corrected images by only matching dashmate-shipped stale tags: :3, :3-dev, :3-rc, and :3-hotfix.
  • Added focused regression coverage for 3.0.1/3.1.0 upgrades, already-stamped rc.2 configs, custom image preservation, mixed sibling configs, and missing rs-dapi config sections.

How Has This Been Tested?

Environment:

  • macOS Darwin 24.6.0 arm64
  • Repository worktree: /Users/claw/Projects/platform/worktrees/fix-dashmate-rc-image-migration
  • Node 22 via npx -p node@22 because local system Node 25 hits an EBADF loader issue before the spec runs.

Validation:

npx -y -p node@22 node .yarn/releases/yarn-4.12.0.cjs workspace dashmate exec mocha test/unit/config/configFile/migrate3xTo4xRcImages.spec.js

Result: 11 passing (87ms).

Pre-PR review gate:

code-review dashpay/platform upstream/v3.1-dev fix-dashmate-rc-image-migration "Fix dashmate config migration so 3.0.x/3.1.0 configs upgraded to 4.0.0-rc line re-sync only stale shipped Drive ABCI and rs-dapi Docker image tags from defaults; re-key for rc.3 so already-stamped rc.2 configs are repairable on next release; regression tests for platform#3889."

Result: Recommendation: ship.

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced the 4.0.0-rc.3 configuration migration to automatically update stale Dashpay protocol-11 Docker image tags for Drive (ABCI) and rsDapi to the current defaults during upgrades. Custom/private image selections are preserved, updates apply only to matching outdated tag patterns, and upgrading to the same version remains a strict no-op.
  • Tests
    • Added regression unit tests covering mainnet/testnet, prerelease tag variants, sibling config rewrites, rsDapi-missing scenarios, and re-migration from 4.0.0-rc.2 to 4.0.0-rc.3.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@thepastaclaw, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 19 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 94320ef4-0aa7-4006-bb63-09b18e4ea610

📥 Commits

Reviewing files that changed from the base of the PR and between 086187c and ced758c.

📒 Files selected for processing (2)
  • packages/dashmate/configs/getConfigFileMigrationsFactory.js
  • packages/dashmate/test/unit/config/configFile/migrate3xTo4xRcImages.spec.js

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a 4.0.0-rc.3 config migration that re-syncs stale drive and rs-dapi Docker images from default config values, and adds tests for version transitions, custom-image preservation, mixed configs, and missing fields.

Changes

4.0.0-rc.3 Docker image migration and tests

Layer / File(s) Summary
4.0.0-rc.3 migration handler implementation
packages/dashmate/configs/getConfigFileMigrationsFactory.js
Adds the 4.0.0-rc.3 migration key with regex predicates for stale dashpay/drive:3* and dashpay/rs-dapi:3* tags, iterates over all named configs, and conditionally replaces matching images from the selected default config.
Test setup and version-path coverage
packages/dashmate/test/unit/config/configFile/migrate3xTo4xRcImages.spec.js
Sets up the migration under test, stubs homeDir, loads default config images, defines config helpers, and asserts the main version-transition cases update both image fields and configFormatVersion.
Preservation and missing-field cases
packages/dashmate/test/unit/config/configFile/migrate3xTo4xRcImages.spec.js
Checks the no-op path, preserves custom Drive and rsDapi images, rewrites only stale siblings, and leaves missing platform.dapi.rsDapi unset while updating Drive.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

🐇 I hopped through tags with a regex keen,
Found stale 3.* images tucked unseen.
Defaults restored, the configs align,
No crash-loop gremlins on this vine.
A tiny hop, a cleaner run,
Bunny-approved migration done!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: resyncing stale 3.x Drive and rs-dapi images in dashmate configs.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thepastaclaw thepastaclaw requested review from lklimek and shumkov June 14, 2026 17:19
@thepastaclaw

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot 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.

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 `@packages/dashmate/test/unit/config/configFile/migrate3xTo4xRcImages.spec.js`:
- Around line 26-31: The test is missing coverage for the `:3-rc` image variant
even though the migration predicate matches it alongside `dev` and `hotfix`. Add
constants for the rc variants (STALE_DRIVE_RC and STALE_RS_DAPI_RC) following
the same pattern as the existing STALE_DRIVE_DEV and STALE_RS_DAPI_DEV
constants. Then extend the test matrix around line 142-145 to include test cases
for these new rc variant constants, ensuring the migration correctly handles the
rc versions just as it does for dev and hotfix variants.
🪄 Autofix (Beta)

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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1ea52087-7c6e-4e68-9174-d84d8fca3052

📥 Commits

Reviewing files that changed from the base of the PR and between e2039e5 and 8bfa0aa.

📒 Files selected for processing (2)
  • packages/dashmate/configs/getConfigFileMigrationsFactory.js
  • packages/dashmate/test/unit/config/configFile/migrate3xTo4xRcImages.spec.js

@thepastaclaw thepastaclaw marked this pull request as ready for review June 14, 2026 17:33
@thepastaclaw

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@thepastaclaw thepastaclaw force-pushed the fix-dashmate-rc-image-migration branch from 2ce01c6 to e11795d Compare June 14, 2026 17:35
@thepastaclaw

thepastaclaw commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator Author

✅ Review complete (commit ced758c)

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Code Review

Targeted dashmate migration that re-keys the 3.x→4.0.0-rc image re-sync to 4.0.0-rc.3 (since the previous 4.0.0-rc.2 keying was a no-op for users already on rc.2) and extends coverage to the :3-hotfix tag series. Both agents independently found no in-scope correctness, security, or coverage issues, and the regression test file gives thorough coverage of the prerelease label series plus custom/missing-config edge cases.

@thepastaclaw

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@thepastaclaw

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@thepastaclaw

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@thepastaclaw thepastaclaw force-pushed the fix-dashmate-rc-image-migration branch from e11795d to 086187c Compare June 27, 2026 17:51

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Code Review

Prior review at e11795d had zero findings, so there is nothing to carry forward. Both agents independently re-reviewed head 086187c and reported no in-scope issues. Verified directly: the 4.0.0-rc.3 migration uses anchored regexes ^dashpay/drive:3(?:-(?:dev|rc|hotfix))?$ and ^dashpay/rs-dapi:3(?:-(?:dev|rc|hotfix))?$ to limit rewrites to the four dashmate-shipped stale 3.x tag series, gates writes on defaultConfig.has(...), uses optional chaining to tolerate missing dapi/rsDapi sections, and is re-keyed at 4.0.0-rc.3 to escape the same-version short-circuit from the original #3889 attempt. Scope matches the stated goal; no findings.

thepastaclaw and others added 4 commits June 29, 2026 12:28
…c upgrade (dashpay#3889)

A node already on 3.0.1 skipped the 3.0.0 migration that used to re-sync
the Drive ABCI and rs-dapi docker images, and the intervening
3.0.1 / 3.0.2 / 3.1.0 migrations only touched Core / Gateway / Tenderdash.
After `dashmate update` to 4.0.0-rc.x the config kept the old protocol-11
images (`dashpay/drive:3`, `dashpay/rs-dapi:3`), so the node stayed on
protocol 11 and crash-looped after protocol 12 activation.

Add a `4.0.0-rc.2` migration that re-syncs both image fields from the
current default config (matching the 3.0.0 migration convention), and a
focused regression spec that constructs the migration without the full
DI container so it doesn't depend on `@dashevo/wasm-dpp` being built.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Apply review polish on the regression added in 686e995:
- Match the sibling 3.0.0 migration's single-line `defaultConfig.get(...)`
  style in the migration body.
- Hoist expected default images into `beforeEach`; remove an unused
  `customImages` helper parameter.
- Parameterise the two `fromVersion` cases (3.0.1 and 3.1.0) so both
  real-world entry points are exercised by one assertion shape.
- Pin against the regression with `expect(...).to.not.equal('dashpay/drive:3')`
  (and rs-dapi:3) so the test keeps failing even if a future default
  happens to match the stale value again.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…custom images

The 4.0.0-rc.2 entry added in dashpay#3889 was both unreachable for already-
stamped rc.2 configs (migrateConfigFile short-circuits when
fromVersion === toVersion) and unconditional: it overwrote every
Drive ABCI / rs-dapi image with the current default, clobbering
private forks and vendor-patched builds.

Re-key the migration at 4.0.0-rc.3 (the next release; same flow as the
3.0.2 Envoy CVE - dashpay#3794 added the migration, dashpay#3796 cut the release)
and only rewrite the stale dashmate-shipped tags
(dashpay/drive:3, dashpay/rs-dapi:3, including their -dev/-rc series),
mirroring the 3.0.2 Envoy CVE migration's predicate style. Custom
images are preserved. The migration fires for both 3.0.x -> 4.0.0-rc.x
upgrades (the loop runs every migration with key > fromVersion) and
4.0.0-rc.2 -> 4.0.0-rc.3 once a chore(release) bumps the package
version.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous predicate alternation only matched the `-dev` and `-rc`
prerelease label series for `dashpay/drive:3` / `dashpay/rs-dapi:3`,
missing the `-hotfix` tag shipped by 3.0.1-hotfix.{1..4} (dashpay#3020/dashpay#3044/
dashpay#3055/dashpay#3060) and 3.1.0-hotfix.1. A node sitting on `:3-hotfix` would
still crash-loop after protocol 12 activation — the exact failure mode
the migration was meant to prevent. Extend the alternation and add a
regression case.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@thepastaclaw thepastaclaw force-pushed the fix-dashmate-rc-image-migration branch from 086187c to ced758c Compare June 29, 2026 17:35

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Code Review

Carried-forward prior findings: none; the prior verified output was clean and there is nothing to reconcile. New findings in the latest delta: the Tenderdash custom-image clobber is real in the checked-out code, but it was introduced by upstream base commit 1157ca7 (#3940), not by PR #3898's diff against the current base, so there are no in-scope findings for this PR.

@thepastaclaw

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

dashmate update keeps old drive/rs-dapi image on 3.0.x -> 4.0.0-rc.x upgrade (node stays on protocol 11, crash-loops after protocol 12 activation)

1 participant