WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 80c026a

Browse files
authored
[Rollout] Production rollout 2025-02-05 part II (#4423)
#4416
2 parents c6d57cf + 7e7bf30 commit 80c026a

File tree

3 files changed

+8
-27
lines changed

3 files changed

+8
-27
lines changed

src/Microsoft.DotNet.Darc/Darc/Options/CommandLineOptions.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,9 @@ public override Operation GetOperation(ServiceProvider sp)
2828
public abstract class CommandLineOptions : ICommandLineOptions
2929
{
3030
[Option('p', "password",
31-
HelpText = "[DEPRECATED] Token used to authenticate to BAR. Please use Azure CLI or an interactive browser login flow.")]
31+
HelpText = "Token used to authenticate to BAR. When omitted, Azure CLI or an interactive browser login flow are used.")]
3232
[RedactFromLogging]
33-
public string BuildAssetRegistryToken
34-
{
35-
get => null;
36-
set
37-
{
38-
if (!string.IsNullOrEmpty(value))
39-
{
40-
Console.WriteLine("The --password option is deprecated. Please use Azure CLI or an interactive browser login flow.");
41-
}
42-
}
43-
}
33+
public string BuildAssetRegistryToken { get; set; } = null;
4434

4535
[Option("github-pat", HelpText = "Token used to authenticate GitHub.")]
4636
[RedactFromLogging]

src/ProductConstructionService/ProductConstructionService.WorkItems/WorkItemProcessorState.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,7 @@ public async Task SetStoppedIfStoppingAsync()
6969
}
7070
}
7171

72-
public async Task InitializationFinished()
73-
{
74-
var status = await _stateCache.GetStateAsync();
75-
if (!string.IsNullOrEmpty(status) && status == Initializing)
76-
{
77-
await _stateCache.SetStateAsync(Stopped);
78-
}
79-
}
72+
public async Task InitializationFinished() => await SetStartAsync();
8073

8174
public async Task FinishWorkItemAndStopAsync()
8275
{
@@ -89,6 +82,6 @@ public async Task FinishWorkItemAndStopAsync()
8982

9083
public async Task<string> GetStateAsync()
9184
{
92-
return await _stateCache.GetStateAsync() ?? Stopped;
85+
return await _stateCache.GetStateAsync() ?? Working;
9386
}
9487
}

test/ProductConstructionService.WorkItem.Tests/WorkItemsProcessorScopeManagerTests.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public async Task WorkItemsProcessorStatusNormalFlow()
5555

5656
// Initialization is done
5757
await _state.InitializationFinished();
58-
(await _state.GetStateAsync()).Should().Be(WorkItemProcessorState.Stopped);
58+
(await _state.GetStateAsync()).Should().Be(WorkItemProcessorState.Working);
59+
await _state.FinishWorkItemAndStopAsync();
5960

6061
TaskCompletionSource workItemCompletion1 = new();
6162
TaskCompletionSource workItemCompletion2 = new();
@@ -121,13 +122,10 @@ public async Task WorkItemsProcessorMultipleStopFlow()
121122

122123
await _state.InitializationFinished();
123124
// The workItems processor should start in a stopped state
124-
(await _state.GetStateAsync()).Should().Be(WorkItemProcessorState.Stopped);
125+
(await _state.GetStateAsync()).Should().Be(WorkItemProcessorState.Working);
125126

126127
await _state.FinishWorkItemAndStopAsync();
127128

128-
// We were already stopped, so we should continue to be so
129-
(await _state.GetStateAsync()).Should().Be(WorkItemProcessorState.Stopped);
130-
131129
TaskCompletionSource workItemCompletion = new();
132130

133131
// Start a new workItem that should get blocked
@@ -157,7 +155,7 @@ public async Task WorkItemsProcessorMultipleStartStop()
157155
await _state.SetInitializingAsync();
158156
await _state.InitializationFinished();
159157

160-
(await _state.GetStateAsync()).Should().Be(WorkItemProcessorState.Stopped);
158+
(await _state.GetStateAsync()).Should().Be(WorkItemProcessorState.Working);
161159

162160
// Start the WorkItemsProcessor multiple times in a row
163161
await _state.SetStartAsync();

0 commit comments

Comments
 (0)