feat: add id for self-hosted runner label #1911
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Adds the UNIX time to the self-hosted runner label if it exists.
Motivation
We typically use
runs-on=${{ github.run_id }}, but this templating doesn't work when the definition is in the YAML file. So right now we just haveruns-on/....We need to add a somewhat unique ID to this label otherwise you can experience cases where a runner that was launched for one job, is taken by another job, delaying one. This is a problem with our integration tests because we are spawning a lot of instances all at once and poaching runners can lead to delays
DX-1176
Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.
Why
The changes aim to enhance the test filtering capabilities and to introduce a new feature for dynamically modifying the
RunsOnSelfHostedlabel based on the GitHub run ID or a timestamp, improving the traceability and specificity of test environments. This makes the CI tool more flexible and capable of handling a wider range of testing scenarios.What
tools/citool/cmd/filter_cmd.gostrconvandtimepackages to facilitate string to integer conversion and timestamp generation.processRunsOnSelfHostedthat dynamically adjusts theRunsOnSelfHostedlabel with either the GitHub run ID or a current timestamp, enhancing specificity and traceability.filterTestsfunction to utilizeprocessRunsOnSelfHosted, applying the new label modification logic to each filtered test configuration.tools/citool/cmd/filter_cmd_test.gostringspackage to support string manipulation in tests.TestRunsOnSelfHostedIDto validate the behavior of the newprocessRunsOnSelfHostedfunction, ensuring it correctly modifies theRunsOnSelfHostedlabel under various conditions.