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

ci: fix branch creation and mergify file #4391

Merged
merged 3 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions .github/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@ create-next-release: prepare-next-release create-prs-next-release
.PHONY: update-labels
update-labels:
echo ' - name: backport patches to $(PROJECT_MAJOR_VERSION).$(PROJECT_MINOR_VERSION) branch' >> ../.mergify.yml
echo ' conditions:' >> ../.mergify.yml
echo ' - merged' >> ../.mergify.yml
echo ' - base=main' >> ../.mergify.yml
echo ' - label=backport-$(PROJECT_MAJOR_VERSION).$(PROJECT_MINOR_VERSION)' >> .mergify.yml
echo ' actions:' >> ../.mergify.yml
echo ' backport:' >> ../.mergify.yml
echo ' assignees:' >> ../.mergify.yml
echo ' - "{{ author }}"' >> ../.mergify.yml
echo ' labels:' >> ../.mergify.yml
echo ' - "backport"' >> ../.mergify.yml
echo ' branches:' >> ../.mergify.yml
echo ' - "$(PROJECT_MAJOR_VERSION).$(PROJECT_MINOR_VERSION)"' >> ../.mergify.yml
echo ' conditions:' >> ../.mergify.yml
Copy link
Member Author

Choose a reason for hiding this comment

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

only a cosmetic change and the fix in L44

echo ' - merged' >> ../.mergify.yml
echo ' - label=backport-$(PROJECT_MAJOR_VERSION).$(PROJECT_MINOR_VERSION)' >> ../.mergify.yml
echo ' actions:' >> ../.mergify.yml
echo ' backport:' >> ../.mergify.yml
echo ' assignees:' >> ../.mergify.yml
echo ' - "{{ author }}"' >> ../.mergify.yml
echo ' labels:' >> ../.mergify.yml
echo ' - "backport"' >> ../.mergify.yml
echo ' branches:' >> ../.mergify.yml
echo ' - "$(PROJECT_MAJOR_VERSION).$(PROJECT_MINOR_VERSION)"' >> ../.mergify.yml
echo ' title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"' >> ../.mergify.yml

## @help:prepare-major-minor-release:Prepare a major/minor release by creating a new branch reference.
.PHONY: prepare-major-minor-release
prepare-major-minor-release:
git checkout 8.x
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 release from 8.x now, so it's required to checkout 8.x so we can create the branch from

git checkout -b $(RELEASE_BRANCH)

## @help:create-branch-major-minor-release:Pushes the changes on the project folder to the new RELEASE_BRANCH.
Expand All @@ -68,6 +68,7 @@ create-branch-major-minor-release:
## @help:prepare-next-release:Prepare the original branch for the next release cycle.
.PHONY: prepare-next-release
prepare-next-release:
git checkout main
Copy link
Member Author

Choose a reason for hiding this comment

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

need main, mergify uses main only

git checkout -b $(BACKPORT_BRANCH_NAME)
$(MAKE) update-labels
$(MAKE) git-diff
Expand All @@ -85,7 +86,7 @@ create-prs-next-release:
gh pr create \
--title "backport: Add backport-$(PROJECT_MAJOR_VERSION).$(PROJECT_MINOR_VERSION) label" \
--body "Merge as soon as $(PROJECT_MAJOR_VERSION).$(PROJECT_MINOR_VERSION) branch was created." \
--base 8.x \
--base main \
--label 'Team:Automation' || echo "There are no changes"

## Diff output
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/run-minor-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# as long as we are using 8.x we need to fetch main and 8.x branches
fetch-depth: 0

- name: Set github config
run: |
Expand Down