KEMBAR78
Add V2 flow for runner deletion by Samirat · Pull Request #3954 · actions/runner · GitHub
Skip to content

Conversation

@Samirat
Copy link
Contributor

@Samirat Samirat commented Jul 25, 2025

This PR implements the V2 flow for runner deletion (going through the monolith)

https://github.com/github/actions-runner-admin/issues/1657

@Copilot Copilot AI review requested due to automatic review settings July 25, 2025 13:42
@Samirat Samirat requested a review from a team as a code owner July 25, 2025 13:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a V2 flow for runner deletion by adding methods to handle runner deletion through the monolith rather than directly. The changes introduce a new deletion API method and refactor URL construction logic for better code reuse.

  • Adds DeleteRunnerAsync method to support V2 runner deletion flow
  • Refactors URL construction logic into a reusable GetEntityUrl helper method
  • Updates existing methods to use the new helper for consistent URL generation

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/Runner.Listener/Configuration/ConfigurationManager.cs Adds V2 flow logic for runner configuration with conditional branching
src/Runner.Common/RunnerDotcomServer.cs Implements DeleteRunnerAsync method and refactors URL construction into GetEntityUrl helper

{
var deletionToken = await GetRunnerTokenAsync(command, settings.GitHubUrl, "remove");
GitHubAuthResult authResult = await GetTenantCredential(settings.GitHubUrl, deletionToken, Constants.RunnerEvent.Remove);
authResult = await GetTenantCredential(settings.GitHubUrl, deletionToken, Constants.RunnerEvent.Remove);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead of using settings.UseV2Flow, I'm using the UseV2Flow returned by the monolith as part of auth. Not sure if this is the correct logic

boxofyellow
boxofyellow previously approved these changes Aug 6, 2025
Copy link

@boxofyellow boxofyellow left a comment

Choose a reason for hiding this comment

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

LGMT: :shipit:

boxofyellow
boxofyellow previously approved these changes Aug 6, 2025
Copy link

@boxofyellow boxofyellow left a comment

Choose a reason for hiding this comment

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

Look good sorry I missed that too.

TingluoHuang
TingluoHuang previously approved these changes Aug 6, 2025
@Samirat Samirat dismissed stale reviews from TingluoHuang and boxofyellow via 833ac5c August 7, 2025 14:44
_messageListener.Verify(x => x.DeleteMessageAsync(It.IsAny<TaskAgentMessage>()), Times.AtLeast(2));
_messageListener.Verify(x => x.DeleteSessionAsync(), Times.Once());
_credentialManager.Verify(x => x.LoadCredentials(true), Times.Exactly(2));
_credentialManager.Verify(x => x.LoadCredentials(true), Times.AtLeast(2));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure why, but the osx-x64 test run was calling this 3 times

@TingluoHuang TingluoHuang merged commit 5e74a4d into main Aug 7, 2025
10 checks passed
@TingluoHuang TingluoHuang deleted the samirat/v2_flow_for_runner_deletion branch August 7, 2025 14:52
fmartinez255 pushed a commit to TiVo/actions-runner that referenced this pull request Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants