Skip to content

Get reliable base ref for push-triggered "Compare Performance" workflow #91

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

Merged
merged 1 commit into from
Dec 20, 2021
Merged

Get reliable base ref for push-triggered "Compare Performance" workflow #91

merged 1 commit into from
Dec 20, 2021

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Dec 20, 2021

The "Compare Performance" GitHub Actions workflow is intended to assist in the evaluation of performance impact of
proposed changes to the tool. It does this by comparing the duration of a run of the engine at the head ref of the
proposal against a base ref.

In the case where the workflow is triggered by a push event from a commit, the base ref should be the parent commit.
The previous approach of using the github.event.before context item was unreliable because this is set to the fake ref
0000000000000000000000000000000000000000 when there has not been a previous workflow run on the branch (as is the case
when branch and commit are pushed from a local to the remote). Example:

https://github.com/arduino/libraries-repository-engine/runs/4538811651?check_suite_focus=true

The "Compare Performance" GitHub Actions workflow is intended to assist in the evaluation of performance impact of
proposed changes to the tool. It does this by comparing the duration of a run of the engine at the head ref of the
proposal against a base ref.

In the case where the workflow is triggered by a `push` event from a commit, the base ref should be the parent commit.
The previous approach of using the `github.event.before` context item was unreliable because this is set to the fake ref
`0000000000000000000000000000000000000000` when there has not been a previous workflow run on the branch (as is the case
when branch and commit are pushed from a local to the remote).
@per1234 per1234 added topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project labels Dec 20, 2021
@per1234 per1234 self-assigned this Dec 20, 2021
@per1234 per1234 merged commit c62bc12 into arduino:main Dec 20, 2021
@per1234 per1234 deleted the fix-compare-performance-push-base branch December 20, 2021 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants