-
Notifications
You must be signed in to change notification settings - Fork 96
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
Randomize the id with GITHUB_RUN_NUMBER for scheduled test #7392
Conversation
Signed-off-by: Young Bu Park <[email protected]>
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
Signed-off-by: Young Bu Park <[email protected]>
Signed-off-by: Young Bu Park <[email protected]>
Signed-off-by: Young Bu Park <[email protected]>
Signed-off-by: Young Bu Park <[email protected]>
Signed-off-by: Young Bu Park <[email protected]>
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
UNIQUE_ID=$(echo $BASE_STR | sha1sum | head -c 10) | ||
if [ "$GITHUB_EVENT_NAME" == "schedule" ]; then | ||
# Add run number to randomize unique id for scheduled runs. | ||
BASE_STR="${GITHUB_RUN_NUMBER}|${BASE_STR}" |
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.
is there any reason we only do this for scheduled runs? is there a downside to adding the run number on all runs?
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.
If we use GITHUB_RUN_NUMBER for PR event, workflow will create resource groups and resources whenever we trigger functional tests. This results in unnecessary resource creation in our subscription. To avoid this issue and save the cost, we do not use GITHUB_RUN_NUMBER for every event.
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.
Even though we have purge workflow, it cleans up only 3 days+ old resources. So we still need to pay 3 days resoruce usage. so it is better not to use GITHUB_RUN_NUMBER
for every event.
Description
We generate unique id by concatenating GitHub Actions' system variables, hashing the string, and taking 10 characters. This way will reduce the chance to create multiple resource for the same PR. In scheduled test, the most of variables are same, so there is a little chance to face the conflicts. particularly, when resource group is being in progress triggered by the previous action runs like below failures. This change 1) adds GITHUB_RUN_NUMBER, which is updated for each action run, to the raw id before hashing and 2) adds the prefix to each hashed string to avoid the conflicts between different workflows.
#7383
#7382
#7380
Type of change
Fixes: #7388