test(persistence): cover uppercase-label and scanner edge branches - #219
Conversation
The production branch gate reported 2028/2030 after the consolidation vehicle landed: validate_entity_label and validate_project_label never observed an uppercase byte that passes the alphanumeric clause yet fails the lowercase clause, so the final || operand stayed uncovered. The quality suite likewise missed three Python arcs in scripts/ check_coverage.py: the previous-line scan exhausting over blank-only history (211->215, 212->211) and the escaped-character arc inside char literal scanning (318->311). Add exact red-to-green cases for each.
|
Warning Review limit reachedNext included review available in 10 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
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. Comment |
There was a problem hiding this comment.
📝 Info: Redundant byte gate in label validation
The is_ascii_alphanumeric() || byte == b'_' byte check in validate_entity_label/validate_project_label (entity_sql.rs) is fully subsumed by the stricter final clause requiring lowercase/digit/underscore. It cannot independently reject any input, which is why the new AUTHOR/ACTIVE cases are needed to exercise the last operand.
(Refers to this code)
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
📝 Info: Contradictory duplicated docstring on validate
The # Errors docstring pairs two overlapping sentences (entity_sql.rs and the analogous project_sql.rs): one claims an ASCII-letters allowlist, the next claims lowercase-only. The new tests confirm lowercase-only, so the first sentence is misleading. Pre-existing context, not changed here.
(Refers to this code)
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Repairs the exact branch-coverage gaps that the #215 consolidation vehicle carried into protected main:
validate_entity_label/validate_project_labelnever observed a label whose bytes all pass the alphanumeric gate while a character fails the lowercase gate (AUTHOR/ACTIVE). The final\|\|operand of the validation chain stayed at count 0._is_structural_comma_continuationnever exhausted over blank-only history, and the char-literal scanner in_line_in_multiline_stringnever processed an escaped character. Replaces the prior edge-case test whose inputs did not reach the target functions with exact red-to-green cases.Verification at this head
cargo test -p persistence_postgres --lib: 54 passedpython3 -m pytest tests/quality: 146 passed (+60 subtests)Closes the follow-up of GAP-012 delivery-queue consolidation.