-
Notifications
You must be signed in to change notification settings - Fork 1.1k
show helpful error message when resolving actions directly with launch #3874
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 introduces a feature flag (DisplayHelpfulActionsDownloadErrors
) to toggle enhanced error messages when resolving action download info via the launch service, adds a new V2 API surface with richer error handling (422/429), and updates the worker and tests to exercise the new behavior.
- Add
DisplayHelpfulActionsDownloadErrors
flag and overloads inILaunchServer
/LaunchServer
&ActionManager
- Extend
LaunchHttpClient
withGetResolveActionsDownloadInfoAsyncV2
for custom 422/429 handling - Add L0 tests for success and unprocessable-entity error paths in the new client
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/Runner.Common/Constants.cs | Introduce DisplayHelpfulActionsDownloadErrors feature flag |
src/Runner.Common/LaunchServer.cs | Add overload for ResolveActionsDownloadInfoAsync |
src/Runner.Worker/ActionManager.cs | Wire feature-flag into launchServer.ResolveActions... call |
src/Sdk/WebApi/WebApi/LaunchHttpClient.cs | Implement GetResolveActionsDownloadInfoAsyncV2 with 422/429 |
src/Sdk/WebApi/WebApi/LaunchContracts.cs | Add data contracts for resolution errors |
src/Test/L0/Worker/ActionManagerL0.cs | Update mock to include new boolean parameter |
src/Test/L0/Sdk/LaunchWebApi/LaunchHttpClientL0.cs | New tests for success and 422 error cases |
Comments suppressed due to low confidence (3)
src/Test/L0/Sdk/LaunchWebApi/LaunchHttpClientL0.cs:77
- Add a unit test for the HTTP 429 (TooManyRequests) path to ensure
NonRetryableActionDownloadInfoException
is thrown with the expected message.
[Fact]
src/Sdk/WebApi/WebApi/LaunchHttpClient.cs:40
- [nitpick] Consider renaming
GetResolveActionsDownloadInfoAsyncV2
to something more descriptive (e.g.GetResolveActionsDownloadInfoWithErrorsAsync
) to clarify its behavior and avoid version suffixes in public API names.
public async Task<ActionDownloadInfoCollection> GetResolveActionsDownloadInfoAsyncV2(Guid planId, Guid jobId, ActionReferenceList actionReferenceList, CancellationToken cancellationToken)
src/Runner.Common/LaunchServer.cs:18
- This interface change is breaking for implementers. Consider adding a default-valued overload or a non-breaking extension method rather than modifying the existing signature.
Task<ActionDownloadInfoCollection> ResolveActionsDownloadInfoAsync(Guid planId, Guid jobId, ActionReferenceList actionReferenceList, CancellationToken cancellationToken, bool displayHelpfulActionsDownloadErrors);
Related: https://github.com/github/actions-runtime/issues/5135
Before:

vs. After:

actions-dotnet implementation: https://github.com/github/actions-dotnet/blob/f9322e925c9f23d04fb974295604864fd4a195cc/Launch/Sdk/Server/LaunchApi.cs#L87-L98