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

WB-586: Add changesets to automate the release process #1221

Merged
merged 9 commits into from
Dec 6, 2021
Merged

Conversation

jandrade
Copy link
Member

@jandrade jandrade commented Nov 16, 2021

Summary:

  • Introduces changesets to the repository.
  • Adds a new workflow to handle releases. This will be triggered after
    the "release coordinator" (one of WB's admins) has approved the
    release (by hitting the Merge button).
  • Creates a new release script to handle releases using changesets
    instead of lerna. (keeping lerna/publish for backwards compatibility).

More info about the new release process here:
https://www.figma.com/file/xaYyzIuKLxqXAJVAl3y1S4/Wonder-Blocks-Web-Eng-process?node-id=50%3A400
Wonder Blocks Web Eng process

NOTE: To include a regular PR in the release PR, the PR's author will
need to run yarn changesets to include the changes for each package
they have changed.

More info about using it on this part of the process here: https://www.figma.com/file/xaYyzIuKLxqXAJVAl3y1S4/Wonder-Blocks-Web-Eng-process?node-id=81%3A549

Issue: WB-586

Test plan:

Merge this PR and verify that the "Release PR" gets created after a
contributor lands a PR (merges it into master).

Here's an example of how the Release PR will look: emotion-js/emotion#2394

Summary:

- Introduces `changesets` to the repository.
- Adds a new workflow to handle releases. This will be triggered after
  the "release coordinator" (one of WB's admins) has approved the
  release (by hitting the `Merge` button).
- Creates a new `release` script to handle releases using `changesets`
  instead of `lerna`. (keeping `lerna/publish` for backwards compatibility).

More info about the new release process here:
https://www.figma.com/file/xaYyzIuKLxqXAJVAl3y1S4/Wonder-Blocks-Web-Eng-process?node-id=50%3A400

NOTE: To include a regular PR in the release PR, the PR's author will
need to run `yarn changesets` to include the changes for each package
they have changed.

More info about using it on this part of the process here: https://www.figma.com/file/xaYyzIuKLxqXAJVAl3y1S4/Wonder-Blocks-Web-Eng-process?node-id=81%3A549

Issue: https://khanacademy.atlassian.net/browse/WB-586

Test plan:

Merge this PR and verify that the "Release PR" gets created after a
contributor lands a PR (merges it into `master`).
@jandrade jandrade self-assigned this Nov 16, 2021
@jandrade jandrade requested a review from a team November 16, 2021 22:45
@changeset-bot
Copy link

changeset-bot bot commented Nov 16, 2021

⚠️ No Changeset found

Latest commit: 06d364e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Nov 16, 2021

✔️ Deploy Preview for wonder-blocks ready!

🔨 Explore the source changes: edf3d58

🔍 Inspect the deploy log: https://app.netlify.com/sites/wonder-blocks/deploys/61943476ccce220007346f21

😎 Browse the preview: https://deploy-preview-1221--wonder-blocks.netlify.app/

@khan-actions-bot
Copy link
Contributor

Gerald

Required Reviewers
  • @Khan/frontend-infra for changes to package.json, yarn.lock, .changeset/README.md, .changeset/config.json, .github/workflows/release.yml

Don't want to be involved in this pull request? Comment #removeme and we won't notify you of further changes.

@netlify
Copy link

netlify bot commented Nov 16, 2021

✔️ Deploy Preview for wonder-blocks ready!

🔨 Explore the source changes: 0445964

🔍 Inspect the deploy log: https://app.netlify.com/sites/wonder-blocks/deploys/619434fb3dcb2400083e856b

😎 Browse the preview: https://deploy-preview-1221--wonder-blocks.netlify.app

@github-actions
Copy link
Contributor

github-actions bot commented Nov 16, 2021

Size Change: 0 B

Total Size: 96 kB

ℹ️ View Unchanged
Filename Size
packages/wonder-blocks-breadcrumbs/dist/es/index.js 1.33 kB
packages/wonder-blocks-button/dist/es/index.js 3.45 kB
packages/wonder-blocks-clickable/dist/es/index.js 6.01 kB
packages/wonder-blocks-color/dist/es/index.js 1.26 kB
packages/wonder-blocks-core/dist/es/index.js 7.08 kB
packages/wonder-blocks-data/dist/es/index.js 7.35 kB
packages/wonder-blocks-dropdown/dist/es/index.js 16.9 kB
packages/wonder-blocks-form/dist/es/index.js 6.34 kB
packages/wonder-blocks-grid/dist/es/index.js 3.08 kB
packages/wonder-blocks-icon-button/dist/es/index.js 2.65 kB
packages/wonder-blocks-icon/dist/es/index.js 3.31 kB
packages/wonder-blocks-layout/dist/es/index.js 3.15 kB
packages/wonder-blocks-link/dist/es/index.js 1.89 kB
packages/wonder-blocks-modal/dist/es/index.js 9.13 kB
packages/wonder-blocks-popover/dist/es/index.js 6.96 kB
packages/wonder-blocks-progress-spinner/dist/es/index.js 1.59 kB
packages/wonder-blocks-spacing/dist/es/index.js 165 B
packages/wonder-blocks-timing/dist/es/index.js 2.86 kB
packages/wonder-blocks-toolbar/dist/es/index.js 908 B
packages/wonder-blocks-tooltip/dist/es/index.js 9.2 kB
packages/wonder-blocks-typography/dist/es/index.js 1.37 kB

compressed-size-action

@codecov
Copy link

codecov bot commented Nov 16, 2021

Codecov Report

Merging #1221 (06d364e) into master (9ebea88) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1221   +/-   ##
=======================================
  Coverage   96.33%   96.33%           
=======================================
  Files         147      147           
  Lines        3577     3577           
  Branches     1025     1025           
=======================================
  Hits         3446     3446           
  Misses        131      131           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e47ebcc...06d364e. Read the comment docs.

@netlify
Copy link

netlify bot commented Nov 16, 2021

✔️ Deploy Preview for wonder-blocks ready!

🔨 Explore the source changes: 06d364e

🔍 Inspect the deploy log: https://app.netlify.com/sites/wonder-blocks/deploys/61ae7f31cbca4c0007d99d13

😎 Browse the preview: https://deploy-preview-1221--wonder-blocks.netlify.app

Copy link
Contributor

@kevinbarabash kevinbarabash left a comment

Choose a reason for hiding this comment

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

I think it would be good to have an ADR to support this change. changesets looks like a great tool, but we should have documentation in confluence explaining why we picked this tool over other tools.

Comment on lines +5 to +6
branches:
- master
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean if a person wants to batch work together from multiple PRs before release, they'll need to land those PRs on to a non-master branch? If so, what impact does this have on our required checks?

Copy link
Member Author

Choose a reason for hiding this comment

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

hmm good question, for more clarification... do you mean about required checks at PR level? or when pushing to master?

Copy link
Contributor

@kevinbarabash kevinbarabash Dec 6, 2021

Choose a reason for hiding this comment

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

I originally thought the release process was automatically like it is with semantic-release, but that isn't the case with changesets because someone needs to create a release PR.. It looks like this workflow runs whenever anything is pushed to master. Is that right?

Copy link
Contributor

Choose a reason for hiding this comment

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

I chatted with Juan in Slack and learned that the action runs once to generate the PR if there's any changeset markdown files. This PR converts those markdown files to changelogs. Once the PR lands then the action runs a second time and will do the publish since there are no pending changeset markdown files.

"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this take into account whether that internal dep was bump by a patch, minor, or major version number?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's when we bump by patch.

@@ -0,0 +1,10 @@
{
"$schema": "https://unpkg.com/@changesets/config@1.6.2/schema.json",
"changelog": "@changesets/cli/changelog",
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there different tools that can be used to generate a change log file?

Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines +44 to +45
SLACK_USERNAME: GithubGoose
SLACK_ICON_EMOJI: ":goose:"
Copy link
Contributor

Choose a reason for hiding this comment

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

lol

.github/workflows/release.yml Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@jandrade
Copy link
Member Author

Here's the ADR: https://khanacademy.atlassian.net/wiki/spaces/ENG/pages/1878523905/ADR+523+Automating+the+release+process+on+Wonder+Blocks

Copy link
Contributor

@kevinbarabash kevinbarabash left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for taking the time to walk me through the process. I think I have a better understanding of it now.

@jandrade jandrade merged commit 1ceaec4 into master Dec 6, 2021
@jandrade jandrade deleted the changesets branch December 6, 2021 21:37
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