npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@atlaskit/branch-deploy-product-integrator

v4.1.1

Published

Installs branch deployed atlaskit packages into products to run product CI.

Downloads

73

Readme

@atlaskit/branch-deploy-product-integrator

This is a CLI that integrates atlaskit branch deploys into products.

Integrating atlaskit branch deploys into products allows us to leverage their CI to:

  • detect any errors that occur in product CI before they are released
  • obtain product branch deploys that can be used to test AK changes in a staging environment within products

The tool is run in two ways:

  1. Automatically as part of integrator bamboo builds for certain products
  2. Manually, required to resolve merge conflicts that cannot be resolved automatically by the tool

Usage

Run branch-deploy-product-integrator --help for usage details.

The main functionality is under the push command.

How it works

On the first run, in its most basic form, it:

  1. Creates a branch in a product repo corresponding to a branch in atlassian-frontend
  2. Installs an atlaskit branch deploy using a supplied commit hash
  3. Pushes the branch

On subsequent runs, it reuses the same product branch so that any manual commits, made to fix product CI, are not lost. Example manual commits could be:

  • Updating API of a component after a breaking change
  • Fixing incorrect types that are now revealed after component API types are fixed
  • Fixing issues in product test framework or helper methods that are exposed by a change in component behaviour

Since we reuse the same branch, we need to be careful of previously installed branch deployed versions of atlaskit packages lingering around from a previous run. To alleviate this, we reset package.json, yarn.lock and all workspace package.json back to their version on master before installing the latest branch deploy.

Subsequent runs also merge the latest master branch in product into the integrated branch so that it does not fall out of date, which is especially important for long living atlaskit branches such as develop.

Because we merge master into the integrated branch, there is a chance that merge conflicts arise. We can resolve any conflicts in package.json's & yarn.lock by resolving to the version on master since we reset them back to master anyway before a branch install. However, because manual 'fix' commits can occur as described above, there is a possibility that a merge conflict occurs in other files that we cannot resolve automatically. In those cases, the tool must be manually run as described below in Resolving merge conflicts.

Manually resolving merge conflicts

You will need to manually resolve merge conflicts that cannot be automatically resolved by the tool. This is pointed out in the error message of an integrator ci build that encounters these. Merge conflicts should only need to be resolved manually if you have made a manual fix commit to your branch. If you haven't, then reach out to the afp team in #atlaskit-build as it may be an issue with this integrator CLI itself.

To resolve merge conflicts manually, perform the following steps:

  1. Checkout and setup the product repo locally (nvm, install node_modules). See here for a list of the product repos.
  2. Globally link this tool by running the following in atlassian-frontend:
$ cd packages/monorepo-tooling/branch-deploy-product-integrator
$ yarn link
  1. In the product repo, run the tool with your atlaskit branch name and the commit hash of the last commit of the branch:

NOTE: You may want to double check you're passing all the relevant flags, you can cross-reference the command with what is being executed in services/bamboo-templates/branch-deploy-integrator/install-branch-deploy.sh. You can ignore the --productCiPlan related flags.

$ branch-deploy-product-integrator push <atlaskitBranchName> <atlaskitCommitHash> --packageEngine <bolt/yarn>

You can also add the --no-push argument if you would like to prevent the tool from pushing the commits after resolving, if you want to inspect them before doing so.

  1. Once the tool encounters unresolvable merge conflicts, it will provide a prompt, asking you to resolve the merge conflicts manually. Resolve all unmerged conflicts manually and stage them in another terminal (e.g. git add).
  2. Answer the prompt to let the tool continue the integration process
  3. If all went well, it should have successfully commited the merge conflicts, installed the latest branch deploy and pushed the changes. If you used --no-push, you will need to manually push the changes yourself with git push.

Development

There are two main modes of development, testing the CLI locally and testing in conjunction with our integrator bamboo builds.

To test with our integrator bamboo builds, follow the development steps in services/bamboo-templates/branch-deploy-integrator.

To test the CLI locally, we adopt the same method as when running manually.

  1. Cd into this package
  2. Run yarn link. The tool is now globally linked and can be run in a product repo. Use the --no-push argument to ensure it does not push.

You can also debug by running node --inspect-brk /usr/local/bin/branch-deploy-product-integrator ... and attaching via chrome inspector or vscode debugger.

We have some unit test stubs, and ideally it would be good to have integration tests as well, feel free to contribute :)