Skip to content

Latest commit

 

History

History
321 lines (239 loc) · 13.4 KB

File metadata and controls

321 lines (239 loc) · 13.4 KB

Releasing shields.io

This document describes the process for releasing Dagger.

Let the team know

Before you go ahead and produce a new release, remember that it's a team effort. The first step is to let the team know what is going to happen, preferably a few days in advance so that they can react. We do our release threads in public wherever possible, to give the community more visibility, and to help external contributors to more easily keep in sync with the release cadence.

To let the team know:

This allows others to weigh in whether:

  • we should go for a patch / minor bump
  • there are any PRs that people are waiting to get merged
  • any big features which need to remain experimental?
  • etc.

Maybe there are breaking changes which we should be aware of and message accordingly. Giving other team members a day or two to react - because timezones! - will make this entire process smoother.

  • If doing a minor release, determine if there are any deprecations that can be removed.

Backwards compatibility

Where possible, we try to ensure backwards compatibility between mismatched cli and engine versions. However, for technical reasons, this isn't always possible: sometime the communication protocol changes, or a bug fix or new feature requires changes on both the CLI and the engine.

Before releasing, make sure to sanity check the backwards compatibility of a release. If you encounter issues, then:

  • Add a release note using changie new (or add it later manually).
  • Bump the minimum version numbers in engine/version.go.

If unsure, bump both the client and engine minimum version numbers, but if the backwards compatibility is only an issue in one direction, you only need to bump that one.

Improve this doc while releasing 改善

In order to keep this relevant & accurate, we improve this doc during the release process. It's the best time to pause, observe how it all fits together, and improve it. We want small, constant improvements which compound. Therefore:

  • Save a copy of this doc outside of this repository (e.g. ~/Downloads/RELEASING.md). Now open that copy in your editor and start ticking items off it as you make progress. Remember to add / remove / edit any parts which could be improved.
  • Update the date in the shields.io badge, first line in this file.

Workflow for releases off non-main branch

Warning

There are no additional instructions for this, since this hasn't been done in a while.

Exercise caution!

Required tooling

Before starting the releasing process, make sure you have your local environment setup and ready to go. You'll need (at least) the following tools - though you probably already have most of them if you're regularly contributing to dagger.

📝 Preparation

  • Setup some variables used throughout the release process:

    export RELEASE_BRANCH=main
    export DAGGER_REPO_REMOTE=$(git remote -v | grep -E "(github.com.dagger/dagger)" | head -n 1 | awk '{print $1}')

Note

This process involves direct pushes to the github.com/dagger/dagger repository. Recently there have been permission issues here that result in errors like

refusing to allow an OAuth App to create or update workflow when pushing.

If you encounter this, you may need to change your git remote from https to ssh, e.g.

git remote set-url $DAGGER_REPO_REMOTE git@github.com:dagger/dagger.git

It's advisable to go back to https after the release is complete to not retain excessive permissions longer than necessary, e.g. to go back run

git remote set-url $DAGGER_REPO_REMOTE https://github.com/dagger/dagger.git

  • Setup the local branch to align with the remote branch being released

    git checkout "$RELEASE_BRANCH"
    
    git pull $DAGGER_REPO_REMOTE "$RELEASE_BRANCH"
  • Ensure that .changes/.next contains $ENGINE_VERSION - if it doesn't, update it now!

  • Determine the next release version (use patch/minor/major to set the release type):

    export ENGINE_VERSION="$(dagger call -m version next-release-version)"
    
    # this is required to interpolate $ENGINE_VERSION to the SDK release notes
    export CHANGIE_ENGINE_VERSION="$ENGINE_VERSION"
  • Create the target release notes branch for a PR - e.g. prep-v0.12.4.

    git checkout -b prep-$ENGINE_VERSION
  • Bump internal versions (sdks + docs + helm chart) to the target version

    dagger call -m releaser bump --version="$ENGINE_VERSION" -o ./
    git add docs sdk helm
    git commit -s -m "chore: bump dependencies to $ENGINE_VERSION"
  • Push to dagger/dagger - we need access to secrets that PRs coming from forks will not have. Open the PR as a draft and capture the PR number:

    git push $DAGGER_REPO_REMOTE
    gh pr create --draft --title "chore: prep for $ENGINE_VERSION" --body "" | tee /tmp/prep-pr.txt
    export RELEASE_PREP_PR=$(cat /tmp/prep-pr.txt | sed -r 's/^[^0-9]*([0-9]+).*/\1/')
  • Generate bump changes for each SDK + the helm charts

    export GITHUB_USERNAME=$(gh api /user --jq .login)
    find sdk/go sdk/python sdk/typescript sdk/elixir sdk/php sdk/rust helm/dagger -maxdepth 1 -name .changie.yaml -execdir \
          changie new --kind "Dependencies" --body "Bump Engine to $ENGINE_VERSION" --custom PR="$RELEASE_PREP_PR" --custom Author="$GITHUB_USERNAME" \;
  • Generate release notes .changes/**/v0.12.4.md for all releases:

    export CHANGIE_MAINTAINERS=$(dagger call -m releaser get-maintainers --github-org-name dagger --github-token="cmd://gh auth token" --json)
    find . sdk/go sdk/python sdk/typescript sdk/elixir sdk/php sdk/rust helm/dagger -maxdepth 1 -name .changie.yaml -execdir changie batch $ENGINE_VERSION \;
  • Make any necessary edits to the newly generated file, e.g. .changes/v0.12.4.md

  • Update CHANGELOG.md by running changie merge.

    find . sdk/go sdk/python sdk/typescript sdk/elixir sdk/php sdk/rust helm/dagger -maxdepth 1 -name .changie.yaml -execdir changie merge \;
    find . -name .changes -type d -exec git add {} \;
    find . -name CHANGELOG.md -type f -exec git add {} \;
    git commit -s -m "chore: add release notes for $ENGINE_VERSION"
  • Update .changes/.next with the next release number if known - otherwise, make the file empty (but don't remove it).

  • Push changes, and bring the prep PR out of draft:

    git push
    gh pr ready
  • Review and merge the prep PR. The merged commit is what gets tagged in the next step.

  • Ensure that all GitHub Actions checks pass for the dagger.io PR which gets automatically created part of this PR. The PR is configured to deploy a Daggerverse preview environment with a main Dagger Engine (the one that is just about to be released). If all checks pass, close that PR & delete the branch (this will clean up the infra that gets provisioned). If checks fail, cc @jpadams @marcosnils @matipan @gerhard in the release thread and wait for a response before continuing with the release (this might be a blocker).

  • Confirm that all checks on $RELEASE_BRANCH are green, for main you're basically checking that the merged prep commit is has a green check. Do not push tags until this is finished.

🚀 Release

🌌 Daggerverse

  • Merge the newly opened PR in the dagger.io repository (this is created by the publish workflow). If anything fails, cc the following in the release thread on Discord: cc @jpadams @kpenfound @matipan @gerhard

🌥️ Dagger Cloud

  • Mention in the release thread on Discord that Dagger Cloud can be updated to the just-released version. cc @marcosnils @matipan @sipsma

Improve releasing 改善

  • Start an release improvements branch:

    git checkout -b improve-releasing-during-$ENGINE_VERSION
  • Download and install the latest release, and continue the rest of the release process using the just-released CLI. This is needed now so the .dagger module updated below will get dagger.json's engine version bumped.

  • Update the dagger version in .github/main.go, then regenerate .github/ configs:

    dagger call -m .github generate directory --path=.github/workflows export --path=.github/workflows --wipe
  • Update non-autogenerated .github configs to $ENGINE_VERSION

    • The version numbers (of the form <major>.<minor>.<patch>) should be updated to the new version
    • The worker runner versions (of the form dagger-v<major>-<minor>-<patch>-<worker>)
    • e.g. if bumping 0.18.8->0.18.9, can run find .github/ -type f -exec sed -i 's/0-18-8/0-18-9/g; s/0\.18\.8/0\.18\.9/g' {} +
  • Bump the Go SDK version in our internal CI targets (these aren't actually used anywhere since we use the modularized go SDK - but it's good practice regardless).

    # update deps
    go mod edit -require dagger.io/dagger@$ENGINE_VERSION
    go mod edit -require github.com/dagger/dagger/engine/distconsts@$ENGINE_VERSION
    go mod tidy
    cd .dagger
    go mod edit -require github.com/dagger/dagger/engine/distconsts@$ENGINE_VERSION
    go mod tidy
    cd ..
    
    dagger develop --recursive -m .
    dagger develop --recursive -m ./releaser
    
    # add, commit and push the changes to the PR
    git add .
    git commit -s -m "chore: bump internal tooling to $ENGINE_VERSION"
    git push
  • Open a PR with the title Improve Releasing during $ENGINE_VERSION

    git add .  # or any other files changed during the last few steps
    git commit -s -m "Improve releasing during $ENGINE_VERSION"
    git push
    gh pr create --draft --title "Improve releasing during $ENGINE_VERSION" --body ""
  • When all the above done, remember to add the RELEASING.md changes to the improve-releasing-during-v... PR that you have opened earlier (remember to toggle all the checkboxes back to [ ]). Here is an example: dagger#5658

Last step

  • Close the Discord release thread you created in Let the team know
  • Close the GitHub milestone you created in Let the team know
    • If there are remaining PRs/issues that were not resolved, then move them into the next milestone (or remove it from a milestone entirely)