Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Added manual workflow to create PRs merging default branch into "rele… #284

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fballiano
Copy link
Contributor

This PR adds a manual workflow (that has to be called manually) that:

To test it I've slightly modify it to only print the commands instead of executing them, this is the full list for review:

gh pr create --repo mage-os/mageos-magento2 --base "release/1.x" --head "2.4-develop" --title "Merge 2.4-develop into release/1.x" --body "This PR was automatically created to merge the 2.4-develop branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-security-package --base "release/1.x" --head "develop" --title "Merge develop into release/1.x" --body "This PR was automatically created to merge the develop branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-inventory --base "release/1.x" --head "develop" --title "Merge develop into release/1.x" --body "This PR was automatically created to merge the develop branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-inventory-composer-installer --base "release/1.x" --head "master" --title "Merge master into release/1.x" --body "This PR was automatically created to merge the master branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-magento2-page-builder --base "release/1.x" --head "develop" --title "Merge develop into release/1.x" --body "This PR was automatically created to merge the develop branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-adobe-ims --base "release/1.x" --head "develop" --title "Merge develop into release/1.x" --body "This PR was automatically created to merge the develop branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-adobe-stock-integration --base "release/1.x" --head "develop" --title "Merge develop into release/1.x" --body "This PR was automatically created to merge the develop branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-magento-composer-installer --base "release/1.x" --head "master" --title "Merge master into release/1.x" --body "This PR was automatically created to merge the master branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-composer --base "release/1.x" --head "develop" --title "Merge develop into release/1.x" --body "This PR was automatically created to merge the develop branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-composer-root-update-plugin --base "release/1.x" --head "develop" --title "Merge develop into release/1.x" --body "This PR was automatically created to merge the develop branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-composer-dependency-version-audit-plugin --base "release/1.x" --head "main" --title "Merge main into release/1.x" --body "This PR was automatically created to merge the main branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-magento2-sample-data --base "release/1.x" --head "2.4-develop" --title "Merge 2.4-develop into release/1.x" --body "This PR was automatically created to merge the 2.4-develop branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-commerce-data-export --base "release/1.x" --head "main" --title "Merge main into release/1.x" --body "This PR was automatically created to merge the main branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-magento-coding-standard --base "release/1.x" --head "develop" --title "Merge develop into release/1.x" --body "This PR was automatically created to merge the develop branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-magento2-functional-testing-framework --base "release/1.x" --head "develop" --title "Merge develop into release/1.x" --body "This PR was automatically created to merge the develop branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-magento-zend-db --base "release/1.x" --head "main" --title "Merge main into release/1.x" --body "This PR was automatically created to merge the main branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-magento-zend-loader --base "release/1.x" --head "main" --title "Merge main into release/1.x" --body "This PR was automatically created to merge the main branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-magento-zend-pdf --base "release/1.x" --head "main" --title "Merge main into release/1.x" --body "This PR was automatically created to merge the main branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-magento-zend-cache --base "release/1.x" --head "main" --title "Merge main into release/1.x" --body "This PR was automatically created to merge the main branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-magento-zend-exception --base "release/1.x" --head "main" --title "Merge main into release/1.x" --body "This PR was automatically created to merge the main branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-magento-zend-log --base "release/1.x" --head "main" --title "Merge main into release/1.x" --body "This PR was automatically created to merge the main branch into the release/1.x branch."
gh pr create --repo mage-os/mageos-magento-zend-memory --base "release/1.x" --head "main" --title "Merge main into release/1.x" --body "This PR was automatically created to merge the main branch into the release/1.x branch."
  • It uses MAGE_OS_CI_TOKEN which I think should have enough privileges to do all it needs to do
  • It could be better to just output the commands instead of running them, if we want to be safe... opinions?

@fballiano fballiano requested a review from a team as a code owner April 1, 2025 21:17
@rhoerr
Copy link
Contributor

rhoerr commented Apr 2, 2025

Visually, the code seems good. Thank you for putting it together.

@Vinai Thoughts? The idea is to streamline the process of updating release branches for 2.4.8/Mage-OS 1.1 next week.

Some concerns, thinking about it in more depth:

  1. Do we need to restrict who can run this workflow? Like https://github.com/mage-os/generate-mirror-repo-js/blob/main/.github/workflows/build-mageos-release.yml#L42
  2. Is there a reasonable or practical way to not have the dependence on the remote repo file https://raw.githubusercontent.com/mage-os/generate-mirror-repo-js/refs/heads/main/src/build-config/mageos-nightly-build-config.js ? (This is not worth the time or complexity of resolving right now.)
  3. If it hits a merge conflict, what does resolving it look like? Would that mean manually merging release/1.x onto 2.4-develop to complete the PR? Are branch protections going to be a problem? Do we need to create an intermediary branch to merge from instead?
  4. Possibly fundamental problem: we probably want to target specific commit hashes for the final merge for 2.4.8 -> 1.1. Otherwise it's possible or likely that the most recent (HEAD) commit on 2.4-develop is actually newer than the commit used to build 2.4.8 upstream, meaning we're publishing some code from upstream that's not necessarily stable yet. Maybe we consider this acceptable risk?. Otherwise, we could use this to speed up preliminary merges (as we prep for 1.1 this week), but then would still need to re-merge by repo, identifying the proper source commit to merge for each repo.
    • That's trickier than it should be: the actual tagged commit (IE 2.4.8) is unlinked and has build changes (composer versions and dependencies) that can't be merged directly. Also, the tagged version differs by repo. We'd have to get the latest tag, and then follow it to its closest parent commit on the main branch, and use that parent as the merge source. And that's assuming that they pushed all tags, which they often miss. And that wouldn't work until new tags are pushed, so wouldn't help us for pre-release prep and testing like now.

@fballiano
Copy link
Contributor Author

For the time being I would run the pr creation manually, since I already have the list, then:

  • if there's no conflict -> we can merge it
  • if there are conflict -> we'll have to close the PR, fork the repo, and do the thing from the forked repo in order not to deal with branch protection rules...

@fballiano
Copy link
Contributor Author

@rhoerr if you agree with my last document I'd create the PRs sooner than later

@rhoerr
Copy link
Contributor

rhoerr commented Apr 3, 2025

@rhoerr if you agree with my last document I'd create the PRs sooner than later

Yes, that sounds good, do it.

@fballiano
Copy link
Contributor Author

@rhoerr I've created all the PRs

these ones don't have any conflict and they could be merged immediately:
mage-os/mageos-inventory#3
mage-os/mageos-inventory-composer-installer#3
mage-os/mageos-adobe-stock-integration#3
mage-os/mageos-magento-composer-installer#3
mage-os/mageos-composer#1
mage-os/mageos-composer-root-update-plugin#3
mage-os/mageos-composer-dependency-version-audit-plugin#3
mage-os/mageos-magento2-sample-data#3
mage-os/mageos-magento-coding-standard#1
mage-os/mageos-magento2-functional-testing-framework#2
mage-os/mageos-magento-zend-db#2
mage-os/mageos-magento-zend-loader#1
mage-os/mageos-magento-zend-pdf#1
mage-os/mageos-magento-zend-cache#1
mage-os/mageos-magento-zend-exception#1
mage-os/mageos-magento-zend-log#1
mage-os/mageos-magento-zend-memory#1

These ones have conflicts:
mage-os/mageos-magento2#128
mage-os/mageos-security-package#4
mage-os/mageos-magento2-page-builder#5

Since the conflicts are not fixable directly within these PRs, would you like me to fork these 3 repos and create PRs on a proper editable branch? I'll make the PRs "editable by maintainers" so that you can fix the conflicts on my branch without having to do that on your own. Otherwise you could do it directly on your one but I can't help with that.

@rhoerr
Copy link
Contributor

rhoerr commented Apr 3, 2025

That would be great, thank you. Please fork and PR, and I can go through the conflicts.

The nonconflicting ones can be merged.

@fballiano
Copy link
Contributor Author

@rhoerr will do, tech question, we should "rebase and merge" right?

@rhoerr
Copy link
Contributor

rhoerr commented Apr 3, 2025

@rhoerr will do, tech question, we should "rebase and merge" right?

I think create a merge commit to preserve branch histories. Do not squash since the source branch will stay around.

@fballiano
Copy link
Contributor Author

@rhoerr I've merged all PRs that didn't have any conflict.

Then I created

which are the ones with conflicts, I think you should be able to edit them and commit on my branch as you like

@rhoerr
Copy link
Contributor

rhoerr commented Apr 8, 2025

As far as the branch protection issues go, I think the solution is to change the branch protection rules for each repository to only apply to the upstream and release branches (release/*, main, master, develop, depending on the repository). This seems safe to me, but I think @sprankhub has reservations.

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.

2 participants