From 3dfd7393c27663967a2d049ddbce7a4c98215c15 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 11:14:37 -0800 Subject: [PATCH 1/5] Paint: an opacity call refuses a bad target with an id or selected characters The opacity path of paint.setFill and paint.setStroke (apply_paint_opacity) never checked `target` or `aligned`. With `id` or `ids` naming an object, item_target reads no `target`, so a call such as {"opacity": 40, "target": "content", "id": ...} painted the object instead of failing. The test added in 6898eed99 covers that case, and the opacity path from 4f065ccbb (Show Opacity in the Color Wheel panel) merged beside it without the check, so main's gate failed on tests::paintopacity::a_bad_target_is_refused_with_an_id_or_selected_characters. The opacity path now runs the same two checks as the color path (tool_color_params): appearance::aligned and appearance::targets_contents. Valid values are read where they were before. --- crates/engine/src/cmd/paint.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/engine/src/cmd/paint.rs b/crates/engine/src/cmd/paint.rs index 0606ba0130..1ac467789c 100644 --- a/crates/engine/src/cmd/paint.rs +++ b/crates/engine/src/cmd/paint.rs @@ -945,6 +945,10 @@ fn apply_paint_opacity(s: &mut Session, p: &Value, paint: Option, opacity let cmd = if fill { "paint.setFill" } else { "paint.setStroke" }; let for_tool = tool_color_params(s, p, cmd, !fill)?; let p = for_tool.as_ref().unwrap_or(p); + // A bad `target` or `aligned` is refused for every kind of target: `item_target` reads no + // `target` once `id` or `ids` names an object, and selected characters read neither. + super::appearance::aligned(p, cmd)?; + super::appearance::targets_contents(p)?; let focus = switch_or(p, "focus", true, cmd)?; // An opacity alone places no gradient, so `span` may only be "object" with it. let span = spans_targets(p, paint.as_ref().unwrap_or(&Paint::None)).map_err(|e| bad(cmd, e))?; From 741b18b55898efe2def3fef0a7e7d9a913907345 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 11:25:23 -0800 Subject: [PATCH 2/5] 3D: OK ends the running preview before checking the values again #9835 made OK start a fresh preview to validate the values afresh, but it replaced the running LivePreview without ending it. A fresh preview does not start while another interaction is open, so with Preview on OK was refused and the old preview's interaction stayed open. Reopening the effect then could not preview: main's gate failed on dialogs::revolve::tests::lighting_presets_cancel_restores_an_existing_custom_light_rig. OK now ends the running preview with cancel_preview first, then runs the fresh preview and commits it as before. --- crates/ui-egui/src/dialogs/three_d.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/dialogs/three_d.rs b/crates/ui-egui/src/dialogs/three_d.rs index 4706074962..460d8327f2 100644 --- a/crates/ui-egui/src/dialogs/three_d.rs +++ b/crates/ui-egui/src/dialogs/three_d.rs @@ -254,8 +254,10 @@ fn ok(app: &mut VectorcraftApp, answer: &ParamResult) -> Result<(), String> { return Err(why); } let (cmd, p, _) = s.request(&answer.fields); - // OK must validate afresh: the live preview also caches refused requests. - s.preview = LivePreview::default(); + // OK must validate afresh: the live preview also caches refused requests. The running preview is ended first; + // a fresh preview refuses to start while another interaction is open, which left OK refused and the old + // preview's interaction open. + s.cancel_preview(app); match s.run_preview(app, cmd, &p) { Some(Ok(())) if finish_unchanged_preview(app) => return Ok(()), Some(Err(why)) => { From 488c7cba0cc579bb742a6c1fc84c6341e1a9354c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 11:29:06 -0800 Subject: [PATCH 3/5] Canvas: only a frame shown for its own view snaps to whole device pixels #9945 placed every frame drawn by reproject_frame on whole device pixels. That also moved the cached frame shown while the canvas is panned, zoomed, resized or moved to another display by up to half a device pixel, so it no longer sat where the document maps it, and main's gate failed on canvas::tests::cached_frames_keep_their_scale_during_resize_rotation_and_dpi_changes. A frame now snaps only when it was rendered for the current center, zoom, canvas size and pixel density. A frame reprojected while the view changes keeps its exact document mapping until the replacement arrives, and steady frames stay sharp as #9945 intended. --- crates/ui-egui/src/canvas/raster.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/canvas/raster.rs b/crates/ui-egui/src/canvas/raster.rs index 48f036012e..480497d7b9 100644 --- a/crates/ui-egui/src/canvas/raster.rs +++ b/crates/ui-egui/src/canvas/raster.rs @@ -987,7 +987,15 @@ fn reproject_frame(app: &VectorcraftApp, painter: &egui::Painter, view: &CanvasV let old = CanvasView::new(old_rect, Point::new(k.cx, k.cy), k.zoom).rotation(rotation); let a = view.to_screen(old.to_doc(old_rect.min)); let b = view.to_screen(old.to_doc(old_rect.max)); - let placed = snapped_rect(a, b - a, painter.pixels_per_point()); + // A frame shown for the view, size and pixel density it was rendered for lands on + // whole device pixels so its strokes stay sharp. A cached frame shown while the + // canvas is panned, zoomed, resized or moved to another display keeps its exact + // document mapping until the replacement arrives. + let device_ppp = painter.pixels_per_point(); + let current = (k.ppp - device_ppp).abs() < 1e-4 + && (k.cx, k.cy, k.zoom) == (view.center.x, view.center.y, view.zoom) + && (old_rect.size() - rect.size()).abs().max_elem() < 1.0; + let placed = if current { snapped_rect(a, b - a, device_ppp) } else { egui::Rect::from_min_max(a, b) }; painter.image(tex.id(), placed, egui::Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE); } // The view turned after the last frame was rendered, and the worker renders the frame at From 89a5b6417075bcf4624addd0ed1282a3ebe12897 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 28 Nov 2026 14:37:16 -0500 Subject: [PATCH 4/5] ci(nightly): roll out signing pin, macOS docs layout, and profile reopen fix (#9935) --- .github/nightly-signing-policy.json | 6 +- .github/workflows/nightly-sign.yml | 18 +++- .github/workflows/nightly.yml | 4 +- apps/vectorcraft/src/profile_root.rs | 113 +++++++++++++++++++++++++- packaging/macos/nightly.sh | 5 +- packaging/macos/nightly_sign_tests.py | 84 ++++++++++++++++++- packaging/nightly-release-tests.py | 94 ++++++++++++++++++++- 7 files changed, 309 insertions(+), 15 deletions(-) diff --git a/.github/nightly-signing-policy.json b/.github/nightly-signing-policy.json index d60a898fd1..f71d011ece 100644 --- a/.github/nightly-signing-policy.json +++ b/.github/nightly-signing-policy.json @@ -4,10 +4,10 @@ "repository_id": 1398097510, "producer_workflow_id": 430275079, "producer_workflow_path": ".github/workflows/nightly.yml", - "producer_tooling_revision": "be00e5ccd18b68e950c8a08532f2230e7c3d0cba", - "producer_workflow_ref": "storytold/craft-common-actions/.github/workflows/nightly-unsigned.yml@be00e5ccd18b68e950c8a08532f2230e7c3d0cba", + "producer_tooling_revision": "bf94b15b708089b95c4e2d1c978e66ecf1f2f4f3", + "producer_workflow_ref": "storytold/craft-common-actions/.github/workflows/nightly-unsigned.yml@bf94b15b708089b95c4e2d1c978e66ecf1f2f4f3", "signer_workflow_path": ".github/workflows/nightly-sign.yml", - "signer_tooling_revision": "be00e5ccd18b68e950c8a08532f2230e7c3d0cba", + "signer_tooling_revision": "bf94b15b708089b95c4e2d1c978e66ecf1f2f4f3", "release_branch": "nightly-signer", "manual_actors": [ "bflatastic", diff --git a/.github/workflows/nightly-sign.yml b/.github/workflows/nightly-sign.yml index 3b79c61ba5..698935efd7 100644 --- a/.github/workflows/nightly-sign.yml +++ b/.github/workflows/nightly-sign.yml @@ -34,12 +34,26 @@ jobs: checks: read attestations: write id-token: write - uses: storytold/craft-common-actions/.github/workflows/nightly-release.yml@be00e5ccd18b68e950c8a08532f2230e7c3d0cba + uses: storytold/craft-common-actions/.github/workflows/nightly-release.yml@bf94b15b708089b95c4e2d1c978e66ecf1f2f4f3 with: - tooling-revision: be00e5ccd18b68e950c8a08532f2230e7c3d0cba + tooling-revision: bf94b15b708089b95c4e2d1c978e66ecf1f2f4f3 app-name: vectorcraft producer_run_id: ${{ inputs.producer_run_id }} producer_run_attempt: ${{ inputs.producer_run_attempt }} + secrets: + APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} + APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} + KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} + AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} + AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} + AZURE_SIGNING_ENDPOINT: ${{ secrets.AZURE_SIGNING_ENDPOINT }} + AZURE_SIGNING_ACCOUNT: ${{ secrets.AZURE_SIGNING_ACCOUNT }} + AZURE_CERT_PROFILE: ${{ secrets.AZURE_CERT_PROFILE }} + LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }} # No secrets: inherit or raw platform values in this caller. Only the isolated native # callee job may bind the release environment and export its keys; that environment must # admit nightly-signer alongside release before the first dispatch. diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 989d6974dd..6c8d2ebe7e 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -22,9 +22,9 @@ jobs: actions: read attestations: write id-token: write - uses: storytold/craft-common-actions/.github/workflows/nightly-unsigned.yml@be00e5ccd18b68e950c8a08532f2230e7c3d0cba + uses: storytold/craft-common-actions/.github/workflows/nightly-unsigned.yml@bf94b15b708089b95c4e2d1c978e66ecf1f2f4f3 with: - tooling-revision: be00e5ccd18b68e950c8a08532f2230e7c3d0cba + tooling-revision: bf94b15b708089b95c4e2d1c978e66ecf1f2f4f3 app-name: vectorcraft manual-actors: '["bflatastic","dylanmtaylor","echelon","FredApps","skylartaylor"]' craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83 diff --git a/apps/vectorcraft/src/profile_root.rs b/apps/vectorcraft/src/profile_root.rs index f8cf51eaeb..7f46e77766 100644 --- a/apps/vectorcraft/src/profile_root.rs +++ b/apps/vectorcraft/src/profile_root.rs @@ -175,7 +175,16 @@ fn forbidden_roots(platform: Platform, env: &impl Fn(&str) -> Option, fn private_subdirectory(root: &Path, name: impl AsRef, label: &str) -> Result { let chosen = canonical_future(&absolute(root.to_path_buf(), "the nightly profile root")?)?; - let child = canonical_future(&chosen.join(name))?; + let target = chosen.join(name); + match std::fs::symlink_metadata(&target) { + Ok(metadata) if !metadata.is_dir() => { + return Err(format!("the nightly {label} must be a directory inside its selected profile")); + } + Ok(_) => {} + Err(error) if error.kind() == std::io::ErrorKind::NotFound => {} + Err(error) => return Err(format!("cannot inspect the nightly {label}: {error}")), + } + let child = canonical_future(&target)?; if child == chosen || !child.starts_with(&chosen) { return Err(format!("the nightly {label} must stay inside its selected profile")); } @@ -192,11 +201,86 @@ fn entries_stay_inside(root: &Path) -> Result<(), String> { }; for entry in entries { let entry = entry.map_err(|e| format!("cannot inspect the nightly profile: {e}"))?; - private_subdirectory(root, entry.file_name(), "profile entry")?; + let path = entry.path(); + let metadata = std::fs::symlink_metadata(&path).map_err(|e| format!("cannot inspect the nightly profile: {e}"))?; + // Settings and session state are ordinary files, not directories. Keep the existing + // directory-boundary check for folders (including the known folder-only entries). + let folder_only = PROFILE_FOLDERS.iter().any(|name| entry.file_name().eq_ignore_ascii_case(name)); + if metadata.is_file() && !folder_only { + private_regular_file(&path, &metadata)?; + } else { + private_subdirectory(root, entry.file_name(), "profile entry")?; + } } Ok(()) } +/// Persisted files must have their own ordinary file identity, not an alias to other data. +fn private_regular_file(path: &Path, metadata: &std::fs::Metadata) -> Result<(), String> { + #[cfg(unix)] + { + use std::os::unix::fs::MetadataExt as _; + if metadata.nlink() != 1 { + return Err("the nightly profile file must not be shared".into()); + } + } + #[cfg(all(windows, feature = "wgpu"))] + { + use winsafe::{HFILE, co}; + let (file, _) = HFILE::CreateFile( + path.to_str().ok_or("the nightly profile file path is not textual")?, + co::GENERIC::default(), + Some(co::FILE_SHARE::READ | co::FILE_SHARE::WRITE | co::FILE_SHARE::DELETE), + None, + co::DISPOSITION::OPEN_EXISTING, + co::FILE_ATTRIBUTE::NORMAL, + Some(co::FILE_FLAG::OPEN_REPARSE_POINT), + None, + None, + ) + .map_err(|e| e.to_string())?; + let info = file.GetFileInformationByHandle().map_err(|e| e.to_string())?; + if info.dwFileAttributes.has(co::FILE_ATTRIBUTE::REPARSE_POINT) || info.dwFileAttributes.has(co::FILE_ATTRIBUTE::DIRECTORY) { + return Err("the nightly profile file must not be an alias or directory".into()); + } + if info.nNumberOfLinks != 1 { + return Err("the nightly profile file must not be shared".into()); + } + } + #[cfg(all(windows, not(feature = "wgpu")))] + { + use std::os::windows::fs::MetadataExt as _; + const FILE_ATTRIBUTE_DIRECTORY: u32 = 0x10; + const FILE_ATTRIBUTE_REPARSE_POINT: u32 = 0x400; + if metadata.file_attributes() & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_REPARSE_POINT) != 0 { + return Err("the nightly profile file must not be an alias or directory".into()); + } + } + let _ = (path, metadata); + Ok(()) +} + +const PROFILE_FOLDERS: [&str; 18] = [ + "Data Recovery", + "Fonts", + "logs", + "Launch", + "Color Profiles", + "Plug-ins", + "Scripts", + "Startup Scripts", + "Metadata Templates", + "New Document Profiles", + "Proof Setups", + "Script Data", + "PDF Presets", + "Swatches", + "Graphic Styles", + "Symbols", + "Brushes", + "Libraries", +]; + /// Recognise the shared portable data namespace in both the supplied and the resolved path. Up to /// the chosen folder itself, a marker only counts beside a VectorCraft executable, so an unrelated /// `portable.txt` higher up (in a user folder or at a drive root) does not refuse the profile. @@ -557,6 +641,31 @@ mod tests { assert!(result.unwrap_err().contains("not writable")); } + #[test] + fn nightly_profile_reopens_after_saving_settings_and_session_state() { + let fixture = Fixture::new(); + for platform in PLATFORMS { + let private = fixture.root.join(format!("nightly-reopen-{platform:?}")); + assert_eq!(fixture.check(platform, &private).unwrap(), private); + for name in ["config.toml", "instance.json", "Color Settings.json", "app.ron"] { + std::fs::write(private.join(name), b"saved profile data").unwrap(); + } + for name in PROFILE_FOLDERS { + std::fs::create_dir(private.join(name)).unwrap(); + } + assert_eq!(fixture.check(platform, &private).unwrap(), private); + assert_eq!(std::fs::read(private.join("config.toml")).unwrap(), b"saved profile data"); + for name in PROFILE_FOLDERS { + let path = private.join(name); + std::fs::remove_dir(&path).unwrap(); + std::fs::write(&path, b"not a directory").unwrap(); + assert!(fixture.check(platform, &private).is_err(), "{name} must stay a directory"); + std::fs::remove_file(&path).unwrap(); + std::fs::create_dir(&path).unwrap(); + } + } + } + #[test] fn the_platform_case_rules_are_the_file_systems_ones() { let fixture = Fixture::new(); diff --git a/packaging/macos/nightly.sh b/packaging/macos/nightly.sh index b6b1232954..f75079e392 100644 --- a/packaging/macos/nightly.sh +++ b/packaging/macos/nightly.sh @@ -35,11 +35,12 @@ OUTPUT="$DIST/vectorcraft-$VERSION-macos-aarch64-nightly.zip" nightly_compile_gui APP="$NIGHTLY_WORK/stage/$MAC_NIGHTLY_APP" -mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources" +mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources/docs" cp "$NIGHTLY_GUI" "$APP/Contents/MacOS/VectorCraft" chmod 755 "$APP/Contents/MacOS/VectorCraft" cp "$ROOT/assets/app-icon/vectorcraft-nightly.icns" "$APP/Contents/Resources/vectorcraft-nightly.icns" -nightly_copy_notices "$APP/Contents/Resources" +# Launcher admits notices under Resources/docs, not beside the icon. +nightly_copy_notices "$APP/Contents/Resources/docs" # The private mktemp cwd is the helper authority root: stage the template inside it. cp "$HERE/Info.plist.in" "$NIGHTLY_WORK/Info.plist.in" (cd "$NIGHTLY_WORK" && python3 "$HERE/nightly_plist.py" --template Info.plist.in \ diff --git a/packaging/macos/nightly_sign_tests.py b/packaging/macos/nightly_sign_tests.py index 67bf33e478..36277c15b6 100644 --- a/packaging/macos/nightly_sign_tests.py +++ b/packaging/macos/nightly_sign_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python3 """The macOS Nightly signing and verification scripts, run on any POSIX host against generated fixtures and stand-in Apple tools (codesign, notarytool, stapler, spctl, security, ditto, plutil, -lipo) that log their arguments. This proves the scripts' order, refusals and cleanup; it is not a -real signature, notarization or Mac run.""" +lipo) that log their arguments. The unsigned producer also runs with a stub GUI build. These +check the scripts and bundle layout, not native signing, notarization or Mac execution.""" import base64 import importlib.util import json @@ -27,6 +27,8 @@ COMMIT = "b" * 40 VERSION = "0.23.1-nightly.20261123.4567.1.g" + COMMIT[:12] ASSET = f"vectorcraft-{VERSION}-macos-aarch64-nightly.zip" APP = "VectorCraft Nightly.app" +APP_NOTICES = ("README.md", "LICENSE-MIT", "LICENSE-APACHE", "NOTICE", "ATTRIBUTION.md") +OPTIONAL_NOTICES = ("LICENSE", "COPYRIGHT") TEAM = "ABCDE12345" IDENTITY = "0123456789ABCDEF0123456789ABCDEF01234567" # Every fixture credential carries the same value, so no line here reads like a real one. @@ -185,6 +187,50 @@ class Fixture: z.writestr(info, b"" if path.is_dir() else path.read_bytes()) return self.input + def package(self, font_licences): + """Drive the real producer from a clean fixture checkout, without Cargo or Apple tools.""" + source = HERE.parents[1] + checkout = self.root / "source" + checkout.mkdir() + notices = APP_NOTICES + tuple(name for name in OPTIONAL_NOTICES if (source / name).is_file()) + for relative in (*notices, "packaging/env.sh", "packaging/nightly-common.sh", "packaging/nightly_paths.py", + "packaging/macos/nightly.sh", "packaging/macos/nightly-lib.sh", + "packaging/macos/Info.plist.in", "packaging/macos/nightly_plist.py", + "assets/app-icon/vectorcraft-nightly.icns"): + target = checkout / relative + target.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(source / relative, target) + env = self.env(**dict.fromkeys(SECRETS)) + + def git(*args): + return subprocess.run(["git", "-c", "core.hooksPath=/dev/null", "-c", "commit.gpgsign=false", *args], + cwd=checkout, env=env, check=True, capture_output=True, text=True, timeout=30).stdout + + git("init", "-q") + git("add", "--", ".") + git("-c", "user.name=Fixture", "-c", "user.email=fixture@example.invalid", "commit", "-qm", "Packaging fixture") + commit = git("rev-parse", "HEAD").strip() + version = VERSION[:-12] + commit[:12] + # Generated licence text exercises the copier without depending on a font checkout. + fonts = self.root / "craft-fonts" + for family, data in font_licences.items(): + licence = fonts / "fonts" / family / "OFL.txt" + licence.parent.mkdir(parents=True) + licence.write_bytes(data) + # The existing cargo stub fails for every invocation. Only this producer fixture emits a GUI. + (self.bin / "cargo").write_text( + '#!/bin/sh\nset -eu\n' + 'gui="$CARGO_TARGET_DIR/aarch64-apple-darwin/release/vectorcraft"\n' + 'mkdir -p "$(dirname "$gui")"\n' + "printf \"#!/bin/sh\\necho 'VectorCraft %s (nightly-v1)'\\n\" \"$VECTORCRAFT_VERSION\" >\"$gui\"\n", + ) + result = self.run(checkout / "packaging/macos/nightly.sh", "--arch", "aarch64", **dict.fromkeys(SECRETS), + DIST=str(self.dist), CARGO_TARGET_DIR=str(self.root / "target"), CRAFT_FONTS_DIR=str(fonts), + VECTORCRAFT_BUILD_CHANNEL="nightly-v1", VECTORCRAFT_VERSION=version, + VECTORCRAFT_BUILD_SHA=commit, VECTORCRAFT_BUILD_DATE="2026-11-23") + assert result.returncode == 0, result.stdout + return self.dist / ASSET.replace(VERSION, version) + def env(self, **changes): env = {"PATH": f"{self.bin}:{os.environ['PATH']}", "HOME": str(self.root), "SHIM_LOG": str(self.log), "SHIM_TEAM": TEAM, "SHIM_IDENTITY": IDENTITY, "RUNNER_TEMP": str(self.temp), **SECRETS} @@ -433,6 +479,40 @@ class Verify(unittest.TestCase): class Build(unittest.TestCase): + def test_unsigned_archive_has_launcher_layout_and_keeps_all_notices(self): + f = Fixture(self) + fonts = {"fixture-one": b"generated font notice one", "fixture-two": b"generated font notice two"} + archive = f.package(fonts) + source = HERE.parents[1] + resources = f"{APP}/Contents/Resources" + icon = "vectorcraft-nightly.icns" + notice_files = {name: (source / name).read_bytes() for name in APP_NOTICES} + notice_files.update({name: (source / name).read_bytes() for name in OPTIONAL_NOTICES if (source / name).is_file()}) + notice_files.update({f"OFL-{family}.txt": data for family, data in fonts.items()}) + # Shipped Launcher v0.20.3 accepts these leaves only in Resources/docs, except for the root icon. + expected_files = {f"{resources}/docs/{name}": data for name, data in notice_files.items()} + expected_files[f"{resources}/{icon}"] = (source / "assets/app-icon" / icon).read_bytes() + contents = f"{APP}/Contents" + gui = f"{contents}/MacOS/VectorCraft" + with zipfile.ZipFile(archive) as zipped: + entries = zipped.infolist() + names = {entry.filename for entry in entries} + self.assertEqual(len(entries), len({name.casefold() for name in names}), "unique paths, ignoring case") + self.assertEqual({entry.filename for entry in entries if not entry.is_dir()}, + set(expected_files) | {gui, f"{contents}/Info.plist", f"{contents}/PkgInfo"}) + self.assertTrue({entry.filename for entry in entries if entry.is_dir()} <= { + f"{APP}/", f"{contents}/", f"{contents}/MacOS/", f"{resources}/", f"{resources}/docs/"}) + for path, data in expected_files.items(): + with self.subTest(path=path): + self.assertEqual(zipped.read(path), data) + mode = zipped.getinfo(path).external_attr >> 16 + self.assertTrue(stat.S_ISREG(mode)) + self.assertFalse(mode & 0o111) + mode = zipped.getinfo(gui).external_attr >> 16 + self.assertTrue(stat.S_ISREG(mode) and mode & stat.S_IXUSR) + result = f.run("nightly-verify.sh", "--input", archive, "--expect", "unsigned", **dict.fromkeys(SECRETS)) + self.assertEqual(result.returncode, 0, result.stdout) + def test_compilation_refuses_signing_material_before_building(self): f = Fixture(self) for name in ("APPLE_CERTIFICATE", "APPLE_PASSWORD", "MACOS_SIGN_IDENTITY", "WINDOWS_CERTIFICATE", "AZURE_CLIENT_SECRET", "LINUX_SIGNING_KEY"): diff --git a/packaging/nightly-release-tests.py b/packaging/nightly-release-tests.py index d0a2037a61..d6edc4c1ce 100755 --- a/packaging/nightly-release-tests.py +++ b/packaging/nightly-release-tests.py @@ -28,6 +28,12 @@ APP_NAME = "vectorcraft" PRODUCER_WORKFLOW_NAME = "VectorCraft unsigned nightly" NIGHTLY_PLATFORMS = ("windows-x86_64", "linux-x86_64", "macos-aarch64") +# The pinned shared registry enables Windows, Linux and macOS for VectorCraft. +SIGNER_SECRETS = { + "AZURE_CERT_PROFILE", "AZURE_CLIENT_ID", "AZURE_CLIENT_SECRET", "AZURE_SIGNING_ACCOUNT", + "AZURE_SIGNING_ENDPOINT", "AZURE_TENANT_ID", "LINUX_SIGNING_KEY", "APPLE_CERTIFICATE", + "APPLE_CERTIFICATE_PASSWORD", "APPLE_ID", "APPLE_PASSWORD", "APPLE_TEAM_ID", "KEYCHAIN_PASSWORD", +} # Each platform's one trust field in policy v3, and the public stable identity it must name. NIGHTLY_TRUST = { "windows-x86_64": ("publisher_subject", @@ -65,6 +71,49 @@ def assert_nightly_serialization(source): raise ValueError("nightly serialization must use its stable group and no cancellation") +def caller_entries(lines, indent): + """Split the callers' plain YAML block entries; refuse other forms at checked levels.""" + entries = {} + children = None + for line in lines: + if children is not None and line.startswith(" " * (indent + 1)): + children.append(line) + continue + row = re.fullmatch(r" " * indent + r"([A-Za-z0-9_-]+):(?: (.*))?", line) + if row is None or row[1] in entries: + raise ValueError("malformed or duplicate caller mapping entry") + children = [] + entries[row[1]] = row[2], children + return entries + + +def assert_caller_secrets(source, job_name, names): + """Check the actual caller's root, job and secret blocks without a YAML dependency.""" + lines = [line for line in source.splitlines() if line.strip() and not line.lstrip().startswith("#")] + root = caller_entries(lines, 0) + job_marker, job_lines = root.pop("jobs", (None, [])) + jobs = caller_entries(job_lines, 2) + if job_marker is not None or set(jobs) != {job_name} or jobs[job_name][0] is not None: + raise ValueError("the caller must have one plain job block") + job = caller_entries(jobs[job_name][1], 4) + if "environment" in job or "environment" in root or "secrets" in root: + raise ValueError("only the native callee may bind the environment") + if names: + if "secrets" not in job: + raise ValueError("signer requires an explicit target-specific secret map") + mode, secret_lines = job.pop("secrets") + expected = {name: ("${{ secrets." + name + " }}", []) for name in names} + if mode is not None or caller_entries(secret_lines, 6) != expected: + raise ValueError("signer must forward exactly the reviewed same-name secret references") + elif "secrets" in job: + raise ValueError("unsigned caller must not pass secrets") + for value, children in (*root.values(), *job.values()): + outside_map = "\n".join([value or "", *children]) + # Scan all remaining text: quoted braces can appear before a secret reference. + if re.search(r"(?im)^\s*environment:|\bsecrets\b", outside_map): + raise ValueError("secret bindings belong only in the signer map") + + def literal_off(condition): expression = " ".join(condition.split()) if expression.startswith("${{") and expression.endswith("}}"): @@ -231,8 +280,49 @@ class TrustedSourcePreparation(unittest.TestCase): with self.subTest(workflow=name): self.assertNotRegex(executable, r"(?im)^\s*(?:-\s*)?uses:\s*[^\n]*cache") self.assertNotRegex(executable, r"(?im)^\s*[^\s:#]*cache[^\s:#]*:") - self.assertNotRegex(executable, r"(?im)^\s*(?:environment|secrets):") - self.assertNotIn("secrets.", executable) + + def test_signer_forwards_exactly_the_reviewed_secret_names(self): + signer = (ROOT / ".github/workflows/nightly-sign.yml").read_text() + assert_caller_secrets(signer, "release", SIGNER_SECRETS) + + def test_signer_refuses_missing_extra_alias_duplicate_or_inherited_secrets(self): + signer = (ROOT / ".github/workflows/nightly-sign.yml").read_text() + header = " secrets:\n" + linux = " LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}\n" + self.assertIn(linux, signer) + mutations = { + "missing name": signer.replace(linux, ""), + "extra name": signer + " EXTRA: ${{ secrets.EXTRA }}\n", + "renamed source": signer.replace(linux, linux.replace("secrets.LINUX_SIGNING_KEY", "secrets.APPLE_ID")), + "duplicate name": signer.replace(linux, linux + linux), + "duplicate map": signer + header + linux, + "quoted duplicate map": signer + ' "secrets": inherit\n', + "inherit": signer.split(header)[0] + " secrets: inherit\n", + "yaml alias": signer.replace(linux, " LINUX_SIGNING_KEY: *other\n"), + "yaml merge": signer + " <<: *other\n", + "environment": signer + " environment: release\n", + "secret outside map": signer.replace("${{ inputs.producer_run_id }}", "${{ secrets.APPLE_ID }}"), + } + for change, source in mutations.items(): + with self.subTest(change=change), self.assertRaises(ValueError): + assert_caller_secrets(source, "release", SIGNER_SECRETS) + + def test_unsigned_caller_has_no_secrets(self): + producer = (ROOT / ".github/workflows/nightly.yml").read_text() + assert_caller_secrets(producer, "unsigned", set()) + for suffix in (" secrets: {}\n", " secrets: inherit\n", + " secrets:\n EXTRA: ${{ secrets.EXTRA }}\n", + " extra: ${{ secrets['EXTRA'] }}\n", " secrets: inherit\n"): + with self.subTest(suffix=suffix), self.assertRaises(ValueError): + assert_caller_secrets(producer + suffix, "unsigned", set()) + + def test_unsigned_caller_refuses_secret_after_format_brace(self): + producer = (ROOT / ".github/workflows/nightly.yml").read_text() + # This inert fixture is never dispatched; the brace is part of the format string. + env = "env:\n EXAMPLE: ${{ format('value {0}', secrets.EXAMPLE_ONLY) }}\n\n" + source = producer.replace("jobs:\n", env + "jobs:\n", 1) + with self.assertRaisesRegex(ValueError, "secret bindings belong only in the signer map"): + assert_caller_secrets(source, "unsigned", set()) class NightlyTrustAnchors(unittest.TestCase): From 0f2c1f9370e18e10fb901a1a12130511319d6484 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 12:05:17 -0800 Subject: [PATCH 5/5] i18n: drop the second copy of five Indonesian opacity messages #8099 added five @msg rows to id.tsv (the opacity messages for paint.setFill and paint.setStroke) that the catalog already had at lines 487 to 491, so main's gate failed on i18n::tests::bundled_catalogs_are_consistent with "defined twice (same context and source text)". The second copy is removed; the first copy is kept. --- crates/ui-egui/src/i18n/id.tsv | 5 ----- 1 file changed, 5 deletions(-) diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 499b782aa9..48af87f872 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -9200,11 +9200,6 @@ file-filter Applications Aplikasi @msg the layer effects of {n} layers weren't drawn efek lapisan dari {n} lapisan tidak digambar @msg the vector masks of 1 layer weren't applied masker vektor dari 1 lapisan tidak diterapkan @msg the vector masks of {n} layers weren't applied masker vektor dari {n} lapisan tidak diterapkan -@msg `opacity` must be a number from 0 to 100 `opacity` harus berupa angka dari 0 sampai 100 -@msg `opacity` must be true or false `opacity` harus true atau false -@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke karakter teks tidak memiliki opasitas sendiri: tambahkan isian atau guratan dengan Tambahkan isian baru atau Tambahkan guratan baru di panel Tampilan -@msg an object selected in a symbol instance has no fill or stroke opacity of its own objek yang dipilih dalam instans simbol tidak memiliki opasitas isian atau guratan sendiri -@msg no target has that fill or stroke to take the opacity tidak ada target yang memiliki isian atau guratan itu untuk menerima opasitas @msg give color, none, swatch, gradient or opacity berikan color, none, swatch, gradient, atau opacity @msg the knockout of 1 layer wasn't applied knockout dari 1 lapisan tidak diterapkan @msg the knockout of {n} layers wasn't applied knockout dari {n} lapisan tidak diterapkan