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

RelEng: Teach ServicingPipeline to infer the version if it's null #13439

Merged
merged 1 commit into from
Jul 6, 2022
Merged
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
11 changes: 11 additions & 0 deletions tools/ReleaseEngineering/ServicingPipeline.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ Function Reject() {
$Host.ExitNestedPrompt()
}

If ([String]::IsNullOrEmpty($Version)) {
Copy link
Member

@lhecker lhecker Jul 5, 2022

Choose a reason for hiding this comment

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

You can just write if (!$Version).
(I believe small if is the canonical variant nowadays.)

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! Didn't know that. Is that supported on PS 5.1?

Copy link
Member

Choose a reason for hiding this comment

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

It seems to work. Is PS 5.1 still relevant though? We already require pwsh 7 or newer for the build anyways (to compress JSON strings).

$BranchVersionRegex = [Regex]"^release-(\d+(\.\d+)+)$"
$Branch = & git rev-parse --abbrev-ref HEAD
$Version = $BranchVersionRegex.Match($Branch).Groups[1].Value
If ([String]::IsNullOrEmpty($Version)) {
lhecker marked this conversation as resolved.
Show resolved Hide resolved
Write-Error "No version specified, and we can't infer it from the name of your branch ($Branch)."
Exit 1
}
Write-Host "Inferred servicing version $Version"
}

$Script:TodoColumnName = "To Cherry Pick"
$Script:DoneColumnName = "Cherry Picked"
$Script:RejectColumnName = "Rejected"
Expand Down