Skip to content

#1155: fix user property in Fbe::FakeOctokit#issue and Fbe::FakeOctokit#list_issues#344

Merged
yegor256 merged 1 commit intozerocracy:masterfrom
Yegorov:1155
Oct 30, 2025
Merged

#1155: fix user property in Fbe::FakeOctokit#issue and Fbe::FakeOctokit#list_issues#344
yegor256 merged 1 commit intozerocracy:masterfrom
Yegorov:1155

Conversation

@Yegorov
Copy link
Contributor

@Yegorov Yegorov commented Oct 29, 2025

This PR fix error in judges-action:

 D: Inserted new fact #10 in 258μs
D: Set 'issue' to 42 (Integer)
D: Set 'what' to "pull-was-opened" (String)
D: Set 'repository' to 2350 (Integer)
D: Set 'where' to "github" (String)
D: Set 'when' to 2024-09-20T19:00:00Z (Time)
E: RuntimeError: The value of 'who' can't be nil
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/fact.rb:56:in 'block in <class:Fact>'
   	/usr/local/bundle/gems/others-0.1.1/lib/others.rb:57:in 'BasicObject#instance_exec'
   	/usr/local/bundle/gems/others-0.1.1/lib/others.rb:57:in 'Factbase::Fact#method_missing'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/tallied.rb:72:in 'block in <class:Fact>'
   	/usr/local/bundle/gems/others-0.1.1/lib/others.rb:57:in 'BasicObject#instance_exec'
   	/usr/local/bundle/gems/others-0.1.1/lib/others.rb:57:in 'Factbase::Tallied::Fact#method_missing'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/rules.rb:84:in 'block in <class:Fact>'
   	/usr/local/bundle/gems/others-0.1.1/lib/others.rb:57:in 'BasicObject#instance_exec'
   	/usr/local/bundle/gems/others-0.1.1/lib/others.rb:57:in 'Factbase::Rules::Fact#method_missing'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/tallied.rb:72:in 'block in <class:Fact>'
   	/usr/local/bundle/gems/others-0.1.1/lib/others.rb:57:in 'BasicObject#instance_exec'
   	/usr/local/bundle/gems/others-0.1.1/lib/others.rb:57:in 'Factbase::Tallied::Fact#method_missing'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/cached/cached_fact.rb:30:in 'block in <class:CachedFact>'
   	/usr/local/bundle/gems/others-0.1.1/lib/others.rb:57:in 'BasicObject#instance_exec'
   	/usr/local/bundle/gems/others-0.1.1/lib/others.rb:57:in 'Factbase::CachedFact#method_missing'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/indexed/indexed_fact.rb:30:in 'block in <class:IndexedFact>'
   	/usr/local/bundle/gems/others-0.1.1/lib/others.rb:57:in 'BasicObject#instance_exec'
   	/usr/local/bundle/gems/others-0.1.1/lib/others.rb:57:in 'Factbase::IndexedFact#method_missing'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/logged.rb:112:in 'block in <class:Fact>'
   	/usr/local/bundle/gems/others-0.1.1/lib/others.rb:57:in 'BasicObject#instance_exec'
   	/usr/local/bundle/gems/others-0.1.1/lib/others.rb:57:in 'Factbase::Logged::Fact#method_missing'
   	/action/judges/find-earliest-issue/find-earliest-issue.rb:33:in 'block (3 levels) in <top (required)>'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/impatient.rb:39:in 'block in Factbase::Impatient#txn'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/logged.rb:55:in 'block in Factbase::Logged#txn'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/sync/sync_factbase.rb:54:in 'block in Factbase::SyncFactbase#txn'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/indexed/indexed_factbase.rb:61:in 'block in Factbase::IndexedFactbase#txn'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/cached/cached_factbase.rb:61:in 'block in Factbase::CachedFactbase#txn'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/pre.rb:42:in 'block in Factbase::Pre#txn'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/rules.rb:54:in 'block in Factbase::Rules#txn'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/tallied.rb:43:in 'block (2 levels) in Factbase::Tallied#txn'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/tallied.rb:42:in 'Kernel#catch'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/tallied.rb:42:in 'block in Factbase::Tallied#txn'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase.rb:184:in 'block (2 levels) in Factbase#txn'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase.rb:183:in 'Kernel#catch'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase.rb:183:in 'block in Factbase#txn'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase.rb:180:in 'Kernel#catch'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase.rb:180:in 'Factbase#txn'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/tallied.rb:41:in 'Factbase::Tallied#txn'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/rules.rb:52:in 'Factbase::Rules#txn'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/pre.rb:41:in 'Factbase::Pre#txn'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/cached/cached_factbase.rb:60:in 'Factbase::CachedFactbase#txn'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/indexed/indexed_factbase.rb:60:in 'Factbase::IndexedFactbase#txn'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/sync/sync_factbase.rb:53:in 'Factbase::SyncFactbase#txn'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/logged.rb:53:in 'Factbase::Logged#txn'
   	/usr/local/bundle/gems/factbase-0.16.8/lib/factbase/impatient.rb:38:in 'Factbase::Impatient#txn'
   	/action/judges/find-earliest-issue/find-earliest-issue.rb:23:in 'block (2 levels) in <top (required)>'
   	/usr/local/bundle/gems/fbe-0.41.2/lib/fbe/iterate.rb:313:in 'block (2 levels) in Fbe::Iterate#over'
   	/usr/local/bundle/gems/fbe-0.41.2/lib/fbe/iterate.rb:278:in 'Array#each'
   	/usr/local/bundle/gems/fbe-0.41.2/lib/fbe/iterate.rb:278:in 'block in Fbe::Iterate#over'
   	<internal:kernel>:168:in 'Kernel#loop'
   	/usr/local/bundle/gems/fbe-0.41.2/lib/fbe/iterate.rb:270:in 'Fbe::Iterate#over'
   	/action/judges/find-earliest-issue/find-earliest-issue.rb:15:in 'block in <top (required)>'
   	/usr/local/bundle/gems/fbe-0.41.2/lib/fbe/iterate.rb:50:in 'BasicObject#instance_eval'
   	/usr/local/bundle/gems/fbe-0.41.2/lib/fbe/iterate.rb:50:in 'Fbe.iterate'
   	/action/judges/find-earliest-issue/find-earliest-issue.rb:12:in '<top (required)>'
   	/usr/local/bundle/gems/judges-0.55.0/lib/judges/judge.rb:79:in 'Kernel#load'
   	/usr/local/bundle/gems/judges-0.55.0/lib/judges/judge.rb:79:in 'block in Judges::Judge#run'
   	/usr/local/bundle/gems/elapsed-0.2.0/lib/elapsed.rb:45:in 'Object#elapsed'
   	/usr/local/bundle/gems/judges-0.55.0/lib/judges/judge.rb:78:in 'Judges::Judge#run'
   	/usr/local/bundle/gems/judges-0.55.0/lib/judges/commands/update.rb:239:in 'block in Judges::Update#one_judge'
   	/usr/local/bundle/gems/timeout-0.4.4/lib/timeout.rb:188:in 'block in Timeout.timeout'
   	/usr/local/bundle/gems/timeout-0.4.4/lib/timeout.rb:38:in 'Timeout::Error.handle_timeout'
   	/usr/local/bundle/gems/timeout-0.4.4/lib/timeout.rb:197:in 'Timeout.timeout'
   	/usr/local/bundle/gems/judges-0.55.0/lib/judges/commands/update.rb:238:in 'Judges::Update#one_judge'
   	/usr/local/bundle/gems/judges-0.55.0/lib/judges/commands/update.rb:198:in 'block (3 levels) in Judges::Update#cycle'
   	/usr/local/bundle/gems/elapsed-0.2.0/lib/elapsed.rb:45:in 'Object#elapsed'
   	/usr/local/bundle/gems/judges-0.55.0/lib/judges/commands/update.rb:197:in 'block (2 levels) in Judges::Update#cycle'
   	/usr/local/bundle/gems/judges-0.55.0/lib/judges/judges.rb:120:in 'block in Judges::Judges#each_with_index'
   	/usr/local/bundle/gems/judges-0.55.0/lib/judges/judges.rb:106:in 'Array#each'
   	/usr/local/bundle/gems/judges-0.55.0/lib/judges/judges.rb:106:in 'Judges::Judges#each'
   	/usr/local/bundle/gems/judges-0.55.0/lib/judges/judges.rb:119:in 'Judges::Judges#each_with_index'
   	/usr/local/bundle/gems/judges-0.55.0/lib/judges/commands/update.rb:182:in 'block in Judges::Update#cycle'
   	/usr/local/bundle/gems/elapsed-0.2.0/lib/elapsed.rb:45:in 'Object#elapsed'
   	/usr/local/bundle/gems/judges-0.55.0/lib/judges/commands/update.rb:180:in 'Judges::Update#cycle'
   	/usr/local/bundle/gems/judges-0.55.0/lib/judges/commands/update.rb:111:in 'block (2 levels) in Judges::Update#loop_them'
   	<internal:kernel>:168:in 'Kernel#loop'
   	/usr/local/bundle/gems/judges-0.55.0/lib/judges/commands/update.rb:101:in 'block in Judges::Update#loop_them'
   	/usr/local/bundle/gems/elapsed-0.2.0/lib/elapsed.rb:45:in 'Object#elapsed'
   	/usr/local/bundle/gems/judges-0.55.0/lib/judges/commands/update.rb:100:in 'Judges::Update#loop_them'
   	/usr/local/bundle/gems/judges-0.55.0/lib/judges/commands/update.rb:74:in 'block in Judges::Update#run'
   	/usr/local/bundle/gems/timeout-0.4.4/lib/timeout.rb:188:in 'block in Timeout.timeout'
   	/usr/local/bundle/gems/timeout-0.4.4/lib/timeout.rb:38:in 'Timeout::Error.handle_timeout'
   	/usr/local/bundle/gems/timeout-0.4.4/lib/timeout.rb:197:in 'Timeout.timeout'
   	/usr/local/bundle/gems/judges-0.55.0/lib/judges/commands/update.rb:73:in 'Judges::Update#run'
   	/usr/local/bundle/gems/judges-0.55.0/bin/judges:30:in 'block in JudgesGLI.run_it'
   	/usr/local/bundle/gems/gli-2.22.2/lib/gli/command_support.rb:131:in 'GLI::CommandSupport#execute'
   	/usr/local/bundle/gems/gli-2.22.2/lib/gli/app_support.rb:298:in 'block in GLI::AppSupport#call_command'
   	/usr/local/bundle/gems/gli-2.22.2/lib/gli/app_support.rb:311:in 'GLI::AppSupport#call_command'
   	/usr/local/bundle/gems/gli-2.22.2/lib/gli/app_support.rb:85:in 'GLI::AppSupport#run'
   	/usr/local/bundle/gems/judges-0.55.0/bin/judges:285:in '<top (required)>'
   	/usr/local/bundle/bin/judges:25:in 'Kernel#load'
   	/usr/local/bundle/bin/judges:25:in '<top (required)>'
   	/usr/local/lib/ruby/3.4.0/bundler/cli/exec.rb:59:in 'Kernel.load'
   	/usr/local/lib/ruby/3.4.0/bundler/cli/exec.rb:59:in 'Bundler::CLI::Exec#kernel_load'
   	/usr/local/lib/ruby/3.4.0/bundler/cli/exec.rb:23:in 'Bundler::CLI::Exec#run'
   	/usr/local/lib/ruby/3.4.0/bundler/cli.rb:452:in 'Bundler::CLI#exec'
   	/usr/local/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/command.rb:28:in 'Bundler::Thor::Command#run'
   	/usr/local/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in 'Bundler::Thor::Invocation#invoke_command'
   	/usr/local/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor.rb:538:in 'Bundler::Thor.dispatch'
   	/usr/local/lib/ruby/3.4.0/bundler/cli.rb:35:in 'Bundler::CLI.dispatch'
   	/usr/local/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/base.rb:584:in 'Bundler::Thor::Base::ClassMethods#start'
   	/usr/local/lib/ruby/3.4.0/bundler/cli.rb:29:in 'Bundler::CLI.start'
   	/usr/local/lib/ruby/gems/3.4.0/gems/bundler-2.6.9/exe/bundle:28:in 'block in <top (required)>'
   	/usr/local/lib/ruby/3.4.0/bundler/friendly_errors.rb:117:in 'Bundler.with_friendly_errors'
   	/usr/local/lib/ruby/gems/3.4.0/gems/bundler-2.6.9/exe/bundle:20:in '<top (required)>'
   	/usr/local/bin/bundle:25:in 'Kernel#load'
   	/usr/local/bin/bundle:25:in '<main>'

A similar problem is currently observed in other pull requests:

Summary by CodeRabbit

  • Tests
    • Enhanced mock issue payloads to include complete user field data.
    • Expanded test assertions to validate additional issue fields including user information and timestamps.

@coderabbitai
Copy link

coderabbitai bot commented Oct 29, 2025

Walkthrough

The pull request adds a user field to the mocked issue payload returned by Fbe::FakeOctokit#issue and extends test coverage in test_fake_list_issues to verify the shape of subsequent issues, including the newly added user field.

Changes

Cohort / File(s) Summary
Mock payload enhancement
lib/fbe/octo.rb
Added user field to the default branch case of FakeOctokit#issue with login 'yegor256', id 526301, and type 'User'
Test coverage expansion
test/fbe/test_octo.rb
Introduced assertions for subsequent issues (via slice(1..)) in test_fake_list_issues, validating issue structure fields including the new user field

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Straightforward addition of a single structured field to a mocked object
  • Corresponding test assertions follow an established pattern
  • No complex logic or conditional branching introduced

Possibly related PRs

Poem

🐰 A user hops into the mocked payload,
With login, ID, and type in tow.
Tests now verify each issue's structure,
Slicing through the list with care—
No stone unturned, completeness fair! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "#1155: fix user property in Fbe::FakeOctokit#issue and Fbe::FakeOctokit#list_issues" accurately and specifically describes the main change in the changeset. The raw summary confirms that modifications were made to both the lib/fbe/octo.rb file (adding a user field with specific data) and the test/fbe/test_octo.rb file (adding test assertions for user.id and other fields). The PR objectives clearly indicate the goal is to fix user property handling to prevent nil 'who' values during workflow execution. The title is concise, uses appropriate code formatting with backticks, includes the issue reference for traceability, and would be immediately clear to someone scanning the repository history.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 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 c9ecf44 and b76f7bb.

📒 Files selected for processing (2)
  • lib/fbe/octo.rb (1 hunks)
  • test/fbe/test_octo.rb (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
test/fbe/test_octo.rb (1)
lib/fbe/octo.rb (3)
  • o (288-290)
  • list_issues (677-684)
  • issue (694-744)
🔇 Additional comments (2)
lib/fbe/octo.rb (1)

737-737: Critical fix: user field now present in default case.

This addition resolves the "RuntimeError: The value of 'who' can't be nil" error by ensuring all issues returned by the issue method include a user field. The else branch now matches the structure of cases 142, 143, and 144.

test/fbe/test_octo.rb (1)

466-477: Good test coverage for the user field fix.

The new assertion block validates that issues returned from the default case (issues 42 and 43) include the user.id field, directly testing the fix on line 737. The inclusion of created_at in the pattern check ensures the complete structure is validated.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Yegorov
Copy link
Contributor Author

Yegorov commented Oct 29, 2025

@yegor256 check, please.

@yegor256 yegor256 merged commit 36a94ce into zerocracy:master Oct 30, 2025
11 checks passed
@yegor256
Copy link
Member

@Yegorov thanks!

@yegor256
Copy link
Member

@rultor release, tag is 0.41.3

@rultor
Copy link
Contributor

rultor commented Oct 30, 2025

@rultor release, tag is 0.41.3

@yegor256 OK, I will release it now. Please check the progress here.

@rultor
Copy link
Contributor

rultor commented Oct 30, 2025

@rultor release, tag is 0.41.3

@yegor256 Done! FYI, the full log is here (took me 4min).

@0crat
Copy link

0crat commented Oct 30, 2025

@Yegorov Hey! Nice work on your contribution – you've bagged +20 points this time! Here's the breakdown: +24 as your base reward, but -4 got deducted since you only hit 13 hits-of-code (our policy dings contributions under 30). Next time, try to bulk it up a bit to avoid that penalty and maximize your points! Your running balance is sitting pretty at +519keep those contributions flowing and don't forget to peek at your Zerocracy balance 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.

4 participants