Skip to content

#1155: fix Fbe::FakeOctokit#issue for fix-missing-who judge#345

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

#1155: fix Fbe::FakeOctokit#issue for fix-missing-who judge#345
yegor256 merged 1 commit intozerocracy:masterfrom
Yegorov:1155

Conversation

@Yegorov
Copy link
Copy Markdown
Contributor

@Yegorov Yegorov commented Oct 30, 2025

This PR fix error in judges-action:

RuntimeError: fix-missing-who/stale-who doesn't match '/fb/f[stale]':
<?xml version="1.0" encoding="UTF-8"?>
<fb version="0.16.8" size="125">
  <f>
    <issue t="I">94</issue>
    <repository t="I">695</repository>
    <what t="S">pull-was-opened</what>
    <where t="S">github</where>
    <who t="I">526301</who>
  </f>
</fb>

A similar problem is currently observed in other pull requests:

Summary by CodeRabbit

  • Tests
    • Enhanced test coverage for issue retrieval workflows with improved validation of response formats and edge cases.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Oct 30, 2025

Walkthrough

A new case branch for issue number 94 was added to Fbe::FakeOctokit#issue, returning a PR-like hash structure without a user field. A corresponding test was added to verify this behavior.

Changes

Cohort / File(s) Summary
FakeOctokit issue method
lib/fbe/octo.rb
Added case branch for issue number 94 returning a specially crafted hash with id, repo, pull_request (with merged_at: nil), and created_at fields
FakeOctokit test suite
test/fbe/test_octo.rb
Added test_fetch_fake_issue_without_user test verifying issue 94 returns the expected structure without a user field

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single case branch addition with a static hash return value
  • Test follows straightforward assertion pattern

Possibly related PRs

Poem

🐰 A ninety-four joins the fake kit's song,
PR-less and userless, where it belongs,
No merging needed, just a crafted reply,
The rabbit hops on—another test passes by! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% 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 PR title "#1155: fix Fbe::FakeOctokit#issue for fix-missing-who judge" is directly and fully related to the changeset. The title accurately identifies the specific method being modified (Fbe::FakeOctokit#issue), references the issue number (#1155), and provides context about the judge being fixed. The code changes add a case branch for issue 94 to this exact method, and the test verifies the new behavior, which aligns precisely with what the title promises.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
test/fbe/test_octo.rb (1)

696-707: Add a comment explaining why issue 94 lacks a user field.

The implementation correctly provides a test fixture for an issue without a user, which addresses the PR objective. However, for maintainability, consider adding a brief comment explaining why this specific case omits the :user field.

   def issue(repo, number)
     case number
     when 94
+      # Special case: simulates an issue/PR without a user field
+      # to test judge behavior when user information is missing
       {
         id: 42,
lib/fbe/octo.rb (1)

696-707: Consider documenting the rationale for the userless issue.

The new case for issue 94 correctly returns a structure without a :user field, which aligns with the PR objective to fix the fix-missing-who judge test scenario. This allows testing edge cases where user information might be absent.

For improved code clarity, consider adding a brief inline comment explaining why issue 94 is special:

   def issue(repo, number)
     case number
     when 94
+      # Simulates an issue without user field for testing edge cases
       {
         id: 42,
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 36a94ce and c8924fb.

📒 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)
  • octo (44-232)
  • issue (694-756)
🔇 Additional comments (1)
test/fbe/test_octo.rb (1)

427-440: LGTM! Well-structured test for userless issue scenario.

The test correctly validates that issue 94 lacks a :user field using refute_includes and employs pattern matching to confirm the expected structure. This provides good coverage for the edge case.

@Yegorov
Copy link
Copy Markdown
Contributor Author

Yegorov commented Oct 30, 2025

@yegor256 check, please.

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

@rultor release, tag is 0.41.4

@rultor
Copy link
Copy Markdown
Contributor

rultor commented Oct 30, 2025

@rultor release, tag is 0.41.4

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

@rultor
Copy link
Copy Markdown
Contributor

rultor commented Oct 30, 2025

@rultor release, tag is 0.41.4

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

@0crat
Copy link
Copy Markdown

0crat commented Oct 30, 2025

@Yegorov Thanks for the contribution! You've earned +20 points for this: +24 as a basis; -4 for contributing less than 30 hits-of-code (you had 27). According to our work policy, contributions under 30 hits-of-code receive a penalty to encourage more substantial contributions. Please, keep them coming with a bit more code next time! Your running balance is +487; don't forget to check 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