Skip to content

Don't run "Publish Tester Build" workflow on tag push #780

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
Oct 16, 2024

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Oct 16, 2024

The "Publish Tester Build" workflow is triggered by the push event. This event occurs on tag pushes in addition to commit pushes.

On a tag push, there is an ambiguity in how the build should be identified, since the revision has two Git refs:

  • The commit hash
  • The tag name

The build system intentionally uses the tag name ref to name the build archives, but the workflow's checksum file generation code expects the files to be named using the commit hash ref. This resulted in a spurious failure of the "Create checksum file" step of the checksums job with an error of the form:

sha256sum: 'arduino-lint_test-052e9032aa396ac0a4c356eaf7c8dc5ca3f4ad4b-git-snapshot*': No such file or directory
Error: Process completed with exit code 1.

The ref selection behavior of the checksum generation code could be corrected. However, there is no point in generating a tester build on tag push, since a tester build will have already been generated for that revision previously via the commit push, and any necessary validation already performed prior to the tag push. The "Release" workflow is triggered by the tag push so builds are produced for that revision regardless. For this reason, the correct resolution for this bus is to prevent the production of a tester build when the workflow is triggered by the tag push.

To fix this issue, the run-determination job is configured to check for the presence of a tag by comparing github.ref against a regular expression (defined via the TAG_REGEX shell environment variable). If there is a match, the other jobs are skipped, preventing the workflow from failing at later stages.

The "Publish Tester Build" workflow is triggered by the `push` event. This event occurs on tag pushes in addition to
commit pushes.

On a tag push, there is an ambiguity in how the build should be identified, since the revision has two Git refs:

- The commit hash
- The tag name

The build system intentionally uses the tag name ref to name the build archives, but the workflow's checksum file
generation code expects the files to be named using the commit hash ref. This resulted in a spurious failure of the
"Create checksum file" step of the `checksums` job with an error of the form:

```
sha256sum: 'arduino-lint_test-052e9032aa396ac0a4c356eaf7c8dc5ca3f4ad4b-git-snapshot*': No such file or directory
Error: Process completed with exit code 1.
```

The ref selection behavior of the checksum generation code could be corrected. However, there is no point in generating
a tester build on tag push, since a tester build will have already been generated for that revision previously via the
commit push, and any necessary validation already performed prior to the tag push. The "Release" workflow is triggered
by the tag push so builds are produced for that revision regardless. For this reason, the correct resolution for this
bus is to prevent the production of a tester build when the workflow is triggered by the tag push.

To fix this issue, the `run-determination` job is configured to check for the presence of a tag by comparing
`github.ref` against a regular expression (defined via the `TAG_REGEX` shell environment variable). If there is a match,
the other jobs are skipped, preventing the workflow from failing at later stages.
@per1234 per1234 added topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project labels Oct 16, 2024
@per1234 per1234 self-assigned this Oct 16, 2024
@per1234 per1234 merged commit c5305c0 into arduino:main Oct 16, 2024
20 checks passed
@per1234 per1234 deleted the tester-tag branch October 16, 2024 02:01
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.

1 participant