Skip to content

feat: add getDeploymentInfo and modernize CI - #79

Merged
shumkov merged 4 commits into
masterfrom
ci/modernize-and-get-deployment-info
Oct 15, 2026
Merged

shumkov merged 4 commits into
masterfrom
ci/modernize-and-get-deployment-info

Conversation

@shumkov

@shumkov shumkov commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

Dash Core v24 reports deployments (softforks) only through getdeploymentinfo. getblockchaininfo returns them only with -deprecatedrpc=softforks, which Core marks for removal in v25. Dashmate reads mn_rr activation from there, and its platform status section is empty on Core v24 (dashpay/platform#5439). The client has no getDeploymentInfo method.

The release workflow also no longer runs. It uses ubuntu-20.04 runners, which GitHub retired, v2 actions, and Node 16, and it publishes with the 2022 NPM_TOKEN org secret.

What was done?

  • getDeploymentInfo added to the callspec ('str': optional block hash, chain tip by default), with a test.
  • CI: both jobs run on ubuntu-latest with Node 24 (Active LTS) and current action majors (checkout@v7, setup-node@v7, cache@v6, github-script@v9). The steps are the same.
  • Publishing now uses npm trusted publishing: OIDC with id-token: write, through the npm CLI that Node 24 ships, instead of JS-DevTools/npm-publish with NPM_TOKEN. dashpay/platform has published this way since npm revoked classic tokens.
  • Tag/version check is now an inline step instead of geritol/match-tag-to-package-version. No third-party action runs in the job that holds id-token: write.
  • Release job no longer restores the npm cache or runs npm ci. Publishing needs no dependencies, and npm's guide says never to cache in release builds; any step in that job can mint a publish token.
  • Workflow token is contents: read by default (the repository default is write).
  • package.json repository, bugs and homepage now point to dashpay/dashd-rpc, where the repo lives now. Trusted publishing attaches provenance, and npm rejects provenance whose repository.url doesn't match the repo that built the package.
  • "should callback with error if invalid json" now expects the message the running engine's JSON.parse produces. Node 20 and later word that message differently, so the test failed on every supported LTS.

How Has This Been Tested?

  • npm ci, npm test and npm run coverage on Node 24.21 / npm 11.19 in a clean checkout: 24 passing.
  • The new getDeploymentInfo test fails before the callspec entry ("client.getDeploymentInfo is not a function") and passes after it.
  • Against real dashd 24.0.0-rc.3 on regtest, dashmate's status scopes using this branch show mn_rr as activated.

Breaking Changes

None.

Release prerequisite

The npm side of trusted publishing must exist before the release: on npmjs.com, a trusted publisher for @dashevo/dashd-rpc with organization dashpay, repository dashd-rpc, workflow test_and_release.yml, and no environment.

  • Under "Allowed actions", tick npm publish. A configuration created after Sep 03, 2026 allows only npm stage publish by default.
  • A new configuration expires unless its first publish succeeds within 2 days, so create it shortly before the release.
  • Once the first OIDC publish works, the NPM_TOKEN org secret is no longer used by this repo.

🤖 Generated with Claude Code

shumkov and others added 3 commits October 15, 2026 18:08
Dash Core v24 reports deployments (softforks) through getdeploymentinfo;
getblockchaininfo returns them only with -deprecatedrpc=softforks, which
Core marks for removal in v25. The optional argument is the block hash to
query, defaulting to the chain tip.

Test: "should call getDeploymentInfo at the chain tip or at a given
block". Before the callspec entry it fails with "client.getDeploymentInfo
is not a function"; after it, it passes.

"should callback with error if invalid json" already fails on master
under Node 24 and is unchanged here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Node 20 and later word JSON.parse errors differently from Node 16
("Unexpected token 'o', \"not a json string\" is not valid JSON" instead of
"Unexpected token o in JSON at position 1"), so "should callback with
error if invalid json" failed on every supported Node LTS. It now
expects the message JSON.parse produces for the same input, which keeps
the assertion that the client wraps the parse error.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ubuntu-20.04 runners are retired, and the v2 actions and Node 16 are
past end of life, so the workflow no longer starts. Run both jobs on
ubuntu-latest with Node 24 and current action majors; the steps stay the
same.

The release job now publishes with npm trusted publishing (OIDC,
id-token: write) through npm's own CLI instead of JS-DevTools/npm-publish
with the NPM_TOKEN secret, as dashpay/platform does since npm revoked
classic tokens. This needs a trusted publisher on npmjs.com for
@dashevo/dashd-rpc: organization dashpay, repository dashd-rpc,
workflow test_and_release.yml.

The tag/version check is now an inline step, so no third-party action
runs in the job that holds id-token: write. The package's repository,
bugs and homepage URLs move to dashpay/dashd-rpc, where the repository
now lives: trusted publishing attaches provenance, and npm rejects it
when repository.url names a different repository than the one that
built the package.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e8c4ef8c-2769-413c-8564-5071c0b21314
📥 Commits

Reviewing files that changed from the base of the PR and between 6efedb6 and bd19fec.

📒 Files selected for processing: 4
  • .github/workflows/test_and_release.yml
  • lib/index.js
  • package.json
  • test/index.js

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The changes add a getDeploymentInfo RPC call specification and tests, update package repository URLs, and revise the test and release workflow to use Node.js 24 and publish through npm publish.

Changes: Deployment info RPC

Layer / File(s) Summary
Deployment info call and tests
lib/index.js, test/index.js
The call specification adds getDeploymentInfo. Tests verify that chain-tip queries send no parameters and block queries send the supplied hash.

CI and release workflow

Layer / File(s) Summary
Runner, Node.js, and test compatibility
.github/workflows/test_and_release.yml, test/index.js
Both jobs use ubuntu-latest and Node.js 24 with updated actions. The JSON error test derives its expected message from the running Node.js engine.
Release validation and publishing
.github/workflows/test_and_release.yml
The release job adds repository and OIDC token permissions, checks that the release tag matches the package version, updates GitHub Script, and publishes with npm publish using the computed dist-tag.

Repository metadata

Layer / File(s) Summary
Package repository links
package.json
The repository, issue-tracker, and homepage URLs change from dashevo/dashd-rpc to dashpay/dashd-rpc.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to bd19f

The deployment-info call and release publishing handoff appear consistent with the intended behavior. No merge-blocking issue was identified.

Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
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.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely identifies both primary changes: adding getDeploymentInfo and modernizing CI and publishing workflows.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

With id-token: write every step of the release job can mint an npm
publish token, and npm's trusted-publishing guide says never to use
caching in release builds. Publishing needs no dependencies (the package
has no lifecycle scripts and the test job already ran), so the job no
longer restores the npm cache or runs npm ci. The workflow token is
read-only by default; the repository default is write.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@shumkov
shumkov merged commit b6a8056 into master Oct 15, 2026
3 checks passed
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.

1 participant