#400: fee() missing positive integer validation for job parameter#409
Conversation
97f71a2 to
7cade02
Compare
morphqdd
left a comment
There was a problem hiding this comment.
Correct and complete — the job.positive? guard now mirrors transfer, applied symmetrically to the real client, the fake, and both test files with exact-message assertions. LGTM.
One related observation inline (not part of this PR's scope).
| raise(RuntimeError, 'The "amount" must be positive') unless amount.positive? | ||
| raise(RuntimeError, 'The "job" is nil') if job.nil? | ||
| raise(RuntimeError, 'The "job" must be Integer') unless job.is_a?(Integer) | ||
| raise(RuntimeError, 'The "job" must be positive') unless job.positive? |
There was a problem hiding this comment.
Same 'mirror transfer' rationale, for a follow-up: transfer also rejects an empty summary (summary.empty?), whereas fee (just below) still only checks summary.nil?, so fee('x', 1.0, '', 42) passes an empty summary to the server. That specific gap is handled in #406 — flagging so the two land consistently.
|
@morphqdd Thanks for the review! You've earned +9 points for this: +18 as a basis; -5 for very few (1) comments; -4 for too few (16) hits-of-code. Your running score is +632; don't forget to check your Zerocracy account too). |
|
@VasilevNStas merge conflict here |
…meter # Conflicts: # test/test_baza_edge.rb
7cade02 to
af9c67c
Compare
|
This issue is still actively blocking all PRs from merging. Here is a detailed breakdown of why CI now takes 30+ minutes and what can be done about it. Current stateThe CI matrix was expanded from 2 jobs to 4 jobs (macOS-15 + Ubuntu-24.04 × Ruby 3.3 + 3.4). Each job runs the full suite including What happened on the latest run (PR #409, run #29231732468)
Total wall-clock time: 33 minutes, then manually cancelled. Why it is so slow
Impact
Suggested solutionsOption A: Move live tests out of
|
|
@VasilevNStas Thanks for the contribution! You've earned +20 points for this: +24 as a basis; -4 for too few (16) hits-of-code. Please, keep them coming. Your running score is +2776; don't forget to check your Zerocracy account too). |
Fixes #400.
fee()checkedjobfor nil and Integer type but did not validate that it is positive, unliketransfer()which hasunless job.positive?.raise(RuntimeError, 'The "job" must be positive') unless job.positive?tofeeinlib/baza-rb.rblib/baza-rb/fake.rbtest_fee_raises_when_job_is_not_positiveto bothtest_baza_edge.rbandtest_fake.rb