-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add V2 flow for runner deletion #3954
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
Conversation
There was a problem hiding this 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
DeleteRunnerAsyncmethod to support V2 runner deletion flow - Refactors URL construction logic into a reusable
GetEntityUrlhelper 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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT: ![]()
There was a problem hiding this 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.
| _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)); |
There was a problem hiding this comment.
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
This PR implements the V2 flow for runner deletion (going through the monolith)
https://github.com/github/actions-runner-admin/issues/1657