Skip to content

#479: add iterate since DSL#485

Open
akmhatey-ai wants to merge 2 commits into
zerocracy:masterfrom
akmhatey-ai:codex/iterate-since-479
Open

#479: add iterate since DSL#485
akmhatey-ai wants to merge 2 commits into
zerocracy:masterfrom
akmhatey-ai:codex/iterate-since-479

Conversation

@akmhatey-ai

Copy link
Copy Markdown
Contributor

Closes #479.

Changes:

  • Add the documented since(value) DSL setter to Fbe::Iterate.
  • Validate nil, non-Integer, and duplicate since configuration.
  • Add regression coverage proving since(7) feeds the initial $before value.

Validation:

  • Red before implementation: bundle exec ruby test\fbe\test_iterate.rb -- --no-cov --name test_configures_since_start failed with NoMethodError: undefined method 'since' for an instance of Fbe::Iterate.
  • Green after implementation: bundle exec ruby test\fbe\test_iterate.rb -- --no-cov passed with 29 tests, 59 assertions, 0 failures, 0 errors, 0 skips.
  • bundle exec rubocop lib\fbe\iterate.rb test\fbe\test_iterate.rb passed with no offenses.
  • ruby -c lib\fbe\iterate.rb and ruby -c test\fbe\test_iterate.rb passed.
  • git diff --check passed.
  • git diff -- lib\fbe\iterate.rb test\fbe\test_iterate.rb | gitleaks stdin --no-banner --redact reported no leaks.

Limitation:

  • bundle exec rake test is locally blocked on this Windows setup by unrelated typhoeus/ethon libcurl loading while requiring test_enter.rb, so local full-suite completion is not claimed.

@GHX5T-SOL GHX5T-SOL 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.

Reviewed the Fbe::Iterate#since DSL change against #479. The new setter matches the documented restart marker behavior, rejects nil/non-Integer/duplicate configuration, and the regression proves since(7) becomes the initial $before value used by the query.

Validation I ran on a82e147cd5a91d84a248a1f9894442822e9e0626:

  • env BUNDLE_PATH=/private/tmp/bundle-fbe-488 mise x ruby@3.3.11 -- bundle check -> dependencies satisfied.
  • env BUNDLE_PATH=/private/tmp/bundle-fbe-488 mise x ruby@3.3.11 -- bundle exec ruby -Itest test/fbe/test_iterate.rb -- --no-cov -> 29 tests, 59 assertions, 0 failures, 0 errors.
  • env BUNDLE_PATH=/private/tmp/bundle-fbe-488 mise x ruby@3.3.11 -- bundle exec rake test -> 287 tests, 806 assertions, 0 failures, 0 errors, 9 skips.
  • env BUNDLE_PATH=/private/tmp/bundle-fbe-488 mise x ruby@3.3.11 -- bundle exec rubocop lib/fbe/iterate.rb test/fbe/test_iterate.rb --format simple -> 2 files inspected, no offenses detected.
  • env BUNDLE_PATH=/private/tmp/bundle-fbe-488 mise x ruby@3.3.11 -- ruby -c lib/fbe/iterate.rb and ... -- ruby -c test/fbe/test_iterate.rb -> Syntax OK.
  • git diff --check origin/master...HEAD -> passed.
  • git diff origin/master...HEAD | gitleaks stdin --no-banner --redact --exit-code 1 -> no leaks found.

No changes requested.

@0crat

0crat commented May 26, 2026

Copy link
Copy Markdown

@GHX5T-SOL Great work on the review! 🎉 You've earned +10 points (+18 base, -8 for missing comments). Your total score is now +150. Check your Zerocracy account for updates!

Comment thread lib/fbe/iterate.rb
# @example Start scanning after issue 100
# iterator.since(100)
def since(value)
raise(Fbe::Error, 'Since is already set') if @custom

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@akmhatey-ai should be since!()

@yegor256

Copy link
Copy Markdown
Member

This pull request has merge conflicts. Please rebase it on the default branch to resolve them so it can be merged.

@akmhatey-ai

Copy link
Copy Markdown
Contributor Author

Merged current master into this branch and pushed head 8bec1c7; GitHub now reports the PR as MERGEABLE.

Conflict resolution:

  • Kept current master's since tracking docs.
  • Preserved the duplicate since guard covered by test_raises_when_since_set_twice.

Validation:

  • bundle check -> dependencies satisfied. The Windows shell also printed a non-fatal grep warning after the command.
  • ruby -c lib/fbe/iterate.rb and ruby -c test/fbe/test_iterate.rb -> Syntax OK.
  • bundle exec ruby -Itest test/fbe/test_iterate.rb -- --no-cov -> 30 tests, 60 assertions, 0 failures, 0 errors.
  • bundle exec rubocop lib/fbe/iterate.rb test/fbe/test_iterate.rb --format simple -> 2 files inspected, no offenses.
  • git diff --check origin/master...HEAD -> clean.
  • git merge-tree --write-tree origin/master HEAD -> b2bd54022aacb774c453647c692b90e42d561cf3.
  • Diff-scoped gitleaks stdin --no-banner --redact --exit-code 1 -> no leaks found.

Limitation: hosted rake (ubuntu-24.04) is still red on test/fbe/test_over.rb:41, expecting search quota threshold: 10. I reproduced that same failure locally with bundle exec ruby -Itest test/fbe/test_over.rb -- --no-cov, and recent master rake runs are already red for this branch-independent area. I did not fold that unrelated Fbe.over? fix into this #479 branch.

@yegor256

Copy link
Copy Markdown
Member

@akmhatey-ai rake fails here

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.

Fbe::Iterate documents a since DSL keyword that does not exist; @since is hardcoded to 0

4 participants