-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workflows: Fix issues with the npm publishing workflow when using locally #53565
Conversation
Size Change: 0 B Total Size: 1.51 MB ℹ️ View Unchanged
|
This seems OK. One question though. In the past when doing security releases, if there were a network issue, Lerna would be confused and would not recognize that there were changes to publish. To fix, it required merging a small change to the packages that did not publish followed by going through the process again. Would this encounter that problem? Or has Lerna become smarter about that type of thing? |
@desrosj, I believe the |
When adding a new change to the package, you essentially create another version for the package. Learn has a native way to resume failed publishing that we tested and documented in the past: Learn internally uses two steps for npm publishing which uses native npm commands: |
7146281
to
a6356c8
Compare
I'm going to land it so we can use it locally as we still need to iron out the automated publishing after Node and npm upgrade. Yesterday, npm publishing after Gutenberg RC1 failed on |
What?
WordPress publishing to npm failed last week after the Gutenberg plugin 16.4 RC1 last week. @luisherranz noticed that there are now updates available on npm, and after some investigation, I located the job that filed https://github.com/WordPress/gutenberg/actions/runs/5741376252/job/15561635704 with the following error:
Why?
It isn't the first time that we experienced network issues, but previously they happened only with npm. This time it was GitHub that had some connection issues. I had to run the process manually from my machine using the following command
I saw the following issues introduced with the refactoring performed in #45255:
How?
I updated git operations to work on my machine by trying different configurations. I don't know if it's optimal but I was able to move forward with that part.
I also added a single re-try for npm publishing in case npm has network issues. We experienced it several times in the past, and @Mamaduka suggested we add some fallback for that. I used the command documented in https://github.com/WordPress/gutenberg/blob/trunk/docs/contributors/code/release.md#synchronizing-the-gutenberg-plugin that we use whenever that happens.
There is additional logging included that print Node.js and npm version.Moved to #53628.trunk
uses now Node 16/npm 8, while the release branch for 16.4 is on Node 14/npm 6. The issue I encountered was thatnpm ci
exploded the script because the branch enforces npm 6 while the script is running now with npm 8. I will file a separate issue for that as we need to find a solution how to use GitHub UI to run backports for WordPress 6.3 and other older versions that will experience the same issue.Testing Instructions
That part is tricky because it requires performing going through the full npm publishing process. There is nothing to publish at the moment with:
I executed it yesterday, and everything went well. I can confirm that the changes resolve both issues listed.
However, it is possible to run the development version of publishing with the following:
It requires access to WordPress organization on npm and being logged in to npm before executing the script. It also requires write access to the Gutenberg repository.