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

[27.1 backport] gha: check-pr-branch: verify major version only #5263

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Jul 19, 2024

We'll be using release branches for minor version updates, so instead of (e.g.) a 27.0 branch, we'll be using 27.x and continue using the branch for minor version updates.

This patch changes the validation step to only compare against the major version.

(cherry picked from commit 45f769d)

@thaJeztah
Copy link
Member Author

moving to draft; looks like this latest variant doesn't work; moby/moby#48191 (comment)

@thaJeztah thaJeztah marked this pull request as draft July 19, 2024 00:59
@thaJeztah thaJeztah force-pushed the 27.1_backport_relax_pr_check branch 2 times, most recently from b30b80e to 2a65aec Compare July 19, 2024 08:57
@thaJeztah thaJeztah changed the title [27.0 backport] gha: check-pr-branch: verify major version only [27.1 backport] gha: check-pr-branch: verify major version only Jul 19, 2024
@thaJeztah thaJeztah force-pushed the 27.1_backport_relax_pr_check branch from 2a65aec to 342ce3e Compare July 19, 2024 09:11
@codecov-commenter
Copy link

codecov-commenter commented Jul 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.50%. Comparing base (33bf62c) to head (f7be714).
Report is 3 commits behind head on 27.0.

Additional details and impacted files
@@            Coverage Diff             @@
##             27.0    #5263      +/-   ##
==========================================
+ Coverage   61.45%   61.50%   +0.04%     
==========================================
  Files         296      299       +3     
  Lines       20828    20833       +5     
==========================================
+ Hits        12800    12813      +13     
+ Misses       7115     7110       -5     
+ Partials      913      910       -3     

@vvoland
Copy link
Collaborator

vvoland commented Jul 19, 2024

Just noticed you added a debug commit to print env. You probably remember about that, but just in case you forgot: the PR needs a title/description change for that workflow to be triggered 😄

@thaJeztah
Copy link
Member Author

Yeah; it's fiddly; I should probably disable all the other actions as well for debugging

@thaJeztah thaJeztah changed the title [27.1 backport] gha: check-pr-branch: verify major version only [27.2 backport] gha: check-pr-branch: verify major version only Jul 19, 2024
if: github.event.pull_request.base.ref != steps.title_branch.outputs.branch && !(github.event.pull_request.base.ref == 'master' && steps.title_branch.outputs.branch == '')
run: echo "::error::PR title suggests targetting the ${{ steps.title_branch.outputs.branch }} branch, but is opened against ${{ github.event.pull_request.base.ref }}" && exit 1
# get major version prefix from the release branch ("27.x -> "27.")
[[ "$GITHUB_BASE_REF" =~ ^\([0-9]*\.\) ]] && target_branch="${BASH_REMATCH[1]}"
Copy link
Member Author

Choose a reason for hiding this comment

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

AH! This was meant to be a capturing group, but I think Cory kept the sed syntax, so it's now escaped; this should be

Suggested change
[[ "$GITHUB_BASE_REF" =~ ^\([0-9]*\.\) ]] && target_branch="${BASH_REMATCH[1]}"
[[ "$GITHUB_BASE_REF" =~ ^([0-9]*\.) ]] && target_branch="${BASH_REMATCH[1]}"

@thaJeztah thaJeztah force-pushed the 27.1_backport_relax_pr_check branch 2 times, most recently from ec964e4 to 487171e Compare July 19, 2024 09:59
@thaJeztah thaJeztah changed the title [27.2 backport] gha: check-pr-branch: verify major version only [28.1 backport] gha: check-pr-branch: verify major version only Jul 19, 2024
@thaJeztah thaJeztah changed the title [28.1 backport] gha: check-pr-branch: verify major version only [27.25 backport] gha: check-pr-branch: verify major version only Jul 19, 2024
We'll be using release branches for minor version updates, so instead
of (e.g.) a 27.0 branch, we'll be using 27.x and continue using the
branch for minor version updates.

This patch changes the validation step to only compare against the
major version.

Co-authored-by: Cory Snider <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 6d8fcbb)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the 27.1_backport_relax_pr_check branch from 487171e to f7be714 Compare July 19, 2024 10:48
@thaJeztah thaJeztah changed the title [27.25 backport] gha: check-pr-branch: verify major version only [27.1 backport] gha: check-pr-branch: verify major version only Jul 19, 2024
@thaJeztah thaJeztah marked this pull request as ready for review July 19, 2024 11:23
@thaJeztah thaJeztah requested a review from vvoland July 19, 2024 11:23
@vvoland vvoland merged commit a2a0fb7 into docker:27.0 Jul 19, 2024
89 checks passed
@thaJeztah thaJeztah deleted the 27.1_backport_relax_pr_check branch July 19, 2024 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants