Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You want to propose a change for a community release.

There are few different scenarios here, and few different moving parts. Once you get the hang of it, though, this should feel like a quick & easy process.

Making a change that also belongs on master (a “backport”)

...

Backporting to a library repository

Note

This can seem complicated the first time you do it. Reach out to #wg-build-test-release if you need help!

  1. Ensure the change is already merged to master and released to PyPI/NPM.

  2. Identify the top-level repository(s) that install this library – searching the package name in GitHub search can help. We’ll call these the dependent repositories.

  3. Determine whether you should upgrade the named release to the latest library version or cut a backports release. If you’re unsure, the latter is always safer.

    1. Check whether the library already has a backports branch

    already
    1. for this release: git log XXX-backports (where XXX is the release name). If so,

    jump
    1. you should use this branch. Jump directly to

    “Cut
    1. Cutting a backports release

    1. .

    Determine whether you can simply upgrade the named release to use the latest version of this library.

    1. For each dependent repository, identify the version of the library that is used on open-release/XXX.master – we’ll call that version A. If different versions of the library are used across top-level repositories, take the smallest A.

    2. Identify the latest version of the library, which should have your change on it. Let’s call it B.

    3. Look at the changeset between A and B. You can do this with GitHub: https://github.com/openedx/<library_repo>/compare/<A>...<B>.

    4. Do you feel comfortable backporting that entire changeset to each dependent repository in the named release?

      1. If so, then open jump to Upgrade to the latest library version.

      2. If not, continue on to Cut a backports release.

  4. Upgrade to the named release latest library version:

    1. Open a PR in each dependent repository to upgrade the library to the latest version

      & tag

      .

    2. Tag people for review & merge your PR(s).

    3. You’re all set

      .If not, continue on to “Cut

      !

  5. Cutting a backports release

    ”.

    :

    Cut a backports release:

    1. Find the commit hash(es) of the fix you need from master. They might be the same as in the fix pull request you are copying from, or they may be different if the pull request was closed with a squash. The best thing to do is to update your master branch, and get the hashes shown in your local git log:
      $ git logCheck out a version of the library that is similar to what dependent repositories are using for this named release. We’ll call this the base version.

    2. In the library repository, check out or create the backports branch:
      $ git switch XXX-backports && git pull # if the branch already exists
      $ git switch -c XXX-backports && git push -u origin XXX-backports # if it doesn't

    3. Create your own branch, based on the backports branch:
      $ git switch -x <YOURNAME>/<BRANCHNAME>

    4. Cherry-pick the commits onto your branch. Do this for all your commits:
      $ git cherry-pick -x <COMMITHASH> ...

    5. Update the version number to one that is similar to the base version, but not already taken by another release of the library. It should not exceed the latest library version number, because that would be confusing. Bumping the patch version is generally appropriate. Use your best judgement. We’ll call this the latest backports version.

    6. Push your branch:
      $ git push -u origin HEAD

    7. Make a pull request from your branch, using XXX-backports as the base. In your pull request description, mention the original pull request on master that you are copying, if you can.

    8. Tag people for review . The pull request will be handled and merged like any other.

If the change is being copied from master

...

    1. & merge your PR.

    2. Open a PR in each dependent repository to upgrade the library to the latest backports version. Tag people for review & merge your PR(s).

    3. You’re all set!

Making a change that is special to the named release

Changing a top-level repository

If your change should only be made on the named release branch of a top-level repository, there is nothing special to do. You make a change and create a pull request. The only difference is that the base of the pull request should be open-release/XXX.master instead of master. Explain in your pull request description why this should be a release-only change and doesn’t apply to master.

Changing a library repository

If your changes to a library should only be reflected in a named release, then refer to the Cutting a backports release step within the Backporting to a library repository process above. Instead of cherry-picking commits from master, though, just apply your special release-only changes and propose them in PR to the XXX-backports branch.

Explain in your pull request description why this should be a release-only change and doesn’t apply to master.

...