Skip to content

Conversation

Deterous
Copy link
Contributor

@Deterous Deterous commented Aug 6, 2025

Adds a new --dry-run option that skips dumping main user data, only performing pre-dump checks and saving auxiliary files.
For DVDs, it will get the .manufacturer/.physical, and for Xbox it will also get the .security file.
For CDs, it will get the TOC, and the FULLTOC/PMA/ATIP/CDTEXT when applicable.

It can be used with redumper dump --dry-run as well as safely used in aggregate mode, redumper --dry-run. When run in aggregate mode, the xbox auxiliary files are still split into DMI/PFI/SS, which is a request by #273 and other dumpers.

The use case is for people who want to get the auxiliary files from discs they have already dumped (e.g. getting fixed XGD3 SS, or DMI for DRM DVDs), are only interested in the auxiliary files (e.g. using redumper as part of a larger workflow), or want to get the TOC from one disc to then force refine another disc.

Copy link

coderabbitai bot commented Aug 6, 2025

Walkthrough

A new --dry-run option was introduced, allowing the application to skip main user data dumping and related split operations. Conditional checks were added in CD and DVD dumping functions to short-circuit when dry run is enabled. Command-line parsing, help output, and command selection logic were updated to support and respect this new mode.

Changes

Cohort / File(s) Change Summary
Dry Run Option Support
options.ixx
Added dry_run boolean to Options struct, initialized in constructor. Updated argument parser to handle --dry-run flag and updated usage/help output with a description.
CD Dumping Logic
cd/cd_dump.ixx
Inserted a check at the start of redumper_dump_cd to return early if dry_run is set, preventing user data dumping during dry runs.
DVD Dumping Logic
dvd/dvd_dump.ixx
Added an early return in redumper_dump_dvd when dry_run is enabled, skipping user data dumping for dry runs.
Split and Command Selection Logic
redumper.ixx
Modified redumper_split to check for .iso or .security before DVD split and to skip CD split in dry run mode. Adjusted redumper_cd_get_commands to remove several commands when dry_run is enabled.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant Options
    participant CD/DVD Dumper

    User->>CLI: Launch with --dry-run
    CLI->>Options: Parse arguments
    Options-->>CLI: Set dry_run = true
    CLI->>CD/DVD Dumper: Start dump operation
    CD/DVD Dumper->>CD/DVD Dumper: Check dry_run
    alt dry_run is true
        CD/DVD Dumper-->>CLI: Return immediately (no user data dumped)
    else dry_run is false
        CD/DVD Dumper->>CD/DVD Dumper: Proceed with normal dumping
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

A bunny with a clever mind,
Adds a flag for those inclined—
To test the flow, but skip the dump,
No discs will spin, no drives will thump!
Just hop along, review with cheer,
For dry runs now are crystal clear!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 09e32f0 and b0608f7.

📒 Files selected for processing (4)
  • cd/cd_dump.ixx (1 hunks)
  • dvd/dvd_dump.ixx (1 hunks)
  • options.ixx (4 hunks)
  • redumper.ixx (2 hunks)
⏰ 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). (5)
  • GitHub Check: build (macos-14, 64)
  • GitHub Check: build (windows-2022, 64)
  • GitHub Check: build (ubuntu-24.04, 64)
  • GitHub Check: build (ubuntu-24.04, 32)
  • GitHub Check: build (windows-2022, 32)
🔇 Additional comments (8)
options.ixx (4)

35-35: LGTM!

The dry_run field is correctly declared as a boolean and appropriately placed within the Options struct.


92-92: LGTM!

The dry_run field is correctly initialized to false in the constructor's member initialization list.


173-174: LGTM!

The command-line parsing for --dry-run is correctly implemented and follows the established pattern for boolean options.


377-377: LGTM!

The help text for --dry-run is clear and accurately describes the option's functionality.

cd/cd_dump.ixx (1)

238-240: Perfect placement for dry run check.

The early return after TOC processing ensures auxiliary files are created while skipping user data dumping, which aligns perfectly with the dry run mode's intended behavior.

dvd/dvd_dump.ixx (1)

721-723: Consistent dry run implementation for DVD dumping.

The early return after auxiliary file processing (physical structures, manufacturer data) ensures the dry run mode behaves consistently with CD dumping while preserving the intended functionality.

redumper.ixx (2)

114-117: Well-designed split logic for dry run mode.

The expanded condition to check for .security files supports Xbox dumps, and the dry run check appropriately prevents CD splitting when only auxiliary files are generated.


280-286: Appropriate command restriction for dry run mode.

Removing commands like dump::extra, protection, hash, and info during dry run makes sense since these operations typically require main user data that isn't available in dry run mode.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@JohnVeness
Copy link
Contributor

Many thanks for this, this sounds perfect as a solution for #273 etc.

The only thing I'm a little wary of is the name "dry run". In other applications, dry run would normally not cause any writes to disk, but for redumper, it will. Maybe "--no-image" or something?

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