This repository was archived by the owner on Feb 21, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Support multiple backports #4
Closed
mandel-macaque
wants to merge
7
commits into
xamarin:main
from
mandel-macaque:support-multiple-backports
Closed
Support multiple backports #4
mandel-macaque
wants to merge
7
commits into
xamarin:main
from
mandel-macaque:support-multiple-backports
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When working in large projects with more than one release branch the old code made us write a comment PER branch, resulting in something like: /sudo backport d16-9 /sudo backport xcode12.4 /sudo backport xcode12.5 That is a lot of work and developers are lazy animals. We already supported using more than one branch in the regexp but it resulted in an error later in the script. This commit makes the required changes to ensure that we support several branches. 1. Pares all branches, creates a collection in the params. 2. If only one branhc is used, we create a collection with a single object, else several. 3. We trigger a backport PER branch in a loop using a scriptblock. 4. The exit code is the addition of all the execitions, resulting in 0 if all worked or the number of errors.
mjbond-msft
reviewed
Feb 4, 2021
mjbond-msft
approved these changes
Feb 4, 2021
mandel-macaque
commented
Feb 4, 2021
Therzok
reviewed
Feb 5, 2021
action.yml
Outdated
|
||
$parameters = @() | ||
|
||
if ($backportTargetBranch.GetType().Name -eq "String") { # uh, this is ugly, but String also has length and we can iterate, so we need the type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use $backportTargetBranch -is [string]
instead?
Right now, MyLib.String
also matches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a pwsh person ;) looks better, let me test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, works like a charm.
…e/backport-bot-action into support-multiple-backports
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When working in large projects with more than one release branch the old
code made us write a comment PER branch, resulting in something like:
/sudo backport d16-9
/sudo backport xcode12.4
/sudo backport xcode12.5
That is a lot of work and developers are lazy animals. We already
supported using more than one branch in the regexp but it resulted in an
error later in the script. This commit makes the required changes to
ensure that we support several branches.
object, else several.
if all worked or the number of errors.