Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

fix(ci): fetch remote changes before pushing ref and tag with shipjs #3533

Closed
wants to merge 1 commit into from

Conversation

dhayab
Copy link
Member

@dhayab dhayab commented Jun 21, 2022

Summary

On rare occasions, the release process orchestrated by Ship.js cannot be completed if the local main branch and its remote counterpart are not in sync, when an unrelated PR is merged just after a release is started for instance (see most recent example).

This is not critical, but it can be a bother as the latest git tag won't be pushed to the remote, and the releases list on GitHub will not be updated too.

This PR addresses the issue by performing a rebase onto the main branch in order to sync them before performing the git tag operation.

Result

The release process should now be more resilient to this kind of issue.

@dhayab dhayab requested review from a team, FabienMotte and sarahdayan and removed request for a team June 21, 2022 14:32
@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 0b54825:

Sandbox Source
algolia/create-instantsearch-app Configuration
routing-basic Configuration
hooks-example Configuration

@netlify
Copy link

netlify bot commented Jun 21, 2022

Deploy Preview for react-instantsearch ready!

Name Link
🔨 Latest commit 0b54825
🔍 Latest deploy log https://app.netlify.com/sites/react-instantsearch/deploys/62b1d63e7561680009ccebe7
😎 Deploy Preview https://deploy-preview-3533--react-instantsearch.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Comment on lines +60 to +63
// Make sure the local branch is in sync with remote
// before pushing the ref and the tag on it
afterPublish: ({ exec }) =>
exec('git fetch && git rebase origin/master master'),
Copy link
Contributor

Choose a reason for hiding this comment

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

should this change maybe be made in shipjs itself?

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right, that would be better. I'll apply the fix there.

@dhayab dhayab closed this Jun 21, 2022
@dhayab
Copy link
Member Author

dhayab commented Jun 21, 2022

Moved fix to algolia/shipjs#983.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants