Skip to content

test(persistence): cover uppercase-label and scanner edge branches - #219

Merged
seonghobae merged 1 commit into
mainfrom
fix/coverage-union-gaps-post215
Aug 25, 2026
Merged

test(persistence): cover uppercase-label and scanner edge branches#219
seonghobae merged 1 commit into
mainfrom
fix/coverage-union-gaps-post215

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Repairs the exact branch-coverage gaps that the #215 consolidation vehicle carried into protected main:

  • Production branches (2028/2030): validate_entity_label / validate_project_label never 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.
  • Python arcs (211->215, 212->211, 318->311): the previous-line scan in _is_structural_comma_continuation never exhausted over blank-only history, and the char-literal scanner in _line_in_multiline_string never 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 passed
  • python3 -m pytest tests/quality: 146 passed (+60 subtests)
  • Single-file coverage run confirms 211->215, 212->211, 318->311 now covered; full-suite run covers 452->453 as before.

Closes the follow-up of GAP-012 delivery-queue consolidation.


Open in Devin Review

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.
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 10 minutes.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9098c6fe-5dd4-4bc5-ba6d-26727b3cd5ed

📥 Commits

Reviewing files that changed from the base of the PR and between 5c85994 and 6cf0d87.

📒 Files selected for processing (3)
  • crates/persistence_postgres/src/entity_sql.rs
  • crates/persistence_postgres/src/project_sql.rs
  • tests/quality/test_check_coverage.py

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.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

Open in Devin Review

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📝 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)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📝 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)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@seonghobae
seonghobae enabled auto-merge August 25, 2026 03:01
@seonghobae
seonghobae merged commit 85064a3 into main Aug 25, 2026
30 of 31 checks passed
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.

1 participant