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

add: changesets + snapshot-this action #1746

Merged
merged 3 commits into from
Jun 30, 2022
Merged

Conversation

zakariaelas
Copy link
Contributor

@zakariaelas zakariaelas commented Jun 28, 2022

What

  • adds changesets to the monorepo
  • adds a snapshot-this.yml action which will automatically create a snapshot release of any PRs whenever someone with write access to the repo comments "/snapshot-this" in the PR.

Why

  • One of the best ways to completely move away from the old release workflow is to start adopting the changesets workflow slowly and incrementally. I think the better ways to do this could be through manually triggered automated workflows like this one. With this in mind, I thought it would be nice to try to solve a problem we've had in the past: publishing a PR to npm for faster development and a quicker feedback loop.

How

  • How the snapshot-this gh workflow works: The workflow reacts to issue comments. More specifically, to comments having "/snapshot-this" as body. So given a PR which contains a changeset, when someone with write privileges to the medusajs repo comments /snapshot-this, the action will attempt a snapshot release of the current branch to NPM. Once that done, the action will comment on the PR with the published packages. Picture below captures this:

image

Note and next steps

  • To test the action, snapshot-this.yml will need to be added to the main branch (which I think is master). We'll also need an NPM_TOKEN secret for publishing the snapshots to NPM. However, I am hoping to use this PR to kick off the discussion and get some opinions on the approach/strategy we'll use to move away from lerna and improve our release workflow.
  • If this goes through, we'll also need to install the changesets github app which is a nice bot that, among other things, can remind you to include changesets in PRs. Thanks @pKorsholm for the reminder!

Copy link
Contributor

@pKorsholm pKorsholm left a comment

Choose a reason for hiding this comment

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

Amazing as always Zak.
I love the snapshot-this command, just like with Kodiak it's a great step in the right direction without giving up too much control, and actually limiting the canaries to whatever pr's they are relevant for

One thing to note (not a comment to the code specifically), is the potential inclusion of the changesets github bot: https://github.com/apps/changeset-bot

This could help us enforce the use of changesets in the prs as well

Copy link
Collaborator

@srindom srindom left a comment

Choose a reason for hiding this comment

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

LGTM! Let's get this in!

@srindom srindom merged commit 55978e9 into develop Jun 30, 2022
SGFGOV pushed a commit to SGFGOV/medusa that referenced this pull request Jul 1, 2022
* add: changesets + snapshot-this action

* add: changeset folder

* add: action credits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants