Add safeguards for 3MF post-processing scripts#1
Conversation
Ignore empty bambustudioopen URI triggers, log problematic input URIs during extraction failures, and bump the package version to 0.1.2.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 99f5bcf180
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| parser.add_argument( | ||
| "--version", | ||
| action="version", | ||
| version=f"%(prog)s {package_version('slicer-uri-bridge')}", |
There was a problem hiding this comment.
Guard CLI version lookup when package metadata is absent
build_parser() now calls package_version('slicer-uri-bridge') unconditionally while constructing the parser, so environments that run from source (for example PYTHONPATH=src or python -m slicer_uri_bridge before installation) raise importlib.metadata.PackageNotFoundError before argument parsing. This makes all CLI subcommands fail, not just --version, and breaks the documented module-entry fallback path; the lookup should be wrapped with a fallback version string instead of crashing parser creation.
Useful? React with 👍 / 👎.
Adds an optional safety check for downloaded 3MF files that contain embedded post-processing scripts.
By default, the bridge warns the user when scripts are found, records the detected script details in the log for inspection, and still opens the file in Bambu Studio. This check runs before launching Bambu Studio and only applies to downloaded
.3mffiles.The behavior is configurable with
post_process_actioninconfig.toml:warn: show a warning and continue opening the fileblock: show an error and do not open Bambu Studioignore: skip this checkAdditional URI handling fixes:
bambustudioopen:///callbacks from bambulab.com as no-op triggers, avoiding an invalid URI error during login flows.This also updates the README and changelog with the new behavior and configuration options.