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:v3.1-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:v3.1-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

    • Improved the 4.0.0-rc.3 configuration migration to refresh outdated Drive ABIC and rsDapi Docker image tags to the current defaults, preventing upgrade-time crash loops. Custom/private image selections are preserved, and no changes are made when migrating to the same version.
  • Tests

    • Added regression coverage for 3.x to 4.0.0-rc.3 upgrade paths, prerelease tag variants, preservation of custom images, and scenarios where rsDapi settings are absent.

thepastaclaw and others added 3 commits June 14, 2026 11:17
…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>
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ba1affea-a7a1-4988-a2ec-9b024eda38fa

📥 Commits

Reviewing files that changed from the base of the PR and between 2ce01c6 and e11795d.

📒 Files selected for processing (2)
  • packages/dashmate/configs/getConfigFileMigrationsFactory.js
  • packages/dashmate/test/unit/config/configFile/migrate3xTo4xRcImages.spec.js
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/dashmate/configs/getConfigFileMigrationsFactory.js
  • packages/dashmate/test/unit/config/configFile/migrate3xTo4xRcImages.spec.js

📝 Walkthrough

Walkthrough

Adds a '4.0.0-rc.3' migration step to getConfigFileMigrationsFactory.js that iterates all named configs and replaces stale dashpay/drive:3* and dashpay/rs-dapi:3* Docker image tags with current defaults from the selected default config, leaving custom images untouched. A comprehensive unit test suite covering all scenarios is added alongside.

Changes

4.0.0-rc.3 Docker image migration and tests

Layer / File(s) Summary
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, fixtures, and helpers
packages/dashmate/test/unit/config/configFile/migrate3xTo4xRcImages.spec.js
Establishes test infrastructure with constants for stale and default image tags, constructs the migration without full DI, stubs homeDir, instantiates DefaultConfigs, and defines buildConfig helper for minimal config objects.
Core migration assertions
packages/dashmate/test/unit/config/configFile/migrate3xTo4xRcImages.spec.js
Asserts that stale Drive ABCI and rsDapi images are re-synced to expected defaults for testnet and mainnet across 3.0.1/3.1.04.0.0-rc.2/4.0.0-rc.3, including prerelease-derived stale tag variants (dev-series, rc-series, hotfix-series).
Edge case tests
packages/dashmate/test/unit/config/configFile/migrate3xTo4xRcImages.spec.js
Covers rc.2→rc.3 update path, no-op when fromVersion equals toVersion, custom image preservation, mixed-config selective rewrite, and missing platform.dapi.rsDapi structure handling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Suggested reviewers

  • QuantumExplorer

Poem

🐇 Hoppity-hop through the Docker tags I go,
Old 3.* images? They've got to go!
I sniff out the stale ones with regex so neat,
Replace them with defaults — no crash-loop defeat!
Custom images? Safe, not a whisker I'd move.
Migration complete, now the nodes are in groove! 🥕

🚥 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 accurately summarizes the main change: a migration that re-syncs stale 3.x Drive and rs-dapi Docker images to current defaults in dashmate configurations.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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 and usage tips.

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

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 2ce01c6 to e11795d Compare June 14, 2026 17:35
@thepastaclaw

thepastaclaw commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator Author

✅ Review complete (commit e11795d)

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

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