Skip to content

Bump rubyzip dependency to ~> 3.0#194

Merged
adfoster-r7 merged 3 commits into
rapid7:masterfrom
ptownes-r7:bump-ruby-zip-to-3_1_1
May 26, 2026
Merged

Bump rubyzip dependency to ~> 3.0#194
adfoster-r7 merged 3 commits into
rapid7:masterfrom
ptownes-r7:bump-ruby-zip-to-3_1_1

Conversation

@ptownes-r7

Copy link
Copy Markdown
Contributor

Bumps RubyZip to 3.1.1

This is needed to be able to reliably read and write Zip64 zip files, particularly in the backup routine.

Following changes made to to comply with breaking changes in RubyZip 3.x

  • Metasploit::Credential::Importer::Zip
    • destination_directory needs to specified as a path via a named param
  • Factory for Metasploit::Credential::Importer::Zip
    • ::CREATE constant replaced by named param

Automated test suite passing again.

@ptownes-r7 ptownes-r7 requested a review from adfoster-r7 October 2, 2025 11:44
@ptownes-r7 ptownes-r7 marked this pull request as draft October 2, 2025 14:43
@ptownes-r7

Copy link
Copy Markdown
Contributor Author

Do not merge.
Upstream issue with LicenseFinder is preventing use of RubyZip 3+
pivotal/LicenseFinder#1063

@adfoster-r7 adfoster-r7 requested a review from Copilot May 21, 2026 14:35
@adfoster-r7 adfoster-r7 marked this pull request as ready for review May 21, 2026 14:35

Copilot AI 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.

Pull request overview

This PR updates the project to RubyZip 3.x to support reliable Zip64 read/write behavior (notably for backup/export), and adjusts call sites to comply with RubyZip 3.x API changes.

Changes:

  • Bump rubyzip runtime dependency from < 3.0.0 to ~> 3.0.
  • Update zip creation calls to use Zip::File.open(..., create: true) in exporter code and factory helpers.
  • Update zip extraction to RubyZip 3.x’s destination_directory: keyword argument.

Impact Analysis:

  • Blast radius: medium—affects all consumers of zip import/export paths (Metasploit::Credential::Importer::Zip and Metasploit::Credential::Exporter::Core) and the test suite factories; downstream effects depend on how this gem is used in larger apps (Unknown).
  • Data and contract effects: zip file read/write behavior may differ under RubyZip 3.x; gem dependency constraint currently allows 3.0.x despite PR text claiming 3.1.1 minimum.
  • Rollback and test focus: rollback is straightforward (dependency + API call sites); focus validation on importing well-formed/malformed zips and exporting zips (including Zip64-sized archives if covered).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
spec/factories/metasploit/credential/importer/zips.rb Updates Zip::File open semantics for RubyZip 3.x in factory-generated zips.
metasploit-credential.gemspec Bumps RubyZip dependency constraint to the 3.x series.
lib/metasploit/credential/importer/zip.rb Updates extraction API usage for RubyZip 3.x.
lib/metasploit/credential/exporter/core.rb Updates zip creation API usage for RubyZip 3.x.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

def input_is_well_formed
begin
Zip::File.open input.path do |archive|
Zip::File.open(input.path) do |archive|
Comment thread metasploit-credential.gemspec
Comment thread spec/factories/metasploit/credential/importer/zips.rb
@adfoster-r7 adfoster-r7 force-pushed the bump-ruby-zip-to-3_1_1 branch 3 times, most recently from d337d37 to a516640 Compare May 26, 2026 08:38
@adfoster-r7 adfoster-r7 requested a review from Copilot May 26, 2026 08:42

Copilot AI 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.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread spec/lib/metasploit/credential/migrator_spec.rb

Copilot AI 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.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@adfoster-r7 adfoster-r7 merged commit c42529d into rapid7:master May 26, 2026
27 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.

3 participants