Skip to content

refactor(instance): remove unused Cleanroom installer preprocessing - #2002

Open
xunying123 wants to merge 2 commits into
mainfrom
codex/simplify-cleanroom-installer
Open

xunying123 wants to merge 2 commits into
mainfrom
codex/simplify-cleanroom-installer

Conversation

@xunying123

@xunying123 xunying123 commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Checklist

  • Changes have been tested locally and work as expected.
  • All tests in workflows pass successfully.
  • Documentation has been updated if necessary.
  • Code formatting and commit messages align with the project conventions.
  • Comments have been added for any complex logic or functionality if possible.

This PR is a ..

Related Issues

None.

Description

Remove Forge-style processor preparation, BINPATCH/MOJMAPS handling, and client.lzma extraction from Cleanroom installation. Keep installer library extraction, version.json parsing, patch construction, and library download scheduling.

Additional Context

cargo check --all-targets, formatting, and diff checks passed. No migration or cleanup is included for existing instances.

Summary by Sourcery

Remove unused Forge-style preprocessing from Cleanroom installation while preserving required library and version setup.

Bug Fixes:

  • Prevent stale Cleanroom installer profiles from triggering processor execution during installation.

Enhancements:

  • Simplify Cleanroom installation by retaining installer library extraction, version metadata parsing, patch construction, and library download scheduling while removing Forge-style processor, mapping, and client patch handling.

@sourcery-ai

sourcery-ai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Refactors Cleanroom installation to handle only installer library extraction, version metadata, and library download scheduling, removing BINPATCH/client.lzma extraction, MOJMAPS handling, and Forge-style processor preprocessing and output.

File-Level Changes

Change Details Files
Restrict Cleanroom installer archive extraction to Maven libraries and remove generated patch/processor artifacts.
  • Resolve only the libraries directory instead of requiring the instance root.
  • Extract only entries under the archive’s maven/ prefix; stop extracting data/client.lzma as BINPATCH.
  • Retain installer presence validation and library download task scheduling.
src-tauri/src/instance/helpers/loader/cleanroom.rs
Simplify installation profile handling by eliminating Forge-style processor preprocessing.
  • Parse install_profile.json as immutable data without constructing placeholder substitutions.
  • Remove MOJMAPS download scheduling, processor argument/classpath rewriting, side filtering, and generated install_profile.json output.
  • Continue parsing version.json and applying Cleanroom client metadata such as the main class.
src-tauri/src/instance/helpers/loader/cleanroom.rs

Possibly linked issues

  • #[Feature] 精简 Cleanroom installer 中未使用的 processor 处理: PR 精确实现 issue 方案,保留版本解析、库提取和下载任务,同时移除未使用的 installer 预处理。

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions github-actions Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 21, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src-tauri/src/instance/helpers/loader/cleanroom.rs" line_range="225-229" />
<code_context>
-    }
-  });
-
-  fs::write(
-    instance.version_path.join("install_profile.json"),
-    &serde_json::to_vec_pretty(&profile)?,
-  )?;
-
   let cleanroom_info: McClientInfo = serde_json::from_str(&version)?;
   client_info.main_class = cleanroom_info.main_class.clone();
</code_context>
<issue_to_address>
**issue (broader_impact):** When an existing Cleanroom instance still has the previously generated `install_profile.json`, this refresh no longer replaces or removes it. `finish_mod_loader_install` subsequently discovers that stale file and executes its processors, so the removed preprocessing is still run with potentially stale paths and arguments.

**Triggers:** When upgrading or refreshing an instance created by the previous implementation.

**Suggested fix:** Remove the stale `install_profile.json` for Cleanroom instances, or make `finish_mod_loader_install` skip processor execution for Cleanroom.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: src-tauri/src/instance/helpers/loader/cleanroom.rs:229


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread src-tauri/src/instance/helpers/loader/cleanroom.rs
@UNIkeEN

UNIkeEN commented Sep 21, 2026

Copy link
Copy Markdown
Owner

这里还有一个比“旧 Cleanroom 实例残留 profile”更明确的触发场景:从 Forge/NeoForge 切换到 Cleanroom。

change_mod_loader() 只更新 client JSON 和加载器配置,不会删除版本目录里的 install_profile.json。这个 PR 又不再用 Cleanroom 的 profile 覆盖该文件,因此 cleanroom-libraries 下载完成后,finish_mod_loader_install() 会读取并执行前一个加载器遗留的 processors。这可能导致 Cleanroom 安装失败,或使用旧参数修改不该修改的文件。

建议让 finish_mod_loader_install() 对 Cleanroom 跳过 processor 执行,并清理遗留的 install_profile.json。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 精简 Cleanroom installer 中未使用的 processor 处理

2 participants