Skip to content

Conversation

@emdneto
Copy link
Member

@emdneto emdneto commented Apr 14, 2025

Description

This PR tries to automate the SHA procedure during releases. The rationale is:

  1. For non-PR events (e.g., a push), CORE_REPO_SHA defaults to "main".

  2. For PRs:

  • If there’s a label named release, use the PR’s head branch (e.g., opentelemetrybot/prepare-release-1.32.0-0.53b0)

  • Else, if there’s a label named "patch-release", use the PR’s base branch (e.g., usually release/v1.32.x-0.53bx)

  • Otherwise, use "main".

Since only people with write permission can use labels, we are safe here. The automation is basically telling opentelemetrybot to open the release PRs with labels and use the labels to set the correct environment variable for CORE_REPO_SHA or CORE_CONTRIB_REPO_SHA.

I tested it locally using act, with the following event and checked tox is using the correct value for installing packages:

{
    "pull_request": {
      "labels": [
        {
          "name": "release"
        }
      ],
    "head": {
      "ref": "release/v1.32.x-0.53bx"
    },
    "base": {
      "ref": "main"
    }
    }
  }

and:

act -P ubuntu-latest=catthehacker/ubuntu:act-latest pull_request -W .github/workflows/misc_0.yml --container-architecture linux/amd64 -e event.json

Testing the behaviour from release workflows is hard, so I'm open to suggestions in terms of how testing it.

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
@emdneto emdneto requested a review from a team as a code owner April 14, 2025 20:40
@emdneto emdneto changed the title Automate SHA procedure during releases infra: Automate SHA procedure during releases Apr 14, 2025
Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Copy link
Member

@aabmass aabmass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Makes sense to me but would like someone else to double check it

xrmx pushed a commit to xrmx/opentelemetry-python-contrib that referenced this pull request Apr 15, 2025
…not installed (open-telemetry#3424)

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
@xrmx xrmx added release and removed release labels Apr 15, 2025
@xrmx
Copy link
Contributor

xrmx commented Apr 15, 2025

The manual process is something like this atm:

  • run the prepare workflow
  • update the sha of the other repo to the same branch (opentelemetrybot/prepare-release...) to have green tests
  • Release
  • Update sha reference to the release/vX.Y.Z branch for patch releases or main for normal releases

With automation it should be something like:

  • run the prepare workflow
  • update the sha of the other repo to the release/vX.Y.Z branch for patch releases or main for normal releases to have green tests
  • add label and have the workflow override the value set in the workflows
  • release

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
emdneto added 2 commits April 24, 2025 16:39
Signed-off-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
Signed-off-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
@emdneto emdneto added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Apr 24, 2025
@emdneto emdneto added the prepare-release Use during release PRs. Change CORE_REPO_SHA to point to HEAD branch name label Apr 24, 2025
@emdneto emdneto removed the prepare-release Use during release PRs. Change CORE_REPO_SHA to point to HEAD branch name label Apr 24, 2025
@lzchen lzchen merged commit 7f347e5 into open-telemetry:main Apr 24, 2025
720 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants