Understanding the Branch Workflow

Branches on the ActiveState Platform allow users to have more flexibility to work with complex projects. Branches bring support for experimental builds, managing complex multi-platform projects, different builds per environment, and more.

You must be on a paid tier to take full advantage of the branch feature. For more information on pricing: https://www.activestate.com/solutions/pricing/

alt text

Create a branch

Branches afford new types of working, and the potential benefits of working with a branched system include:

  • Working on a number of different ideas in progress at any time – including those requiring packages that are not part of your original project.
  • Collaborating on a complex project with a base set of common packages, but with slight platform differences between branches.

Changes made on a branch are localized, so you can safely experiment on other branches without impacting your main branch.

Using the Platform

  1. Login to the ActiveState Platform.

  2. Open any of your existing projects.

  3. Click the Configuration tab.

    • You will notice shows you are on the main branch.
  4. Click on Manage (or go to Project Settings and click Branches to view the current branches).

    • You can now add a new branch of the Main branch.
  5. Click on Add Child and name your branch before clicking Add.

    • You can add associated “Child” branches to the main branch, or other Child branches in the project.
  6. If successful, you will see your new child branch in the UI:

Using the State Tool

  1. Navigate to your project path in your Terminal.

    • If you are using a private project, remember to authenticate using state auth.
  2. Activate your project using state activate.

  3. Review the current branch you are in using state branch, which should default to main.

  4. To create a child off your main branch, use state branch add <child-branch-name>.

  5. To switch to your branch, use state branch add <child-branch-name>.

alt text

Updating a branch

The ActiveState Platform will notify you when a child branch has updates available from its parent branch.

If the main branch has been updated (by you or another authorized owner), your branch will get a notification that you can update it to keep in line with the main branch.

This is especially useful when:

  • Vulnerabilities were found in a package and expose a security risk
  • A proven package needs to be added that all users would benefit from

Using the Platform

  1. Go to the main branch of your project.
  2. Make any change that would trigger a commit.
    • For example: Add a new package to the project.
  3. Commit the changes.
  4. Select the Child branch.
    • On to the Child branch you will see a notification to Update:
  5. Click on the Update button will show you the changes between your branch and the Main branch and you can choose to click on Update
    • This will trigger an automated commit with the description “Merged upstream changes”.

Using the State Tool

  1. The State Tool currently does not allow merging upstream changes into a child branch.

Switching Branches in the State Tool

  1. In your shell, type state branch switch <branchName> to change branches.

alt text

Download builds from branches

Using the Dashboard

  1. Under the “Download Builds” tab, go to the branch dropdown.
  2. Select your branch from the drop down:
  1. Copy the terminal command line:
  1. Run it in your local environment via Terminal or Cmd, or click on the Download button under Download Installer to copy the entire project into your local directory.

Using the State Tool

  1. Run state activate <orgName/projectName> --branch <branchName>