Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow to prepare release branch #5143

Merged
merged 6 commits into from
Jan 18, 2022
Merged

Add workflow to prepare release branch #5143

merged 6 commits into from
Jan 18, 2022

Conversation

trask
Copy link
Member

@trask trask commented Jan 16, 2022

Automate a couple of the manual release steps

I tested this on my fork, you can look there to see example of the two PRs that this workflow creates: https://github.com/trask/opentelemetry-java-instrumentation/pulls

@trask trask requested a review from a team January 16, 2022 02:49
.github/scripts/update-versions.sh "$v-SNAPSHOT" "$v-alpha-SNAPSHOT" "$bump-SNAPSHOT" "$bump-alpha-SNAPSHOT"

- name: Create pull request
uses: peter-evans/create-pull-request@v3
Copy link
Contributor

Choose a reason for hiding this comment

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

If wanting to avoid a third party action, might be easy enough to use gh CLI

https://cli.github.com/manual/gh_pr_create

with:
commit-message: Bump snapshot version
branch: bump-snapshot-version
delete-branch: true
Copy link
Contributor

@anuraaga anuraaga Jan 17, 2022

Choose a reason for hiding this comment

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

FWIW, I was trying to see how delete-branch could possibly work when creating a pull request, and indeed it doesn't

https://github.com/peter-evans/create-pull-request#action-behaviour

It would delete the PR if it had already been merged when running this step, which would never be the case for us. So to prevent confusion, we should delete this field if sticking with the action. But I'd say the CLI command is simple and all we need, this action seems to support some intense workflows :O

https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#how-the-action-works

* examples/extension/build.gradle
* Bump the version in the download link in the root `README.md` file
* Run the [Prepare Release Branch workflow](https://github.com/open-telemetry/opentelemetry-java-instrumentation/actions/workflows/prepare-release-branch.yml).
* Review and merge the two PRs that it creates (one is targeted to the release branch and one is targeted to the `main` branch)
Copy link
Contributor

Choose a reason for hiding this comment

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

Make sure to delete the branch after merging

git add -u
git commit -m "$msg"
git push origin HEAD:bump-snapshot-version
gh pr create --title "$msg" --body "$msg" --head bump-snapshot-version --base main
Copy link
Contributor

Choose a reason for hiding this comment

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

I just noticed the **/** CNCF branch protection rule seems to be gone, did we accidentally delete it?

Though either way, even if we can make it work for release branch, this PR creation to main looks like it'll be problematic due to CLA check :(

Copy link
Contributor

Choose a reason for hiding this comment

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

Though we do explicitly have the checkbox to let us merge even if status checks aren't all passing. So that could be our workaround

Copy link
Member Author

Choose a reason for hiding this comment

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

we have branch protection on both main and v**, so CLA check will be a problem for both PRs 😞

Copy link
Member Author

Choose a reason for hiding this comment

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

it looks there are complexities to approving github-actions bot account for EasyCLA and so that path could take some time

it seems that the current recommendation is to use a Personal Access Token generated by one of the maintainers: https://github.com/open-telemetry/community/blob/main/docs/using-github-extensions.md#writing-your-github-actions-pipelines

Copy link
Member Author

Choose a reason for hiding this comment

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

reverted back to using github-actions bot for now at least

@trask trask merged commit b337f68 into open-telemetry:main Jan 18, 2022
@trask trask deleted the workflow-to-prepare-release-branch branch January 18, 2022 06:58
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
* Add workflow to prepare release branch

* Avoid third party action

* Use PAT

* Delete the branches

* Revert "Use PAT"

This reverts commit 6f0c1b1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants