-
Notifications
You must be signed in to change notification settings - Fork 81
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
Fix size deltas report infrastructure configuration #430
Merged
aentinger
merged 2 commits into
arduino-libraries:master
from
per1234:fix-compile-examples
Feb 21, 2024
Merged
Fix size deltas report infrastructure configuration #430
aentinger
merged 2 commits into
arduino-libraries:master
from
per1234:fix-compile-examples
Feb 21, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This partially reverts commit 836771a. The repository infrastructure uses the "arduino/report-size-deltas" action to generate a report of the changes in memory usage of the example sketches that would result from merging a pull request. There are two use patterns for the "arduino/report-size-deltas" action: * Run from a workflow triggered by a `schedule` event. * Run from the same workflow as the "arduino/compile-sketches" action when triggered by a `pull_request` event. The latter use pattern is only suitable for private repositories. The reason is that, when a pull request is submitted from a fork, the permissions of the access token used by the "arduino/report-size-deltas" action are downgraded to read-only in workflows triggered by a `pull_request` event, which means it is unable to make the report comment. The reverted commit migrated the size deltas report infrastructure from the first use pattern to the second, which caused the "Compile Examples" workflow runs to fail on pull requests submitted from forks: Error: HTTPError: HTTP Error 403: Forbidden For this reason, the infrastructure must be reverted back to using the first use pattern.
The "sketches-reports-source" input of the "arduino/report-size-deltas" GitHub Actions action defines the regular expression that matches the names of the sketches report workflow artifacts produced by the "Compile Examples" workflow. The key string in the names of these artifacts was set to "sketches-report" when the "Compile Examples" workflow was adjusted for compatibility with the breaking changes introduced by updating to version 4.x of the workflow's "actions/upload-artifact" GitHub Actions action dependency. The pattern set in the size deltas report workflow was "sketches-reports". The "s" at the end of that pattern caused it to no longer match against the key string in the artifact names after that adjustment of the "Compile Examples" workflow, resulting in size deltas reports no longer being generated by the workflow. Although a minimal fix would be to simply remove the "s" from the end of the pattern, the decision was made to use a more strict regular expression. This will make it easier for maintainers and contributors to understand that this value is a regular expression and the exact nature of how that regular expression functions (which is less clear when relying on the "arduino/report-size-deltas" action's partial pattern matching behavior).
per1234
added
type: imperfection
Perceived defect in any part of project
topic: infrastructure
Related to project infrastructure
labels
Feb 21, 2024
Note for reviewers: The re-added |
aentinger
approved these changes
Feb 21, 2024
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.
Per, thank you very much for the detailed explanation 🙇 . Superb work!
This was referenced Feb 21, 2024
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
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.
Revert Size Deltas Report Infrastructure Back to Public Repository-Appropriate Configuration
The repository infrastructure uses the arduino/report-size-deltas GitHub Actions action to generate a report of the changes in memory usage of the example sketches that would result from merging a pull request.
There are two use patterns for the arduino/report-size-deltas action:
schedule
eventpull_request
eventThe latter use pattern is only suitable for private repositories. The reason is that, when a pull request is submitted from a fork, the permissions of the access token used by the arduino/report-size-deltas action are downgraded to read-only in workflows triggered by a
pull_request
event, which means it is unable to make the report comment.The reverted commit migrated the size deltas report infrastructure from the first use pattern to the second, which caused the "Compile Examples" workflow runs to fail on pull requests submitted from forks:
https://github.com/arduino-libraries/ArduinoIoTCloud/actions/runs/7985568163/job/21816272872?pr=427#step:4:18
For this reason, the infrastructure must be reverted back to using the first use pattern.
Fix Regression in Size Deltas Report Infrastructure Configuration
The
sketches-reports-source
input of the arduino/report-size-deltas action defines the regular expression that matches the names of the sketches report workflow artifacts produced by the "Compile Examples" workflow.The key string in the names of these artifacts was set to "sketches-report" when the "Compile Examples" workflow was adjusted for compatibility (#423) with the breaking changes introduced by updating to version 4.x of the workflow's actions/upload-artifact GitHub Actions action dependency (#419):
ArduinoIoTCloud/.github/workflows/compile-examples.yml
Line 303 in 836771a
The pattern set in the size deltas report workflow was "sketches-reports":
ArduinoIoTCloud/.github/workflows/report-size-deltas.yml
Line 14 in c2a9992
The
s
at the end of that pattern caused it to no longer match against the key string in the artifact names after that adjustment of the "Compile Examples" workflow, resulting in size deltas reports no longer being generated by the workflow.Although a minimal fix would be to simply remove the
s
from the end of the pattern, the decision was made to use a more strict regular expression. This will make it easier for maintainers and contributors to understand that this value is a regular expression and the exact nature of how that regular expression functions (which is less clear when relying on the arduino/report-size-deltas action's partial pattern matching behavior).