mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-30 17:05:35 -05:00
Harden the Sliced G-code Comparison Against Broken Artifacts and Comments
A corrupt or encrypted zip member, or a bad file name, is now an artifact error, so a broken artifact gets the "made no comparison" note instead of stopping the comment, and the report step writes a report whatever fails. The fence also drops format, C1 and line separator characters. The comment is posted before the old one is deleted, comments without a user are skipped, a body GitHub returns with other line ends counts as unchanged, and a download redirect must be https. The commenter's concurrency group is on the job, so the skipped wakes of other labels cannot take the place of a pending real one. New tests cover the bounded read of a member, a run on another branch, other bot comments, comments past the first page, the newest run of a commit, and the token never reaching the storage host.
This commit is contained in:
1 parent
2fa02ab758
commit
c7981ba94c
4 files changed
+230
-28
No files matched your search
@@ -23,11 +23,6 @@ permissions:
|
||||
# Needed to delete outdated bot comments through the issues/comments endpoint.
|
||||
issues: write
|
||||
|
||||
# One handler at a time per source branch, so two wakes cannot race delete-and-post.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
post_comment:
|
||||
name: Post the comparison comment
|
||||
@@ -35,6 +30,11 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
# A label workflow run for any other label is skipped and has nothing to wake.
|
||||
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion != 'skipped' }}
|
||||
# One handler at a time per source branch, so two wakes cannot race post-and-delete. On the
|
||||
# job, not the workflow, so the skipped wakes of other labels never take a pending place.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }}
|
||||
cancel-in-progress: false
|
||||
steps:
|
||||
- name: Checkout the scripts from the default branch
|
||||
uses: actions/checkout@v7
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Update the comment
|
||||
# A failure would leave a red check on the pull request, which blocks pr-merge-bot.
|
||||
# The comparison is not a check; a failure is reported in the log and the next wake retries.
|
||||
continue-on-error: true
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
|
||||
@@ -383,7 +383,7 @@ jobs:
|
||||
// A label added with the workflow token starts no workflow, so without the app
|
||||
// token the comment waits for a build to finish.
|
||||
const when = process.env.STARTS_WORKFLOWS === 'true'
|
||||
? 'is posted when the build of the latest commit finishes, or shortly if it already has'
|
||||
? 'is posted when the build of the latest commit finishes, or shortly if it already has (with a note saying why if there is none); a maintainer may first have to approve the run'
|
||||
: 'is posted when the running build finishes, or after the next push that builds; a PR that changes no built file gets none';
|
||||
try {
|
||||
await github.rest.issues.createComment({
|
||||
|
||||
Reference in new issue
Block a user