Skip to content
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

Add status check before deserializing runner-registration response #2699

Merged
merged 3 commits into from
Jul 5, 2023

Conversation

nikola-jokic
Copy link
Member

@nikola-jokic nikola-jokic commented Jun 23, 2023

The purpose of this PR is to ensure the listener does not panic if the status code returned by the actions service is not in 2xx range.

Previously, we would try to unmarshal JSON which would leave nil values for actions service admin token. When later used, the listener would panic.

Added check similar to one in the runner making sure the status code is success, and log the error message if returned from the actions service

https://github.com/actions/runner/blob/9c57205c1c1cd7ada73cb08b556293ec0411f8d4/src/Runner.Listener/Configuration/ConfigurationManager.cs#L777C50-L777C50

@nikola-jokic nikola-jokic requested review from mumoshu, toast-gear and a team as code owners June 23, 2023 14:19
@Link- Link- added attention Requires attention gha-runner-scale-set Related to the gha-runner-scale-set mode labels Jun 23, 2023
github/actions/client.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@Link- Link- left a comment

Choose a reason for hiding this comment

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

Can we please add more context to the PR description so that we use it as documentation for why this change was introduced?

  1. Describe the problem
  2. How this change addresses that problem

@nikola-jokic nikola-jokic added this to the 0.5.0 milestone Jul 3, 2023
Copy link
Collaborator

@Link- Link- left a comment

Choose a reason for hiding this comment

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

This looks good, thank you

@nikola-jokic nikola-jokic merged commit fde1893 into master Jul 5, 2023
14 checks passed
@nikola-jokic nikola-jokic deleted the nikola-jokic/actions-client-errhandle branch July 5, 2023 19:09
@Link- Link- mentioned this pull request Jul 28, 2023
@nikola-jokic nikola-jokic restored the nikola-jokic/actions-client-errhandle branch September 26, 2023 09:51
@nikola-jokic nikola-jokic deleted the nikola-jokic/actions-client-errhandle branch September 26, 2023 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
attention Requires attention gha-runner-scale-set Related to the gha-runner-scale-set mode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants