Fix size deltas report infrastructure configuration #430
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).