Skip to content

Count No Earlier Round When the Head Is Unreadable and Import Audit at Module Scope - #2933

Merged
ptr727 merged 2 commits into
developfrom
feature/review-head-and-import-comment
Oct 13, 2026
Merged

ptr727 merged 2 commits into
developfrom
feature/review-head-and-import-comment

Conversation

@ptr727

@ptr727 ptr727 commented Oct 13, 2026

Copy link
Copy Markdown
Owner

round_before_head compared every review oid against an empty head when headRefOid was unreadable, so any review counted as an earlier round and wait requested nothing. It now returns False, matching its docstring.

The comment justifying a function-local import of audit in the spec tests became false when hub_name() went lazy, so the import moves to module scope and the comment is dropped.

Part of #2897 and #2829.

🤖 Generated with Claude Code

ptr727 and others added 2 commits October 12, 2026 21:53
…t Module Scope

round_before_head compared every review oid against an empty head, so an unreadable headRefOid made any review an earlier round and wait requested nothing.
The audit import comment became false once hub_name() went lazy, so the import moves to module scope.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 13, 2026 05:03
@ptr727

ptr727 commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 1d02244dc2f46bfb61f6071d348812413a0b2bf5, the content this pull request carries at that commit against develop, and it recorded 2 findings.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9fffeec7-cd89-4c8f-8372-e9189ac25e74
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Copilot AI 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.

🟢 Approval recommended

The small changes match their stated purpose, have focused regression coverage, and have no unresolved findings.

0 open findings

What changed in this PR

This PR fixes review-round detection when a pull request’s head is unreadable and updates an audit test import after hub-name resolution became lazy.

Changes:

  • Treat an unreadable head as having no earlier review round, with regression cases for None and an empty string.
  • Move the audit import to module scope and remove its obsolete explanation.
File Description
scripts/​pr_review.py Corrects earlier-round detection for an unreadable head.
tests/​test_pr_review.py Tests both unreadable-head cases.
tests/​test_spec_validate.py Moves the audit import and removes the outdated comment.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.96%. Comparing base (1037300) to head (1d02244).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2933   +/-   ##
========================================
  Coverage    59.96%   59.96%           
========================================
  Files           17       17           
  Lines         8777     8777           
========================================
  Hits          5263     5263           
  Misses        3514     3514           
Flag Coverage Δ
python-3.13 59.96% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727
ptr727 merged commit cf3f696 into develop Oct 13, 2026
14 checks passed
@ptr727
ptr727 deleted the feature/review-head-and-import-comment branch October 13, 2026 05:11
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.

2 participants