Skip to content

fix(workshop): preserve zip payload extensions#1523

Merged
utkarshdalal merged 1 commit into
utkarshdalal:masterfrom
Nightwalker743:fix/workshop-zip-payload-extensions
Jun 5, 2026
Merged

fix(workshop): preserve zip payload extensions#1523
utkarshdalal merged 1 commit into
utkarshdalal:masterfrom
Nightwalker743:fix/workshop-zip-payload-extensions

Conversation

@Nightwalker743
Copy link
Copy Markdown
Contributor

@Nightwalker743 Nightwalker743 commented Jun 5, 2026

Description

This PR fixes a workshop bug where jar and gro files are being renamed with .zip at the end of their file name then extracted.

Known games being affected: Slay the Spire and Serious Sam Fusion 2017.

Recording

Not much to show, but the screenshot below shows a jar file from a workshop mod is not being renamed with .zip at the end nor is it being extracted like it used to.

Screenshot_20260604_230327_GameNative

Type of Change

  • Bug fix
  • Performance / stability improvement
  • Compatibility improvements
  • Other (requires prior approval)

Checklist

  • If I have access to #code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.
  • This change aligns with the current project scope (core functionality, stability, or performance). If not, it has been explicitly approved beforehand.
  • I have attached a recording of the change.
  • I have read and agree to the contribution guidelines in CONTRIBUTING.md.

Summary by CodeRabbit

  • New Features

    • Added support for .gro file extension as a recognized workshop content type
    • Enhanced workshop content post-processing to preserve zip payloads for specific games that require them to remain in zip format rather than being automatically extracted
  • Tests

    • Added comprehensive test coverage validating zip payload preservation behavior

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 5, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 06289f1e-b881-4f91-9946-7a1fd881a3d6

📥 Commits

Reviewing files that changed from the base of the PR and between dc54857 and 4af09c7.

📒 Files selected for processing (3)
  • app/src/main/java/app/gamenative/workshop/WorkshopItem.kt
  • app/src/main/java/app/gamenative/workshop/WorkshopManager.kt
  • app/src/test/java/app/gamenative/workshop/WorkshopManagerTest.kt

📝 Walkthrough

Walkthrough

This PR adds support for games that require zip payloads (jar, gro) to be available as container files. It extends the workshop system to recognize these extensions, skip extraction for specific appIds, and restore original filenames by removing the temporary .zip suffix before processing.

Changes

Zip Payload Support

Layer / File(s) Summary
Zip Payload Schema and Configuration
app/src/main/java/app/gamenative/workshop/WorkshopItem.kt, app/src/main/java/app/gamenative/workshop/WorkshopManager.kt
KNOWN_EXTENSIONS now includes "gro" extension; WorkshopManager introduces SKIP_ZIP_EXTRACTION_APP_IDS with appIds requiring payload preservation and ZIP_PAYLOAD_EXTENSIONS_BY_APP_ID mapping specific appIds to expected container extensions.
Zip Payload Name Restoration Logic
app/src/main/java/app/gamenative/workshop/WorkshopManager.kt
New restoreZipPayloadNames helper scans workshop item directories and renames .<ext>.zip files back to .<ext>, then integrates this call into runPostProcessing immediately before extractZipMods to preserve containers for games that read them directly.
Zip Payload Test Coverage
app/src/test/java/app/gamenative/workshop/WorkshopManagerTest.kt
Adds writeZipPayload test helper and three test cases: fixFileExtensions_preservesKnownZipContainerPayloadExtensions validates extension preservation, runPostProcessing_restoresZipPayloadNamesBeforeExtraction verifies name restoration and artifact cleanup, and extractZipMods_skipsZipExtractionForZipPayloadGames confirms extraction is skipped while containers remain intact.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • utkarshdalal/GameNative#1316: Both PRs modify WorkshopManager.kt to prevent ZIP archive extraction for specific workshop appIds; this PR extends the skip mechanism with zip-payload filename restoration coordination.

Suggested reviewers

  • utkarshdalal

Poem

🐰 A cargo of zips arrives at the workshop door,
Some games demand their payloads to explore,
Restore the names, preserve the jar and gro,
Let containers rest before extraction's flow,
A rabbit's craft—files renamed as they should go! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: preventing zip payload extensions (jar, gro files) from being preserved instead of renamed with .zip suffix.
Description check ✅ Passed The PR description includes the required sections (Description, Recording, Type of Change, Checklist) with most items completed. The bug is clearly explained with affected games named, and a screenshot is provided.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@Nightwalker743 Nightwalker743 force-pushed the fix/workshop-zip-payload-extensions branch from e46e383 to 4af09c7 Compare June 5, 2026 04:24
@Nightwalker743 Nightwalker743 marked this pull request as ready for review June 5, 2026 04:32
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Re-trigger cubic

@utkarshdalal utkarshdalal merged commit 7b02172 into utkarshdalal:master Jun 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants