Skip to content

fix(docs): compile the bqRE once at package level#57

Open
tampakrap wants to merge 1 commit into
crossplane:mainfrom
tampakrap:fix_docs_bqre
Open

fix(docs): compile the bqRE once at package level#57
tampakrap wants to merge 1 commit into
crossplane:mainfrom
tampakrap:fix_docs_bqre

Conversation

@tampakrap
Copy link
Copy Markdown
Collaborator

@tampakrap tampakrap commented May 29, 2026

Description of your changes

Avoids recompiling the regex on every call to normalizeDetail, slightly improving the speed.

Fixes #

I have:

Need help with this checklist? See the cheat sheet.

@tampakrap tampakrap requested review from a team and jcogilvie as code owners May 29, 2026 23:04
@tampakrap tampakrap requested review from adamwg and negz and removed request for a team May 29, 2026 23:04
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Review Change Stack

Warning

Review limit reached

@tampakrap, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 36 minutes and 56 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9a8eb981-ed14-4afe-ab9e-055cd9576d84

📥 Commits

Reviewing files that changed from the base of the PR and between 6037afd and 5e74bfe.

📒 Files selected for processing (1)
  • cmd/crossplane/docs.go
📝 Walkthrough

Walkthrough

A package-level compiled regex variable is added to detect blockquote markers, and the normalizeDetail function is updated to use this pre-compiled regex instead of compiling it locally on each call.

Changes

Blockquote Regex Optimization

Layer / File(s) Summary
Package-level regex extraction
cmd/crossplane/docs.go
Blockquote detection regex is moved from local compilation inside normalizeDetail to a package-level bqRE variable, eliminating repeated regex compilation during function calls.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and descriptively summarizes the main change: moving regex compilation to package level to improve performance.
Description check ✅ Passed The description is directly related to the changeset, explaining the performance optimization and providing context about the regex compilation change.
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.
Breaking Changes ✅ Passed No breaking changes. cmd/crossplane/docs.go contains only private functions/variables; regex compilation optimization doesn't affect any public APIs.
Feature Gate Requirement ✅ Passed PR moves regex compilation to package-level for performance; not a new feature, doesn't affect apis/**, and doesn't change behavior—just optimizes by avoiding repeated compilation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

Avoids recompiling the regex on every call to normalizeDetail, slightly
improving the speed.

Signed-off-by: Theo Chatzimichos <tampakrap@gmail.com>
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