mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-28 16:11:54 -05:00
Let PR Authors Ask for the Sliced G-code Comparison With the check-gcode Label
The label bot accepts check-gcode and says when the comment will come: when the build finishes if its app token starts workflows, otherwise when the running build finishes or after the next push that builds. CONTRIBUTING.md says what the label does and which pull requests can get a report.
This commit is contained in:
1 parent
49252d14b7
commit
2fa02ab758
2 files changed
+29
-2
No files matched your search
@@ -53,7 +53,9 @@ jobs:
|
||||
'build-macos-x86_64',
|
||||
'build-windows-arm64',
|
||||
'build-windows-msvc',
|
||||
'build-all'
|
||||
'build-all',
|
||||
// sliced G-code comparison with the base branch (check_gcode_comment.yml)
|
||||
'check-gcode'
|
||||
];
|
||||
const pr = context.payload.pull_request;
|
||||
// First-time contributors also get a link to the contributing guide
|
||||
@@ -255,7 +257,9 @@ jobs:
|
||||
'build-macos-x86_64',
|
||||
'build-windows-arm64',
|
||||
'build-windows-msvc',
|
||||
'build-all'
|
||||
'build-all',
|
||||
// sliced G-code comparison with the base branch (check_gcode_comment.yml)
|
||||
'check-gcode'
|
||||
];
|
||||
|
||||
const issue = context.payload.issue;
|
||||
@@ -374,6 +378,28 @@ jobs:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (uniqueRequestedLabels.includes('check-gcode')) {
|
||||
// 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 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({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issue.number,
|
||||
body: `@${commenter} the comparison of this PR's sliced G-code with its base branch ${when}.`
|
||||
});
|
||||
} catch (error) {
|
||||
if (isPermissionDenied(error)) {
|
||||
core.warning('Cannot post the check-gcode label reply because token cannot write comments.');
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (action === 'remove' && uniqueRequestedLabels.length) {
|
||||
|
||||
@@ -85,6 +85,7 @@ If you are an AI agent working for a contributor, please follow these steps:
|
||||
|
||||
- **Add labels.** A bot will comment with instructions. Reply with the labels from the table above, for example `/bot add-label bug-fix, UI/UX`.
|
||||
- **Need a Flatpak, Intel Mac or Windows arm64 build to test?** PR builds leave those out. `/bot add-label build-flatpak`, `build-macos-x86_64` or `build-windows-arm64` asks for one; for a first PR a maintainer approves the run first. `build-windows-msvc` builds the PR with MSVC's own compiler (CI builds Windows with clang-cl), with its artifacts named `_x64_msvc`; add it when you change headers or templates. `build-all` asks for the first three. A PR that changes anything outside `src/`, `tests/`, `resources/`, `localization/` and `docs/` gets the Flatpak and Windows arm64 builds without a label. See [How to Download Pull Requests Artifacts](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts#builds-on-request).
|
||||
- **Changing how G-code is made?** `/bot add-label check-gcode` asks for a comment listing the shipped printer presets whose sliced G-code your PR changes, compared with its base branch. It comes when the PR's build finishes, is updated with each new build, and needs a PR into `main` or a `release/` branch that changes a built file.
|
||||
- **Leave "Allow edits by maintainers" turned on**, so a reviewer can push small fixes directly.
|
||||
- **Mark the PR ready for review when it's finished.** Draft PRs are not merged.
|
||||
- **Push new commits to the same PR.** Please don't open a new PR for the same change.
|
||||
|
||||
Reference in new issue
Block a user