Skip to content

fix: generate DIM-compatible package and cover names#10

Merged
H1ghSyst3m merged 2 commits into
mainfrom
fix/package-and-file-namings
May 31, 2026
Merged

fix: generate DIM-compatible package and cover names#10
H1ghSyst3m merged 2 commits into
mainfrom
fix/package-and-file-namings

Conversation

@H1ghSyst3m

@H1ghSyst3m H1ghSyst3m commented May 31, 2026

Copy link
Copy Markdown
Owner

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 .jpg name that did not match DIM’s .dsx name, causing the cover image to be lost.

Changes

  • Added shared naming helpers for DIM ZIP names and Runtime/Support cover names.
  • Updated the live ZIP preview and actual packaging output to use the same DIM-compatible ZIP naming.
  • Updated cover image generation so dots are normalized to underscores while preserving existing hyphens and underscores.
  • Kept the human-readable product name unchanged in Supplement.dsx.
  • Added focused unit tests for the naming examples from the issue.

Verification

  • python -m unittest discover -s tests
  • python -m compileall app.py packaging_utils.py naming_utils.py tests
  • git diff --check

Summary by CodeRabbit

  • Refactor

    • Centralized filename generation logic into shared utilities for ZIP and cover image filenames.
  • Tests

    • Added comprehensive unit tests for filename generation, SKU formatting, and product name sanitization functions.

@coderabbitai

coderabbitai Bot commented May 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ca5f2251-eeaf-40af-92d9-f8005b1c3dd1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/package-and-file-namings

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
naming_utils.py (1)

4-4: ⚡ Quick win

Add return type hints to all functions.

All five functions have parameter type hints but lack return type annotations. Adding -> str improves 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

📥 Commits

Reviewing files that changed from the base of the PR and between fa638af and 1133aea.

📒 Files selected for processing (4)
  • app.py
  • naming_utils.py
  • packaging_utils.py
  • tests/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!

@H1ghSyst3m H1ghSyst3m added the bug Something isn't working label May 31, 2026
@H1ghSyst3m H1ghSyst3m merged commit e4c9f48 into main May 31, 2026
2 checks passed
@H1ghSyst3m H1ghSyst3m deleted the fix/package-and-file-namings branch May 31, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some package problem

1 participant