ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

Release tools: detect and handle the 409 error

Open pomek opened this issue 1 year ago • 0 comments

📝 Provide a description of the new feature

Sometimes, npm reports the following error while publishing the nightly packages.

npm notice === Tarball Details === 
npm notice name:          @ckeditor/ckeditor5-heading                            
npm notice version:       0.0.0-nightly-20240626.0                               
npm notice filename:      ckeditor-ckeditor5-heading-0.0.0-nightly-20240626.0.tgz         
...
npm notice Publishing to https://registry.npmjs.org/ with tag nightly and public access
npm ERR! code E409
npm ERR! 409 Conflict - PUT https://registry.npmjs.org/@ckeditor%2fckeditor5-heading - Failed to save packument. A common cause is if you try to publish a new package before the previous package has been fully processed.                     

The publishPackages() task rejected a promise when executing the npm publish command. After retrying execution several times (ref), CI publishes the same package thrice. It fails as the first call did the job even if the promise was rejected.

We need to be more innovative. Let's detect the 409 error suggesting publishing the same package twice.

Definition of Done

  • If a package lands on npm, do not publish it again. Instead, the task should resolve a promise.

Technical details

  • When npm publish fails, add a package to a stack and continue.
  • Once all packages are processed, review the stack.
  • For each package from the stack, see if it's published.
    pm show @ckeditor/[email protected]
    
    ckeditor/[email protected] | GPL-2.0-or-later | deps: 1 | versions: 506
    
  • If so, mark the package as processed successfully.
  • Otherwise, reject the promise.

Other details

No response


If you'd like to see this feature implemented, add a 👍 reaction to this post.

pomek avatar Jun 27 '24 09:06 pomek