Skip to content

Commit 054c75f

Browse files
committed
add support for passing a release channel in updateclient
1 parent 2ea26b9 commit 054c75f

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/Client/UpdateClient/UpdateClient.Versioning.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,22 @@ public partial class UpdateClient
8080
/// <summary>
8181
/// Requests the configured update server to increment the major version by one for both stable and canary, and to reset the build number to 0.
8282
/// </summary>
83+
/// <param name="rc">The target release channel.</param>
8384
/// <returns>true if request success; false if non-200 series HTTP status code, null if not configured to support this endpoint.</returns>
8485
/// <remarks>Requires an authorization-bearing client configuration.</remarks>
85-
public async Task<bool?> AdvanceVersionAsync()
86+
public async Task<bool?> AdvanceVersionAsync(ReleaseChannel? rc = null)
8687
{
8788
if (!_config.CanUseAdminEndpoints)
8889
{
8990
Log("Cannot request version advance, as there is no configured admin access token.");
9091
return null;
9192
}
9293

93-
var httpRequest = new HttpRequestMessage(HttpMethod.Patch,
94-
$"{Constants.FullRouteName_Api_Versioning}/{Constants.RouteName_Api_Versioning_AdvanceVersion}");
94+
var route = $"{Constants.FullRouteName_Api_Versioning}/{Constants.RouteName_Api_Versioning_AdvanceVersion}";
95+
if (rc != null)
96+
route += $"?rc={rc.Value.QueryStringValue}";
97+
98+
var httpRequest = new HttpRequestMessage(HttpMethod.Patch, route);
9599
ApplyAuthorization(httpRequest);
96100

97101
if (await _http.SendAsync(httpRequest) is { IsSuccessStatusCode: false } resp)

0 commit comments

Comments
 (0)