Repository navigation
fix(scripts): refuse destructive --out targets and skip fork PR labelling - #409
Merged
Merged
Conversation
…ling build_plugin_dist.py --out rmtree'd any existing directory with no prompt; `--out .` would have wiped the checkout. It now refuses the repo, any parent of it, any git checkout, and a non-empty directory unless --force is given. Release builds into a fresh $RUNNER_TEMP path and is unaffected. tests/test_build_plugin_dist.py covers each refusal and runs in Validate; the repo-root cases test unsafe_out() directly so a guard regression cannot delete the checkout under test. label-sync's gh pr edit 403s on every fork PR (a fork's token is read-only), and release-gate.sh refuses to release a merge whose PR has a failed check, so the first outside contribution would have blocked releases. The job now skips forks, drops its unused checkout, and no longer passes --force to gh label create, which reset existing labels' colour and description on every run. Closes #352 Closes #351 Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
CI evidence before merge: all checks pass ( 13 pass ). Blender Smoke on PR head: Blender 5.2.2 LTS / Blender 4.5.14 LTS. Summaries (happy path; falsifiers) per leg: 143 passed, 1 skipped, 0 failed;142 passed, 0 skipped, 0 failed;141 passed, 3 skipped, 0 failed;136 passed, 6 skipped, 0 failed; |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #352. Closes #351.
#352:
build_plugin_dist.py --outdeleted any existing directoryNew
unsafe_out()check, applied before anything is touched. It refuses:.git, even with--force;--forceis given.A refusal exits 2.
release.ymlbuilds into a fresh$RUNNER_TEMP/plugin-dist, so it is unaffected.--checkis unaffected too.New
tests/test_build_plugin_dist.py(6 tests), wired into Validate. The repo-root and parent cases callunsafe_out()directly, nevermain(), so a future guard regression can't delete the checkout running the test.#351: Auto-label failed on every fork PR, which would block releases
head.repo.full_name == github.repository. A fork'sGITHUB_TOKENis read-only, sogh pr editwould 403, andrelease-gate.shrefuses a merge whose PR has a failed check.actions/checkoutis dropped.GH_REPOis set soghworks without a checkout.gh label createno longer passes--force, which reset existing labels' colour and description to grey on every run.Evidence
Proven locally (Python 3.13, Windows):
python tests/test_build_plugin_dist.py -v: 6/6 OK.python scripts/build_plugin_dist.py --check:plugin dist: 67 files, 0.27 MB ok.reason = None, three tests fail (test_refuses_non_empty_dir_without_force,test_refuses_git_checkout_even_with_force,test_force_replaces_previous_build).By inspection only: the fork
if:cannot be exercised without a fork PR. This PR's own label run (same-repo) should still apply labels, which is the observable check.🤖 Generated with Claude Code