Hi all,
Every xwiki-platform release since 18.0.0 publishes the packages of xwiki-platform-node on npmjs.com. Today that is 66 @xwiki/platform-* packages, and we introduce new package regularly.
npm announced that from January 2027, tokens with “Bypass two-factor authentication” can no longer publish. They can only stage a publish, and a human must approve it with 2FA.
Our release process currently rely on this bypass, so we need to adapt it before the end of the year.
See below how I suggest adapting the release process to these new constraints.
Current release process
- The release manager (RM) creates a token with Bypass two-factor authentication (2FA) checked (see Release Plan Help).
maven-release.shasks all its questions first, then runsrelease:prepareandrelease:performunattended.- During
release:perform, thedeployphase ofxwiki-platform-noderunspnpm -r publish(which uses the token defined previously). - If the release restarts after the npm step,
SKIP_NPM_PUBLICATION=trueavoids publishing twice.
Proposal
The release manager approves the npm publication with their own 2FA, in the browser, at the end of the release.
- The release manager creates the release token as today, but Bypass two-factor authentication (2FA) stays unchecked.
- Maven no longer publishes to npm for release versions. Snapshots keep going to our Nexus as today (see rational below)
- After
release:performsucceeds,maven-release.shruns the pnpm publication. pnpm prints a link to a form where the RM input their 2FA code and checks the option to use the same code for the next 5mns (avoid inputting 66 codes, currently a single code is required, a second one might be needed if we increase a lot the number of packages and/of if the publication is slow)
Each RM keep using npm account, nothing change on this aspect.
The main change is that a human intervention to input a code is required near the end of the release script.
Motivations to move the npm publication step outside Maven
- Improved error handling. Today a failed npm publication fails the whole
release:perform. As a separate last step, the release manager only reruns that step. - It is a first step away from the monolithic
xwiki-platform-nodemodule. Today every npm package must live in that module, because its Mavendeployphase publishes them. Once the publication no longer depends on that module, the packages can move closer to the code they belong to.
Options not retained
Staged publishing
When I tried I found the UX awkward and unless I missed something, required one manual intervention per package (66+). I did not explore this direction further as the 2FA link option proposed above is satisfying.
2FA in the terminal
(p)npm also offer the possibility to input the 2FA code in the terminal instead of the browser. I tried it and found some limitations (e.g., rate limited errors) that did not occur with the web link option.
I did not explore this direction further as well, as the 2FA link option proposed above is satisfying.
Trusted publishing
A trusted mechanism exists, simplifying the whole process, but only available for GitHub Actions, GitLab.com and CircleCI cloud runners.
As I believe we want to keep the whole release process inside the release machine, I currently consider this option out of scope.
Conclusion
Here’s my +1.
Thanks for reading.