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

ci: add prerelease process #2561

Merged
merged 10 commits into from
Nov 28, 2022
Merged

ci: add prerelease process #2561

merged 10 commits into from
Nov 28, 2022

Conversation

btaillon-coveo
Copy link
Contributor

@btaillon-coveo btaillon-coveo commented Nov 22, 2022

https://coveord.atlassian.net/browse/KIT-2150

Divided & adapted from: #2553

We're not migrating the normal release process yet since I'm running out of time.

New prerelease process

Look at the README.md to know the new release process:

ui-kit/README.md

Lines 57 to 81 in 49021bb

## Prerelease
### To start a major prerelease (e.g., `1.2.3``2.0.0-pre.0`)
1. Make sure that `HEAD` refers to a version bump on `master`.
2. Create a new branch prefixed with `prerelease/` (e.g., `prerelease/headless_atomic_v2`).
3. Run `npm run bump:version:major-prerelease -- @coveo/package1 @coveo/package2 @coveo/package3`.
4. Push the new commit and its tags to the branch.
### Adding a new package to an already started prerelease
1. Checkout the prerelease branch.
2. Run `npm run bump:version:major-prerelease -- @coveo/package1` where `@coveo/package1` is the new package.
3. Push the new commit and its tags to the branch.
### Updating a prerelease branch
1. Wait for `master` to reference a version bump.
2. Pull changes from `master` into the prerelease branch.
### Officially releasing (e.g., `2.0.0-pre.15``2.0.0`)
1. Create a pull request from the prerelease branch to “master”.
* Associate with a Jira issue which QA will use to validate.
* Update the changelogs manually, adding all the changes from the last release to the new release.
* Update all dependents to use the prerelease version (include the `-pre.` suffix).
2. Wait for `master` to reference a version bump.
3. Squash as a version bump.
* You can copy the title & description of the last version bump commit on the prerelease branch.
* You must add the link to the Jira issue at the beginning of the description.

Changes in this PR

  1. Added a bump:version:major-prerelease script to the root package.json
    • This script will create a major prerelease version bump on the current branch, and will give it all the appropriate tags, but won't push it.
    • The commit will contain the same message that lerna gives version bumps, including [skip-ci].
    • Changelogs aren't updated.
  2. Non-bump commits on a prerelease/** branch now trigger the same CI as master, except:
    • Only packages matching /pre\.[0-9]+$/ are upgraded.
      • If a dependent is out of scope (doesn't match the above version pattern), its dependencies won't be upgraded.
    • Changelogs aren't updated.
  3. Bump commits on a prerelease/** branch now trigger the same CI as master, except:
    • Only packages matching /pre\.[0-9]+$/ are published to NPM.
    • The alpha tag on NPM isn't updated.
    • The package rollout stops at the dev environment.

Other details

@btaillon-coveo btaillon-coveo requested review from a team as code owners November 22, 2022 14:47
@btaillon-coveo btaillon-coveo requested review from olamothe, ThibodeauJF, lvu285 and wmannard and removed request for a team November 22, 2022 14:47
@github-actions
Copy link

Pull Request Report

PR Title

✅ Title follows the conventional commit spec.

Bundle Size

File Old (kb) New (kb) Change (%)
case-assist 216.1 216.1 0
search 312.2 312.2 0
insight 258.2 258.2 0
product-listing 229.6 229.6 0
product-recommendation 213.8 213.8 0
recommendation 213.9 213.9 0

scripts/git.mjs Outdated Show resolved Hide resolved
scripts/exec.mjs Outdated Show resolved Hide resolved
scripts/packages.mjs Outdated Show resolved Hide resolved
scripts/packages.mjs Outdated Show resolved Hide resolved
scripts/packages.mjs Outdated Show resolved Hide resolved
scripts/packages.mjs Outdated Show resolved Hide resolved
scripts/prerelease.mjs Outdated Show resolved Hide resolved
@ThibodeauJF
Copy link
Contributor

Just making sure that this branch should be merged in master first #2556 (before merging this one) We could also trying out the dep pipeline as soon as its merged

Base automatically changed from KIT-2114-convert-scripts-to-esm to master November 24, 2022 14:12
@btaillon-coveo
Copy link
Contributor Author

btaillon-coveo commented Nov 25, 2022

TODO: also bump versions in private packages

Update: I'm not gonna bump private packages, since it looks like the CI didn't bump them in the first place, and it makes npm install fail. Manually updating package-lock.json doesn't resolve the issue.

Copy link
Collaborator

@louis-bompart louis-bompart left a comment

Choose a reason for hiding this comment

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

lgtm overall, tho I don't know/understand all the process because well I'm not familiar with it

@btaillon-coveo btaillon-coveo merged commit a8052b2 into master Nov 28, 2022
@btaillon-coveo btaillon-coveo deleted the KIT-2114-add-prerelease branch November 28, 2022 14:26
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.

None yet

4 participants