Skip to content

Instantly share code, notes, and snippets.

@dcolley
Created June 7, 2023 09:38
Show Gist options
  • Save dcolley/8b1e6bd32a3a55b660834e8d4ce8d009 to your computer and use it in GitHub Desktop.
Save dcolley/8b1e6bd32a3a55b660834e8d4ce8d009 to your computer and use it in GitHub Desktop.

Release Management

Goals

We need to release our tools and libraries in a way that is easy to use and contribute.

  • github.com for issues and pull requests
  • git for version control
  • Git branching model
  • Git Release management[?]

Branch vs Release

Git Branching Model

Branches:

  • master
    • production ready, latest stable release
    • default branch for git clone
    • merge from hotfix or release branches
    • no PRs?
  • hotfix branches
    • r0.1.0[-hotfix1]
    • bug fixes to master
    • merge from master
  • release branches
    • r0.1.0[-rc1] - release candidate
    • r0.2.0 - release branch
    • allows for bug fixes to be applied to a release
    • merge from develop
  • develop (could be called next)
    • latest development changes
    • merge from hotfix (forward-porting)
    • merge from feature branches
    • clone this branch for small changes and bug fixes
  • feature branches
    • new features in development that contain breaking changes
    • merge bugs from develop (from time to time, prior to merge to develop)

Git Release

Do we need this? We are not proposing to distribute binaries, so we don't need to tag releases. We should ship bootless binaries (with versions to match upstream)

Resources

@dcolley
Copy link
Author

dcolley commented Jun 7, 2023

Creating a Release branch from develop

Make sure you are on the develop branch
Select branch dropdown and type in the name of the new release.
Select Create branch < BRANCHNAME > from develop

image

@dcolley
Copy link
Author

dcolley commented Jun 7, 2023

Merging the release branch into main

Click Open Pull Request

image

Then save the PR
image

Request a review from a core developer
image

@kukabi
Copy link

kukabi commented Jun 7, 2023

A few notes from me:

  • I think we should definitely have release tags, and GitHub releases with auto-generated list of commit messages from the last release until the current one. It's great for reference. main should be the release branch.
  • Using slashes in branch names such as hotfix/some-hotfix-name or feature/feature-name displays very fine on some UI tools such as Sourcetree. This way one is able to display all hotfixes/features/etc. under a directory on the UI.
  • Do we have to prefix branch/tag names with r? I saw v before (Parity uses it), but I think it's unnecessary. Plain version number is enough imo.
  • Feature branches and and any other branches that branch off from main or develop should always be kept rebased on the origin branch so that we keep the correct history of commits when we merge.
  • Squashing commits on PRs to a single commit is useful and clean in most cases.
  • Following the previous, and I know I violated this one quite a bit before, but PRs should small when possible.

@paulormart
Copy link

I agree, tags are a requirement to trigger a release - we can have github workflows to automate a release as soon as a tag is pushed to the main repo. As an example if useful here

In terms of the flow to create a tag i took some ideas from the gitflow example to this script here

There is also a similar script in polkadot main repo here to automate tags creation.

@dcolley
Copy link
Author

dcolley commented Jun 8, 2023

ok, moved this to ibp-network/ibp-monitor#60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment