fix: generate DIM-compatible package and cover names#10
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
naming_utils.py (1)
4-4: ⚡ Quick winAdd return type hints to all functions.
All five functions have parameter type hints but lack return type annotations. Adding
-> strimproves type safety and IDE support.📝 Proposed addition of return type hints
-def sanitize_dim_zip_product_name(product_name: str, fallback: str = "Package") -> str: +def sanitize_dim_zip_product_name(product_name: str, fallback: str = "Package") -> str: -def sanitize_support_filename_segment(value: str, fallback: str = "") -> str: +def sanitize_support_filename_segment(value: str, fallback: str = "") -> str: -def format_dim_sku(sku: str) -> str: +def format_dim_sku(sku: str) -> str: -def build_dim_zip_filename( +def build_dim_zip_filename( prefix: str, sku: str, product_part: int, product_name: str, fallback_prefix: str = "IM", ) -> str: -def build_support_cover_filename(store: str, sku: str, product_name: str) -> str: +def build_support_cover_filename(store: str, sku: str, product_name: str) -> str:Also applies to: 9-9, 14-14, 21-21, 35-35
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@naming_utils.py` at line 4, Several functions lack return type annotations; update each function signature to include an explicit -> str return type. For example, change sanitize_dim_zip_product_name(product_name: str, fallback: str = "Package") to include -> str and do the same for the other four functions in this module (the ones at the other diff locations on lines 9, 14, 21, and 35), ensuring each function signature declares -> str to improve type safety and IDE support.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@naming_utils.py`:
- Line 4: Several functions lack return type annotations; update each function
signature to include an explicit -> str return type. For example, change
sanitize_dim_zip_product_name(product_name: str, fallback: str = "Package") to
include -> str and do the same for the other four functions in this module (the
ones at the other diff locations on lines 9, 14, 21, and 35), ensuring each
function signature declares -> str to improve type safety and IDE support.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: dcfa568f-3e96-49d2-bbac-3a5122a15253
📒 Files selected for processing (4)
app.pynaming_utils.pypackaging_utils.pytests/test_naming_utils.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build-windows
🔇 Additional comments (4)
naming_utils.py (1)
1-39: LGTM!app.py (1)
778-784: LGTM!packaging_utils.py (1)
137-141: LGTM!Also applies to: 202-207
tests/test_naming_utils.py (1)
11-48: LGTM!
Overview
This fixes DIM package and Runtime/Support cover naming so generated packages are recognized correctly by DAZ Install Manager and Smart Content. Closes #9.
Why We Changed This
DIM expects the product-name segment of package ZIP files to contain only letters and digits. The previous naming kept underscores, hyphens, and dots in the ZIP product segment, which could cause DIM to ignore the archive.
Smart Content also expects the Runtime/Support cover image to match the generated support metadata basename. Product names containing dots, such as
G8.1, could produce a.jpgname that did not match DIM’s.dsxname, causing the cover image to be lost.Changes
Supplement.dsx.Verification
python -m unittest discover -s testspython -m compileall app.py packaging_utils.py naming_utils.py testsgit diff --checkSummary by CodeRabbit
Refactor
Tests