Skip to content

#360: extract Compress module (unzip/zipped) from god-class#392

Merged
yegor256 merged 1 commit into
zerocracy:masterfrom
VasilevNStas:360
Jul 6, 2026
Merged

#360: extract Compress module (unzip/zipped) from god-class#392
yegor256 merged 1 commit into
zerocracy:masterfrom
VasilevNStas:360

Conversation

@VasilevNStas

Copy link
Copy Markdown
Contributor

Problem

BazaRb was a god-class at 940 lines with 5+ responsibilities. The rubocop config already disabled Metrics/AbcSize, Metrics/BlockLength, and Metrics/ClassLength for this file.

Solution

Step 1 of evolutionary refactoring: extracted compression helpers (unzip, zipped) into BazaRb::Compress module at lib/baza-rb/compress.rb.

  • Created lib/baza-rb/compress.rb with Compress module
  • baza-rb.rb now includes the module and dropped 30 lines
  • No behavioral changes — methods are identical

Verification

  • bundle exec rubocop — 0 offenses
  • All tests pass (26 pact, 45 edge)
  • File reduced from 940 to 910 lines

Next steps: extract HTTP layer (http.rb), transfer logic (transfer.rb).

Closes #360.

@VasilevNStas

Copy link
Copy Markdown
Contributor Author

CI failure note: The test_live_full_cycle failure in the CI is unrelated to this PR. It's a pre-existing infrastructure issue with the Zerocracy platform (jobs not completing on the live server). See issue #354 for details and discussion.

All 118 other tests pass, and all non-live checks (rubocop, copyrights, markdown-lint, pdd, reuse, xcop, actionlint, typos, yamllint) pass successfully.

@yegor256

yegor256 commented Jun 5, 2026

Copy link
Copy Markdown
Member

@VasilevNStas please fix merge conflics

@VasilevNStas

Copy link
Copy Markdown
Contributor Author

@yegor256 this PR is blocked by the test_live_full_cycle flaky test (#354). You mentioned in #393 (comment) that you'd fix the platform first.

All our PRs have been rebased on the test fix from #393 (increased timeout, unique job names, fixed elapsed time display). The only remaining failures are from the platform not completing jobs within 5 minutes — the code changes themselves are clean.

A review and platform fix would unblock all of these. Thanks!

@VasilevNStas

Copy link
Copy Markdown
Contributor Author

@yegor256 plz review

@yegor256 yegor256 merged commit f18dc5c into zerocracy:master Jul 6, 2026
10 checks passed
@0crat

0crat commented Jul 10, 2026

Copy link
Copy Markdown

@VasilevNStas Thanks for the contribution! You've earned +24 points for this: +24 as a basis; +5 for the 76 hits-of-code that you wrote; -6 to not go over the cap. Please, keep them coming. Your running score is +2368; don't forget to check your Zerocracy account too).

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.

God-class BazaRb: 940 lines, 5+ responsibilities (HTTP, gzip, retry, chunking, validation)

3 participants