Repository navigation
feat(cli): release 1.0.0 with the Polkadot environment, the protocol version check and generated release notes - #335
Conversation
…stop releasing the UI
CI Summary
Release - PassedTest this PR Download artifact (GitHub CLI required): gh run download 38704536322 -n cli-release-0.0.0-pr.335 -R paritytech/dotns-sdkInstall globally: npm install -g ./parity-dotns-cli-0.0.0-pr.335.tgzVerify: dotns --helpDeploy UI — Passed
Deploy Example — Passed
Benchmark UI - Failed (0s)
Labelspkg: cli, scope: bulletin, type: docs, type: test, dependencies Test - Passed417 passed, 0 failed across 417 tests. |
| const tokenInfo = await getChainTokenInfo(cacheClient); | ||
| assetHubTokenSymbol = tokenInfo.nativeTokenSymbol; | ||
| const clientWrapper = new ReviveClientWrapper(typedApi as any, tokenInfo); | ||
| const evmAddress = await clientWrapper.getEvmAddress(context.substrateAddress); |
There was a problem hiding this comment.
Do we want to enforceProtocolVersion before this?
There was a problem hiding this comment.
Yes, done in 1c2f9ee : --cache runs assertSupportedProtocolVersion before the write
| ? "it declares no dotNS protocol version" | ||
| : `it runs dotNS protocol ${declared}`; | ||
| super( | ||
| `This network is not supported: ${found}. This version of the SDK supports ${supported}.`, |
There was a problem hiding this comment.
| `This network is not supported: ${found}. This version of the SDK supports ${supported}.`, | |
| `This network is not supported: ${found}. This version of the SDK supports ${supported}. Set DOTNS_SKIP_VERSION_CHECK=1 to use it anyway.`, |
There was a problem hiding this comment.
core is the SDK layer, and only the CLI reads that variable. If we'd rather keep env var names out of core, we can append the hint where the CLI catches the error instead, in enforceProtocolVersion
| export const DEVNET_ASSET_HUB_URL = "wss://asset-hub-paseo-rpc.n.dwellir.com"; | ||
| export const DEVNET_BULLETIN_RPC = "wss://bulletin-paseo.tservices.es:8443"; | ||
| export const DEVNET_IPFS_GATEWAY_URL = "https://devnet-ipfs.api.polkadotcommunity.foundation/ipfs"; |
There was a problem hiding this comment.
Since we've dropped devnet, do we want to mention this in the PR desc or in its breaking changes?
There was a problem hiding this comment.
Any chance we might be using them elsewhere?
There was a problem hiding this comment.
It's now in the PR description, also saying it was already unused before
|
|
||
| ## Releasing | ||
|
|
||
| Releases publish the CLI (`@parity/dotns-cli`) from `v*` tags. The web UI in `packages/ui` is not released. |
There was a problem hiding this comment.
| Releases publish the CLI (`@parity/dotns-cli`) from `v*` tags. The web UI in `packages/ui` is not released. | |
| Releases publish the CLI (`@parity/dotns-cli`) from `v*` tags. The web UI in `packages/ui` is not released with the CLI; `ui-v*` tags deploy it separately through `deploy-ui.yml`.. |
| // exact match is: a network that declares any other release, or none, runs | ||
| // contracts this SDK was not built against. | ||
| export function isSupportedProtocolVersion(declared: string | null): declared is string { | ||
| return declared !== null && (SUPPORTED_PROTOCOL_VERSIONS as readonly string[]).includes(declared); |
There was a problem hiding this comment.
I think here, since we are directly comparing the version string, would the cli start throwing errors even when versions known might be '1.0.0' and the deployed might be '1.0.1'?
Though the semver should ideally be considered non-breaking with only minor backward compatible fixes.
What would be impact of the unsupported version encountered in this check for us.
There was a problem hiding this comment.
This is a good point. Exact match is a safe choice until we establish a clear compatibility policy for dotNS upgrades (e.g., no breaking changes listed in a patch release), so I would leave exact match for now.
| name: ui-release-tarball | ||
| path: artifacts | ||
|
|
||
| - name: Create release body |
There was a problem hiding this comment.
Intended because the UI leaves the CLI releases so v* tags no longer carry it
…e SDK check, test the version reads
… version-check comments
Agreed, fixed the PR description. The environment table, --help and the root README already said polkadot (default). |
Do we want to have this in breaking change, so it endsup in the release notes too? |
Description
Prepares dotns-sdk
1.0.0for the dotNS mainnet launch. The CLI now targets Polkadot MainNet by default; pass --env paseo-v2 (or set DOTNS_ENV) for the Paseo TestNet.Version gate. Before every read and before signing anything, account mapping included, the CLI reads the network's
DotnsProtocolRegistry.protocolVersion()and proceeds only when it is exactly one ofSUPPORTED_PROTOCOL_VERSIONS(0.8.0,1.0.0). Any other declaration, none, or a failed read is refused withUnsupportedProtocolVersionError, which says which case applies.DOTNS_SKIP_VERSION_CHECK=1bypasses the check.Polkadot environment.
--env polkadot(aliasesmainnet,polkadot-asset-hub,dot) targets Polkadot Hub and the Polkadot Bulletin chain, with the address book from dotnsdeployments/polkadot/420420419.json. It is the default environment. QR pairing defaults to the selected environment's People relay (polkadot,paseoorpreview). Content verification uses P2P (Bitswap) over the two boot nodes in the Polkadot Bulletin chain spec. No IPFS gateway is configured for Polkadot, so when P2P cannot resolve a CID the content is reported as not verified and no public gateway is probed. Read commands never sign: they no longer map a configured account, andaccount inforeports the mapping. Mapping happens indotns account mapand before writes. Reads that take a name or address no longer need the caller's account to be mapped, since the shared dev account is unmapped on Polkadot.devnetremoved. Its deployment on Paseo Asset Hub predatestld()andprotocolVersion(), so the CLI could not use it already: every command read the TLD from its registry and reverted.Release notes. The release body contains the supported dotNS protocol releases and networks, read from the code. GitHub appends the merged pull requests, leaving out UI-only ones (
.github/release.yml). No notes are currently written by hand at release time.The UI leaves CLI releases.
v*tags no longer build, attach, or deploy the UI; the previous production redeploy on every CLI tag is gone.ui-v*keeps its own deploy path, and its production gate now reads the version after theui-vprefix, so it can open for a stable UI tag. The README marks the UI as unmaintained and unreleased.Release hardening, mirroring dotns.
release.ymlis read-only by default; only the release job can write, and it runs in thereleasesenvironment.guardjob (tags only, read-only, no environment) refuses a tag whose commit is not onmain, before any approval is requested.npm-release.ymlis read-only and publishes only a published, non-prerelease release created by the release workflow (github-actions[bot]), so a manual dispatch cannot bypass the approval.CONTRIBUTING.mdgains a Releasing section, and the CLI README lists the new environment variable. The CLI version is1.0.0.Type
Package
@parity/dotns-cliRelated Issues
paritytech/dotns#223
Fixes
This closes paritytech/dotns#223
Checklist
Code
bun run lintpassesbun run formatpassesbun run typecheckpassesDocumentation
Breaking Changes
Breaking changes:
--envorDOTNS_ENV, commands target Polkadot Hub and the Polkadot Bulletin chain, so registrations, transfers and uploads spend real DOT. Pass--env paseo-v2(or setDOTNS_ENV=paseo-v2) for the previous default.protocolVersion()before every read and before signing, and refuses a network that does not declare0.8.0or1.0.0.polkadot,paseo-v2andpreviewnetare unaffected.DOTNS_SKIP_VERSION_CHECK=1bypasses the check.devnetenvironment is removed, from--env devnetand fromDOTNS_ENVIRONMENTS/DotnsEnvironmentIdin@parity/dotns-cli/core. It was already unusable with this CLI.store info) asks you to rundotns account mapfirst when the account is unmapped.bulletin verifyexits non-zero when the content does not resolve; it previously always exited 0.Testing
How to test:
bun run test:unitinpackages/cli: 411 tests, including the version-gate cases.bun run dev lookup owner-of e2epoolns01 --env paseo-v2: passes "Checking dotNS protocol version" against Paseo, which declares1.0.0.bun run dev lookup name dotns(no--env): reads the Polkadot registry after the version check.Notes
Before tagging
v1.0.0: create thereleasesenvironment with a required reviewer and the "release tags" ruleset forv*(repository settings). After the release, add the breaking changes above to the GitHub release, and enable release immutability.After the release, add the breaking changes above to the GitHub release, starting with the MainNet default.