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 CLI for monorepo releases #8308

Merged

Conversation

tkajtoch
Copy link
Member

@tkajtoch tkajtoch commented Feb 4, 2025

Resolves https://github.com/elastic/eui-private/issues/136.

Summary

This PR adds a new release CLI for EUI monorepo. It reuses changelog calculation and versioning logic from the old release script and comes with a bunch more safety checks as well as monorepo workspaces awareness.

QA

  1. Checkout this PR - gh pr checkout 8308
  2. Install dependencies and build release CLI (to be automated) - yarn workspace @elastic/eui-release-cli run build
  3. Make sure you're logged out from npm - npm logout and double check with npm whoami
  4. Run a custom npm registry locally in a new terminal session - docker run -it --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio
  5. Update your local yarnrc to use the local registry for testing. Add the following lines to .yarnrc.yml
    npmRegistryServer: "http://localhost:4873"
    unsafeHttpWhitelist:
      - localhost
      - localhost:4873
    
  6. Login to the custom registry - yarn npm login
    1. Confirm the message says Logging in to http://localhost:4873
    2. There's no need to create an account, simply use the same username and password pair (e.g. test / test)
    3. Confirm you're logged in to the right registry with yarn npm whoami
  7. Add some changelogs to local packages, e.g., packages/eui/changelogs/upcoming and packages/eslint-plugin/changelogs/upcoming and commit them (temporarily so that the release script can proceed with its init checks)
  8. Run yarn release run snapshot --allow-custom
    • This command creates a snapshot release, meaning that it'll publish packages with the snapshot tag and will allow a release from non-main branch.
    • --allow-custom allows releasing code that's different from what's available upstream
  9. When asked if you want to proceeed, click Y
  10. When asked for an OTP token click Enter, as the local registry has no two-factor authentication configured and OTP is not needed
  11. Go to http://localhost:4873 and confirm @elastic/eui and @elastic/eslint-plugin-eui are published to the custom registry
  12. Clean up your environment
    1. Logout from the custom registry - yarn npm logout
    2. Remove added lines to .yarnrc.yml
    3. Stop the verdaccio server
    4. Reset your local branch to remote state to remove the temporary commits - git reset --hard

@tkajtoch tkajtoch self-assigned this Feb 4, 2025
@tkajtoch tkajtoch force-pushed the build/monorepo-releases-setup branch from 77a23ff to f9fbb27 Compare February 24, 2025 12:57
@tkajtoch tkajtoch changed the base branch from main to eui-theme/borealis February 24, 2025 12:57
@tkajtoch tkajtoch changed the title Add CLI for monorepo releases: checks, building and versioning Add CLI for monorepo releases Feb 24, 2025
@tkajtoch tkajtoch marked this pull request as ready for review February 24, 2025 13:12
@tkajtoch tkajtoch requested a review from a team as a code owner February 24, 2025 13:12
@mgadewoll mgadewoll self-requested a review February 24, 2025 13:18
@kibanamachine
Copy link

Preview staging links for this PR:

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @tkajtoch

Copy link
Contributor

@mgadewoll mgadewoll left a comment

Choose a reason for hiding this comment

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

🚢 🐈‍⬛ The changes look good to me and testing the releases locally worked as expected 🎉

@tkajtoch tkajtoch merged commit aa6ac6b into elastic:eui-theme/borealis Feb 28, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants