Skip to content
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
100 changes: 91 additions & 9 deletions scripts/create-net6-preview-flow.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ param
[Parameter(Mandatory=$true)][string]$SdkChannel,
[Parameter(Mandatory=$true)][string]$RuntimeBranch,
[Parameter(Mandatory=$true)][string]$SdkBranch,
[Parameter(Mandatory=$true)][string]$VSChannel
[Parameter(Mandatory=$true)][string]$VSChannel,
[switch]$AddInternalFlow,
[string]$InternalRuntimeChannel,
[string]$InternalSdkChannel
)

function MakeDefaultChannel($repo, $branch, $channel)
Expand All @@ -13,18 +16,37 @@ function MakeDefaultChannel($repo, $branch, $channel)
& darc add-default-channel --repo "$repo" --branch "$branch" --channel "$channel" --quiet
}

function DisableFlow($channel)
{
Write-Host "Disabling flow on $channel"
& darc subscription-status --disable --channel "$channel" --quiet --exact
}

function AddFlow($sourceRepo, $sourceChannel, $targetRepo, $targetBranch, $frequency)
{
Write-Host "Adding flow - $sourceRepo @ $sourceChannel -> $targetRepo @ $targetBranch ($frequency)"
& darc add-subscription --source-repo "$sourceRepo" --channel "$sourceChannel" --target-repo "$targetRepo" --target-branch "$targetBranch" --update-frequency "$frequency" --quiet --no-trigger --standard-automerge
}

function AddBatchedFlow($sourceRepo, $sourceChannel, $targetRepo, $targetBranch, $frequency)
{
Write-Host "Adding flow - $sourceRepo @ $sourceChannel -> $targetRepo @ $targetBranch ($frequency)"
& darc add-subscription --source-repo "$sourceRepo" --channel "$sourceChannel" --target-repo "$targetRepo" --target-branch "$targetBranch" --update-frequency "$frequency" --quiet --no-trigger --batchable
}

function AddBatchedMergePolicy($targetRepo, $targetBranch)
{
Write-Host "Setting batched merge policy for $targetRepo @ $targetBranch"
& darc set-repository-policies --repo "$targetRepo" --branch "$targetBranch" --standard-automerge --quiet
}

function AddArcadeFlow($targetRepo, $targetBranch)
{
AddFlow https://github.com/dotnet/arcade ".NET Eng - Latest" $targetRepo $targetBranch None
}

# Make default channels
$InternalRuntimeBranch = "internal/$RuntimeBranch"
$InternalSdkBranch = "internal/$SdkBranch"

Write-Host "Making default channels for runtime repos"
MakeDefaultChannel https://dev.azure.com/dnceng/internal/_git/dotnet-wpf-int $RuntimeBranch $RuntimeChannel
Expand All @@ -38,15 +60,42 @@ MakeDefaultChannel https://github.com/dotnet/wpf $RuntimeBranch $RuntimeChannel
MakeDefaultChannel https://github.com/dotnet/winforms $RuntimeBranch $RuntimeChannel
MakeDefaultChannel https://github.com/mono/linker $RuntimeBranch $RuntimeChannel

if ($AddInternalFlow) {
# Because of where internal fixes tend to be, we eliminate some leaves in the graph
# and flow them through the normal public channels: emsdk, icu, linker.
# wpf-int gets assigned to the internal channel in addition (since there is no public->internal merge)
Write-Host "Making default channels for internal branches of runtime repos"
MakeDefaultChannel https://dev.azure.com/dnceng/internal/_git/dotnet-wpf-int $RuntimeBranch $InternalRuntimeChannel
MakeDefaultChannel https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore $InternalRuntimeBranch $InternalRuntimeChannel
MakeDefaultChannel https://dev.azure.com/dnceng/internal/_git/dotnet-efcore $InternalRuntimeBranch $InternalRuntimeChannel
MakeDefaultChannel https://dev.azure.com/dnceng/internal/_git/dotnet-runtime $InternalRuntimeBranch $InternalRuntimeChannel
MakeDefaultChannel https://dev.azure.com/dnceng/internal/_git/dotnet-windowsdesktop $InternalRuntimeBranch $InternalRuntimeChannel
MakeDefaultChannel https://dev.azure.com/dnceng/internal/_git/dotnet-wpf $InternalRuntimeBranch $InternalRuntimeChannel
MakeDefaultChannel https://dev.azure.com/dnceng/internal/_git/dotnet-winforms $InternalRuntimeBranch $InternalRuntimeChannel
}

Write-Host "Making default channels for SDK repos"
MakeDefaultChannel https://github.com/dotnet/installer $SdkBranch $SdkChannel
MakeDefaultChannel https://github.com/dotnet/sdk $SdkBranch $SdkChannel
MakeDefaultChannel https://github.com/dotnet/roslyn-analyzers $SdkBranch $SdkChannel
MakeDefaultChannel https://github.com/dotnet/templating $SdkBranch $SdkChannel

# Make dependency flow
if ($AddInternalFlow) {
# Because of where internal fixes tend to be, we eliminate some leaves in the sdk graph
# and flow them through the normal public channels: templating, roslyn-analyzers
Write-Host "Making default channels for SDK repos"
MakeDefaultChannel https://dev.azure.com/dnceng/internal/_git/dotnet-installer $InternalSdkBranch $InternalSdkChannel
MakeDefaultChannel https://dev.azure.com/dnceng/internal/_git/dotnet-sdk $InternalSdkBranch $InternalSdkChannel
}

Write-Host "Setting up batched merge policies"
AddBatchedMergePolicy https://github.com/dotnet/aspnetcore $RuntimeBranch

Write-Host "Add arcade flow"
if ($AddInternalFlow) {
AddBatchedMergePolicy https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore $InternalRuntimeBranch
}

Write-Host "Adding arcade flow"
AddArcadeFlow https://dev.azure.com/dnceng/internal/_git/dotnet-wpf-int $RuntimeBranch
AddArcadeFlow https://github.com/dotnet/aspnetcore $RuntimeBranch
AddArcadeFlow https://github.com/dotnet/efcore $RuntimeBranch
Expand All @@ -62,31 +111,64 @@ AddArcadeFlow https://github.com/dotnet/sdk $SdkBranch
AddArcadeFlow https://github.com/dotnet/roslyn-analyzers $SdkBranch
AddArcadeFlow https://github.com/dotnet/templating $SdkBranch

Write-Host "Add runtime -> runtime flow"
Write-Host "Adding runtime -> runtime flow"
AddFlow https://dev.azure.com/dnceng/internal/_git/dotnet-wpf-int $RuntimeChannel https://github.com/dotnet/wpf $RuntimeBranch EveryBuild
AddFlow https://github.com/dotnet/efcore $RuntimeChannel https://github.com/dotnet/aspnetcore $RuntimeBranch EveryBuild
AddFlow https://github.com/dotnet/emsdk $RuntimeChannel https://github.com/dotnet/aspnetcore $RuntimeBranch EveryBuild
AddBatchedFlow https://github.com/dotnet/efcore $RuntimeChannel https://github.com/dotnet/aspnetcore $RuntimeBranch EveryBuild
AddBatchedFlow https://github.com/dotnet/emsdk $RuntimeChannel https://github.com/dotnet/aspnetcore $RuntimeBranch EveryBuild
AddFlow https://github.com/dotnet/emsdk $RuntimeChannel https://github.com/dotnet/runtime $RuntimeBranch EveryBuild
AddFlow https://github.com/dotnet/icu $RuntimeChannel https://github.com/dotnet/runtime $RuntimeBranch EveryBuild
AddFlow https://github.com/dotnet/runtime $RuntimeChannel https://github.com/dotnet/aspnetcore $RuntimeBranch EveryBuild
AddBatchedFlow https://github.com/dotnet/runtime $RuntimeChannel https://github.com/dotnet/aspnetcore $RuntimeBranch EveryBuild
AddFlow https://github.com/dotnet/runtime $RuntimeChannel https://github.com/dotnet/efcore $RuntimeBranch EveryBuild
AddFlow https://github.com/dotnet/runtime $RuntimeChannel https://github.com/dotnet/winforms $RuntimeBranch EveryBuild
AddFlow https://github.com/dotnet/winforms $RuntimeChannel https://github.com/dotnet/wpf $RuntimeBranch EveryBuild
AddFlow https://github.com/dotnet/wpf $RuntimeChannel https://github.com/dotnet/windowsdesktop $RuntimeBranch EveryBuild
AddFlow https://github.com/mono/linker $RuntimeChannel https://github.com/dotnet/runtime $RuntimeBranch EveryBuild

if ($AddInternalFlow) {
Write-Host "Adding internal runtime -> internal runtime flow"
AddBatchedFlow https://dev.azure.com/dnceng/internal/_git/dotnet-efcore $InternalRuntimeChannel https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore $InternalRuntimeBranch EveryBuild
AddBatchedFlow https://dev.azure.com/dnceng/internal/_git/dotnet-runtime $InternalRuntimeChannel https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore $InternalRuntimeBranch EveryBuild
AddFlow https://dev.azure.com/dnceng/internal/_git/dotnet-wpf-int $InternalRuntimeChannel https://dev.azure.com/dnceng/internal/_git/dotnet-wpf $InternalRuntimeBranch EveryBuild
AddFlow https://dev.azure.com/dnceng/internal/_git/dotnet-runtime $InternalRuntimeChannel https://dev.azure.com/dnceng/internal/_git/dotnet-efcore $InternalRuntimeBranch EveryBuild
AddFlow https://dev.azure.com/dnceng/internal/_git/dotnet-runtime $InternalRuntimeChannel https://dev.azure.com/dnceng/internal/_git/dotnet-winforms $InternalRuntimeBranch EveryBuild
AddFlow https://dev.azure.com/dnceng/internal/_git/dotnet-winforms $InternalRuntimeChannel https://dev.azure.com/dnceng/internal/_git/dotnet-wpf $InternalRuntimeBranch EveryBuild
AddFlow https://dev.azure.com/dnceng/internal/_git/dotnet-wpf $InternalRuntimeChannel https://dev.azure.com/dnceng/internal/_git/dotnet-windowsdesktop $InternalRuntimeBranch EveryBuild

Write-Host "Disabling internal runtime -> internal runtime flow"
DisableFlow $InternalRuntimeChannel
}

Write-Host "Add runtime->sdk flow"
AddFlow https://github.com/dotnet/aspnetcore $RuntimeChannel https://github.com/dotnet/sdk $SdkBranch EveryBuild
AddFlow https://github.com/dotnet/windowsdesktop $RuntimeChannel https://github.com/dotnet/sdk $SdkBranch EveryBuild
AddFlow https://github.com/dotnet/runtime $RuntimeChannel https://github.com/dotnet/sdk $SdkBranch EveryBuild
AddFlow https://github.com/mono/linker $RuntimeChannel https://github.com/dotnet/sdk $SdkBranch EveryBuild

if ($AddInternalFlow) {
Write-Host "Adding internal runtime->internal sdk flow"
AddFlow https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore $InternalRuntimeChannel https://dev.azure.com/dnceng/internal/_git/dotnet-sdk $InternalSdkBranch EveryBuild
AddFlow https://dev.azure.com/dnceng/internal/_git/dotnet-windowsdesktop $InternalRuntimeChannel https://dev.azure.com/dnceng/internal/_git/dotnet-sdk $InternalSdkBranch EveryBuild
AddFlow https://dev.azure.com/dnceng/internal/_git/dotnet-runtime $InternalRuntimeChannel https://dev.azure.com/dnceng/internal/_git/dotnet-sdk $InternalSdkBranch EveryBuild

Write-Host "Disabling internal runtime->internal sdk flow"
DisableFlow $InternalRuntimeChannel
}

Write-Host "Add sdk->sdk flow"
AddFlow https://github.com/dotnet/sdk $SdkChannel https://github.com/dotnet/installer $SdkBranch EveryBuild
AddFlow https://github.com/dotnet/roslyn-analyzers $SdkChannel https://github.com/dotnet/sdk $SdkBranch EveryBuild
AddFlow https://github.com/dotnet/templating $SdkChannel https://github.com/dotnet/sdk $SdkBranch EveryBuild

Write-Host "Add tooling->sdk flow"
if ($AddInternalFlow) {
Write-Host "Adding internal sdk->internal sdk flow"
# Nothing but SDK->installer flows internally
AddFlow https://dev.azure.com/dnceng/internal/_git/dotnet-sdk $InternalSdkChannel https://dev.azure.com/dnceng/internal/_git/dotnet-installer $InternalSdkBranch EveryBuild

Write-Host "Disabling internal sdk->internal sdk flow"
DisableFlow $InternalSdkChannel
}

Write-Host "Adding tooling->sdk flow"
AddFlow https://github.com/nuget/nuget.client $VSChannel https://github.com/dotnet/sdk $SdkBranch EveryBuild
AddFlow https://github.com/dotnet/roslyn $VSChannel https://github.com/dotnet/sdk $SdkBranch EveryBuild
AddFlow https://github.com/dotnet/fsharp $VSChannel https://github.com/dotnet/sdk $SdkBranch EveryBuild
Expand Down
50 changes: 50 additions & 0 deletions scripts/flip-previewplus-flow.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
param
(
[Parameter(Mandatory=$true)][string]"$RuntimeChannel",
[Parameter(Mandatory=$true)][string]"$SdkChannel",
[Parameter(Mandatory=$true)][string]"$InternalRuntimeChannel",
[Parameter(Mandatory=$true)][string]"$InternalSdkChannel",
[Parameter(Mandatory=$true)][ValidateSet('Preview','Preview+')][string]$FlowType,
[switch]$TriggerSubscriptions
)

Write-Host "Switching flow to $FlowType"

switch ( $FlowType )
{
'Preview' {
# Switching to public flow is easy. Enable all the subscriptions in the public runtime and SDK channels
# and disable any on the internal channels
& darc subscription-status --disable --channel "$InternalRuntimeChannel" --quiet --exact
& darc subscription-status --disable --channel "$InternalSdkChannel" --quiet --exact
& darc subscription-status --enable --channel "$RuntimeChannel" --quiet --exact
& darc subscription-status --enable --channel "$SdkChannel" --quiet --exact

# Trigger public subscriptions
if ($TriggerSubscriptions) {
& darc trigger-subscriptions --channel "$RuntimeChannel" --quiet --exact
& darc trigger-subscriptions --channel "$SdkChannel" --quiet --exact
}
}
'Preview+' {
# Switching to internal flow is a little more subtle. Enable the internal subscriptions,
# then disable the corresponding public subscriptions, which is a subset of the full public channel
& darc subscription-status --enable --channel "$InternalRuntimeChannel" --quiet --exact
& darc subscription-status --enable --channel "$InternalSdkChannel" --quiet --exact

& darc subscription-status --disable --source-repo https://github.com/dotnet/runtime --channel "$RuntimeChannel" --quiet --exact
& darc subscription-status --disable --source-repo https://github.com/dotnet/winforms --channel "$RuntimeChannel" --quiet --exact
& darc subscription-status --disable --source-repo https://github.com/dotnet/wpf --channel "$RuntimeChannel" --quiet --exact
& darc subscription-status --disable --source-repo https://github.com/dotnet/windowsdesktop --channel "$RuntimeChannel" --quiet --exact
& darc subscription-status --disable --source-repo https://github.com/dotnet/aspnetcore --channel "$RuntimeChannel" --quiet --exact
& darc subscription-status --disable --source-repo https://github.com/dotnet/efcore --channel "$RuntimeChannel" --quiet --exact
& darc subscription-status --disable --source-repo https://github.com/dotnet/sdk --channel "$SdkChannel" --quiet --exact

# Trigger internal subscriptions
if ($TriggerSubscriptions) {
& darc trigger-subscriptions --channel "$InternalRuntimeChannel" --quiet --exact
& darc trigger-subscriptions --channel "$InternalSdkChannel" --quiet --exact
}
}
default { Write-Error "Unknown flow type $FlowType" }
}