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

feat(root): Changeset for automatic bump and much easier release on canary #1282

Open
wants to merge 5 commits into
base: canary
Choose a base branch
from

Conversation

gabrielmfern
Copy link
Collaborator

@gabrielmfern gabrielmfern commented Feb 5, 2024

Background

When we get something merged, be it canary or main, we always have to follow a few
set-in-stone steps that are very error-prone in every part of it, mostly painful because we
can't undo any mistakes we make when bumping or publishing versions.

If we think about the step-by-step to release and the ways we can fail:

  1. Create PR for versions bump
    • Can bumping a specific package
    • Can forget a bump of a dependent package along
  2. PR is merged
  3. Publish packages
    • Can forget to build before publishing
    • Can forget to add the tag for canary
  4. Create PR on the docs adding the changelog
    • Changelog won't be so precise when being written
    • Something will probably be forgotten in the process of writing

Besides these issues, we also have that it can take longer for someone to review the
PR for bumping and the PR for the changelog which can cause a lot of frustration
to users if we take too long to release a certain fix or feature that may be really needed.

How does this PR fix this?

This PR is proposing we do it using both changesets, a github action,
and their GitHub bot.

The proposed flow would be something like:

  1. Review & merge PR created by the GitHub action
  2. Run pnpm release
    • This would be a script that would look like
    pnpm build && pnpm changeset publish
  3. Copy from CHANGELOG.md into our docs's changelog and open the PR

In none of these steps, we would not have something fail here as the changeset would take care
of bumping all packages, and then the person who intends to release can review the bump themselves
which I don't think would be dangerous or harmful as the PR is not created by them,
and if they do make changes to it they won't be able to merge themselves.

This also has a few extra benefits, but most of all, it would improve our changelog.
It would do so because of a reason that gets clearer if we look at the complete
flow from task to release which would be something like:

  1. A PR is created by someone
  2. Github bot warns them about missing changeset
  3. User makes changeset with the information of what the PR changes fresh in their mind
    • I will admit we can miss a changeset of the improper type (patch, minor, major) here but this is much
      easier to be caught in comparison to the other issues
  4. PR is approved and merged
  5. Github action on canary creates a new PR bumping the versions
  6. Review & merge PR created by the github action
  7. Run pnpm release
    • This would be a script that would look likeoooo
    pnpm build && pnpm changeset publish
  8. Copy from CHANGELOG.md into our docs's changelog and open the PR

This is where mostly this is different from what we had from December 2022 because the changesets
would be done in the PRs themselves. This PR adds it in a bit of a safer way as well by just adding this
to be ran on the canary branch so that we can test this workflow out and verify it is good enough before actually going
with it into main.


If we do get this PR merged, we would need to add the GitHub bot as well which I can't do from a PR AFAIK.

Copy link

vercel bot commented Feb 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-email ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 15, 2024 2:32pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
react-email-demo ⬜️ Ignored (Inspect) Visit Preview Feb 15, 2024 2:32pm

@gabrielmfern gabrielmfern changed the title feat/setup changeset for auto bump and release feat(root): Changeset for automatic bump and much easier release Feb 5, 2024
@gabrielmfern gabrielmfern changed the title feat(root): Changeset for automatic bump and much easier release feat(root): Changeset for automatic bump and much easier release on canary Feb 5, 2024
@gabrielmfern gabrielmfern added the Type: Improvement An improvement, that is, changes to an existing feature that improve it label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Improvement An improvement, that is, changes to an existing feature that improve it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant