Skip to content

fixed selfhosted runner os parsing error - #171

Merged
tomellm merged 1 commit into
mainfrom
tom/#166-selfhosted-runner-os
May 29, 2024
Merged

tomellm merged 1 commit into
mainfrom
tom/#166-selfhosted-runner-os

Conversation

@tomellm

@tomellm tomellm commented May 29, 2024 •

Copy link
Copy Markdown
Contributor

#166 The os string returned by the Github api turned out to be more unpredictable then expected. This meant that a more complex setup was needed to convert the os string to the OperatingSystem enum.

Converting the string to enum works by trying to find any of a list of value in the returned os string. This list can be extended from the application.yaml through the APP_GITHUB_<OS>_SELFHOSTED_RUNNER_OS_KEYWORDS environemnt variable.

Additionally, instead of throwing an Exception when the parsing didn't succeed I added a UNKNOWN variant to the enum and log the os string for later reference.

@tomellm tomellm self-assigned this May 29, 2024
@tomellm tomellm changed the title #166 fixed selfhosted runner os parsing error fixed selfhosted runner os parsing error May 29, 2024

@henrybley henrybley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

small update please

The os string returned by the Github api turned out to be more unpredictable then expected.
This meant that a more complex setup was needed to convert the os string to the OperatingSystem
enum.

Converting the string to enum works by trying to find any of a list of value in the returned os
string. This list can be extended from the application.yaml through the APP_GITHUB_<OS>_SELFHOSTED_RUNNER_OS_KEYWORDS
environemnt variable.

Additionally, instead of throwing an Exception when the parsing didn't succeed I added a
UNKNOWN variant to the enum and log the os string for later reference.
@tomellm
tomellm force-pushed the tom/#166-selfhosted-runner-os branch from 8e365aa to 62bbf93 Compare May 29, 2024 12:38

@henrybley henrybley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ty sir

@sonarqubecloud

Copy link
Copy Markdown

@tomellm
tomellm merged commit a5dc797 into main May 29, 2024
@tomellm
tomellm deleted the tom/#166-selfhosted-runner-os branch May 29, 2024 12:44
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.

2 participants