Skip to content

Conversation

ethangreen-dev
Copy link
Member

No description provided.

This is done so to better handle the mapping of modloader variants to
specific package installers. We do so via enum as any modification of
these variants will incur a compilation error that must be handled.
This commit contains two major features: Traits that define the behavior
of filesystem operations and installer functionality, and an early
implementation of the bepinex package installer which uses this
functionality.

New traits:
- TrackedFs, which defines the API by which the installer will interact
  with the filesystem.
- PackageInstaller, which defines the functionality and types that an
  installer implementee must define / consume to function.
... And a small edit to the PackageInstaller trait install_package and
uninstall_package functions to accept mutable self references, not
immutable.

In theory this is fine but it opens up problems if we plan on
multithreading file ops due to rust's mutable borrow rules. If this
becomes a problem (and we NEED mutability) we can rely on something like
a RefCell<T: TrackedFile> at the cost of some runtime peformance.
This commit introduces community-based package organization and automatic
modloader detection for enhanced package installation workflows.

Key changes:
- Add community parameter to project initialization and package operations
- Implement modloader detection and installation via ecosystem schema
- Replace hardcoded installer selection with dynamic modloader resolution
- Add package-community membership validation API
- Refactor PackageInstaller trait to handle modloader packages explicitly
- Create new macro-based testing framework with per-community test cases

The community concept enables proper game-specific package management
while modloader detection eliminates manual installer configuration.
Test infrastructure now supports multiple game communities with
declarative test case generation via installer_tests! macro.
Copy link

coderabbitai bot commented Sep 18, 2025

Important

Review skipped

Draft detected.

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.

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

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bepinex-installer

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

impl StateEntry {
/// Add a new staged file. If overwrite is set then already existing
/// entries with the same path will be replaced.
pub fn add_staged(&mut self, file: StagedFile, overwrite: bool) {}

Check warning

Code scanning / clippy

unused variable: file Warning

unused variable: file
impl StateEntry {
/// Add a new staged file. If overwrite is set then already existing
/// entries with the same path will be replaced.
pub fn add_staged(&mut self, file: StagedFile, overwrite: bool) {}

Check warning

Code scanning / clippy

unused variable: overwrite Warning

unused variable: overwrite

/// Add a new linked file. If overwrite is set then already existing
/// entries with the same path will be replaced.
pub fn add_linked(&mut self, file: LinkedFile, overwrite: bool) {}

Check warning

Code scanning / clippy

unused variable: file Warning

unused variable: file

/// Add a new linked file. If overwrite is set then already existing
/// entries with the same path will be replaced.
pub fn add_linked(&mut self, file: LinkedFile, overwrite: bool) {}

Check warning

Code scanning / clippy

unused variable: overwrite Warning

unused variable: overwrite
Comment on lines +156 to +160
impl Default for TrackingMethod {
fn default() -> Self {
TrackingMethod::None
}
}

Check warning

Code scanning / clippy

this impl can be derived Warning

this impl can be derived
… API

- Update rule resolution to support relative file exclusions and simplify rule mapping
- Refactor TrackedFs trait to return Result for delete operations and clarify FileAction semantics
- Enhance installer_tests! macro and Testficate harness for better accuracy reporting and asset dir resolution
- Add new bepinex installer test cases for h3vr community packages
- Fix directory copy and delete logic for tracked/untracked file operations
- Minor cleanup in ecosystem modloader data retrieval
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds package installer generics and a BepInEx implementation by introducing a development dependency and workspace configuration.

  • Add dir-diff development dependency for directory comparison functionality
  • Configure cargo workspace directory environment variable

Reviewed Changes

Copilot reviewed 2 out of 1119 changed files in this pull request and generated no comments.

File Description
Cargo.toml Adds dir-diff development dependency for testing directory operations
.cargo/config.toml Sets up workspace directory environment variable configuration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.

1 participant