[WRONG BRANCH] fix(omp): allow quoted # in OMP-managed YAML (treat # as comment only outside quotes) - #251
[WRONG BRANCH] fix(omp): allow quoted # in OMP-managed YAML (treat # as comment only outside quotes)#251luvs01 wants to merge 1 commit into
# in OMP-managed YAML (treat # as comment only outside quotes)#251Conversation
|
Warning Review limit reached
Next review available in: 29 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Comment |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Its title has been prefixed with |
# in OMP-managed YAML (treat # as comment only outside quotes)# in OMP-managed YAML (treat # as comment only outside quotes)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e0fdbaf26a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| else quote = null; | ||
| continue; | ||
| } | ||
| if (character === "'" || character === "\"") quote = character; |
There was a problem hiding this comment.
Restrict quote tracking to quoted-scalar starts
When an OMP-managed plain scalar contains an apostrophe or double quote before a real inline comment—for example, name: user's model # keep this note, which is valid YAML—hasInlineComment enters quote mode even though YAML treats that quote as ordinary plain-scalar content. The whitespace-separated # is therefore missed, so refresh or disable proceeds and silently deletes the user-authored comment instead of returning null. Only enter quote state where a quoted scalar can syntactically begin (or use a YAML lexer/CST), and add regression coverage for quoted characters inside plain scalars.
AGENTS.md reference: src/AGENTS.md:L10-L10
Useful? React with 👍 / 👎.
Motivation
#byte inside a managed block as an inline comment, which also blocked legitimate generated YAML that contains#inside quoted scalars (for example model IDs or names like"provider/model#variant").#, creating an availability/integrity problem for OMP-managed blocks.Description
hasInlineComment(line: string)implementation with a scanner that tracks single- and double-quoted YAML scalars and treats#as an inline comment only when it appears outside quotes and after YAML separation whitespace; the scanner also handles escaped double-quote sequences and doubled single quotes. (change insrc/integrations/omp-yaml-source.ts).childEnd/ container logic remains guarded.)#scalars while still refusing real nested inline comments. (added test cases intests/omp-yaml-source-inline-comments.test.ts).Testing
node_modules/@oven/bun-linux-x64-baseline/bin/bun test tests/omp-yaml-source-inline-comments.test.ts, which passed (4/4 tests passed).node_modules/@oven/bun-linux-x64-baseline/bin/bun run typecheck, which completed successfully.node_modules/@oven/bun-linux-x64-baseline/bin/bun run test; the full suite run exposed unrelated pre-existing failures/timeouts in other tests (lab-live-review regressions and a sideband timeout), so the change was validated with the focused regression and typecheck but a green full-suite run was blocked by unrelated existing failures.Codex Task