Skip to content
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

Fix automated releases #13834

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix automated releases #13834

wants to merge 1 commit into from

Conversation

msujew
Copy link
Member

@msujew msujew commented Jun 20, 2024

What it does

Updates our GitHub actions to retry in case they hit network related errors like rate limiting. This was also used in the old next publishing action:

- name: Publish NPM
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
retry_wait_seconds: 30
max_attempts: 3
retry_on: error
command: yarn publish:next
on_retry_command: git reset --hard
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # The variable name comes from here: https://github.com/actions/setup-node/blob/70b9252472eee7495c93bb1588261539c3c2b98d/src/authutil.ts#L48

Also removes the --canary option. That should hopefully fix the issue of unexpected minor versions (we currently publish all next releases as 1.46.0-next).

How to test

Nothing to test, we need to see whether it will work now :)

Review checklist

Reminder for reviewers

@msujew msujew added the repo issues specific to the repository label Jun 20, 2024
@msujew msujew requested a review from jfaltermeier June 20, 2024 13:06
retry_wait_seconds: 30
max_attempts: 3
retry_on: error
command: yarn publish:latest -- ${{ inputs.release_type }} && yarn publish:check
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The publishing guide recommends using a specific command in case of publishing errors:
https://github.com/eclipse-theia/theia/blob/master/doc/Publishing.md#failures-during-publishing
npx lerna publish from-package --no-git-reset --no-git-tag-version --no-push

I'm not familiar with the reasoning behind this choice. Maybe @vince-fugnitto could provide some insight?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jfaltermeier in the past we often encountered NPM socket errors which meant that only a subset of extensions were successfully published. In this state we cannot re-perform the publishing as it would fail with a message that the extension was already published. In order to only publish the extensions which were not previously published we manually ran the steps referenced in failure-during-publishing to continue with the release.

It's possible that the proposed workflow will fail when retrying if we are in a state where we partially published extensions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we run git reset --hard in between retries, running lerna publish from-package is not necessary. Just repeating the publish:latest command should work as expected. I don't think we need to adjust something.

Also, having two separate commands in the CI (for normal publishing + publishing following an error) would make this more complicated to maintain imo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
repo issues specific to the repository
Projects
Status: Waiting on reviewers
Development

Successfully merging this pull request may close these issues.

3 participants