Skip to content

Reject a Case-Only Registry Name Mismatch Too - #919

Merged
ptr727 merged 2 commits into
developfrom
issue-914-review-fixes-3
Aug 22, 2026
Merged

Reject a Case-Only Registry Name Mismatch Too#919
ptr727 merged 2 commits into
developfrom
issue-914-review-fixes-3

Conversation

@ptr727

@ptr727 ptr727 commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Fixes a real gap from PR #914's fresh review round after #918 merged, plus declines two twins of findings already resolved on #918.

  • spec/resolve_description.py: extended the padded-name near-miss check (from Delegate configure.sh's Description Check to Python Too #918) to also catch a case-only mismatch (e.g., resolving Fixture against a registry entry named fixture) - GitHub treats repo names case-insensitively, so this is a data-entry typo, not a different repo. Same mechanism, now normalizing with .strip().casefold() on both sides. New test case.

Declined (reasoning posted to #914):

  • "Preserve interpreter probe failures" - identical to a finding already declined on Delegate configure.sh's Description Check to Python Too #918, citing this file's own gh_ok() precedent for discarding a capability probe's output.
  • "Reject malformed repository entries" (a null in repos) - that's spec/validate.py's whole-registry structural check; an unrelated malformed entry degrading to "nothing declared" for a different, valid repo's lookup is a safe outcome with a much wider blast radius than the specific near-miss cases already fixed.

786 automated tests, prose lint, ruff, pyright, and mypy all pass.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Improved repository name matching to detect differences in capitalization and surrounding whitespace.
    • Name collisions are now reported correctly instead of being treated as missing repositories.
  • Tests

    • Added coverage for case-only repository name mismatches.

Real fix, a natural extension of the padded-name near-miss check
(8de62f9): a registry entry named "fixture" when configure.sh
resolves "Fixture" (the GitHub-canonical casing) would silently read
as "no description declared" rather than flagging the likely typo -
GitHub itself treats repo names case-insensitively, so a same-name-
different-case entry is a data-entry mistake, not a different repo.
Folded into the same near-miss check (normalize with .strip().casefold()
on both sides) rather than a second parallel check. New test case.

Declined (reasoning posted to PR #914): CodeRabbit's "preserve
interpreter probe failures" - the identical finding already declined
on PR #918 citing this same file's own gh_ok() precedent for
discarding a capability probe's output; and "reject malformed
repository entries" (a null entry in repos) - that belongs to
spec/validate.py's whole-registry structural check, and an unrelated
malformed entry degrading an unrelated repo's lookup to a safe
"nothing declared" (not a wrong value) has a materially different,
much wider blast radius than the specific near-miss cases already
fixed.
Copilot AI lite review requested due to automatic review settings August 22, 2026 20:51
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ptr727, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

Limit details: You’ve used all 10 included reviews currently available.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d32f29a6-96a3-4723-8a6a-5158a53dda98

📥 Commits

Reviewing files that changed from the base of the PR and between e6c2db3 and 8b0113c.

📒 Files selected for processing (1)
  • spec/resolve_description.py

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 63e90a8e-4fc2-4455-b845-5c87d99ed755

📥 Commits

Reviewing files that changed from the base of the PR and between 6b4929d and e6c2db3.

📒 Files selected for processing (2)
  • scripts/tests/test_resolve_description.py
  • spec/resolve_description.py

Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

resolve_description now detects repository names that differ only by whitespace or letter case and raises ResolveError. A unit test covers a case-only mismatch.

Changes

Repository name resolution

Layer / File(s) Summary
Normalized collision detection
spec/resolve_description.py, scripts/tests/test_resolve_description.py
resolve_description trims and case-folds names during near-miss detection. The test verifies that fixture and Fixture raise ResolveError.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to e6c2d

The change rejects case-only registry name mismatches while preserving the existing near-miss behavior, with automated checks passing; no actionable merge-blocking risk remains beyond normal review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: rejecting registry name mismatches that differ only by case.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-914-review-fixes-3

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

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fail loud on case-only registry repo name near-misses

🐞 Bug fix 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Reject registry entries whose names match after trim+casefold, preventing silent “absent
 description”.
• Update resolve_description error messaging/docs to include case-only mismatches.
• Add regression test covering case-only mismatched repo names.
Diagram

graph TD
A["repo-config/configure.sh"] --> B["spec/resolve_description.py"] --> C[("registry/repos.json")]
B --> D["spec/validate.py"]
B --> E["Exit 0/1 + output"]
Loading
High-Level Assessment

The chosen approach is the minimal, most consistent extension of the existing “padded name” near-miss guard: normalize both sides with strip().casefold() and fail loud. Alternatives like allowing case-insensitive lookup would hide data-entry mistakes, and moving this entirely into registry-wide validation would broaden scope beyond the targeted resolution behavior.

Files changed (2) +13 / -5

Bug fix (1) +8 / -5
resolve_description.pyTreat case-only name mismatches as near-miss errors +8/-5

Treat case-only name mismatches as near-miss errors

• Extends the existing near-miss detection to normalize both registry and lookup names with strip().casefold(). Updates the docstring and error message so case-only mismatches fail loud rather than being treated as “no description declared.”

spec/resolve_description.py

Tests (1) +5 / -0
test_resolve_description.pyAdd regression test for case-only repo-name near-miss +5/-0

Add regression test for case-only repo-name near-miss

• Adds a new unit test asserting that resolving "Fixture" against a registry entry named "fixture" raises ResolveError. This prevents case-only typos from silently behaving like an absent registry entry.

scripts/tests/test_resolve_description.py

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

Only a minor docstring grammar nit was found; core behavior and test coverage look sound.

Pull request overview

Extends registry-description resolution to fail loud when a requested repo name differs from a registry entry only by letter case (in addition to existing whitespace near-miss handling), preventing silent “absent” behavior for GitHub-case-insensitive repo names.

Changes:

  • Normalize candidate comparisons using strip().casefold() to detect case-only near misses as ResolveError conditions.
  • Add a unit test covering case-only registry name mismatches.
File summaries
File Description
spec/resolve_description.py Extends near-miss detection to include case-only mismatches and updates the corresponding error message/docstring text.
scripts/tests/test_resolve_description.py Adds a regression test ensuring a case-only mismatch raises ResolveError.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread spec/resolve_description.py Outdated
@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab)

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

…d 2)

Reintroduced the exact typo already fixed once in an earlier commit
when I rewrote this docstring to add the case-insensitivity note.
Copilot AI review requested due to automatic review settings August 22, 2026 20:55

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 change is narrowly scoped, consistent with existing validation intent, and includes a direct regression test for the new mismatch class.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@ptr727
ptr727 merged commit f726c7a into develop Aug 22, 2026
9 checks passed
@ptr727
ptr727 deleted the issue-914-review-fixes-3 branch August 22, 2026 21:00
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