Skip to content

Conversation

@elisescu
Copy link
Contributor

@elisescu elisescu commented Jan 28, 2026

Should close #4176

Summary by CodeRabbit

  • Bug Fixes
    • Improved validation logic for question group formatting to handle edge cases more accurately, ensuring stricter and more reliable processing of group identifiers.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2026

Warning

Rate limit exceeded

@elisescu has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 24 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 1b883ba and d81836c.

📒 Files selected for processing (4)
  • notifications/services.py
  • notifications/templates/emails/post_cp_change.html
  • notifications/templates/emails/post_cp_change.mjml
  • questions/utils.py
📝 Walkthrough

Walkthrough

A regex pattern in the get_question_group_title function was refined to be more restrictive. The updated pattern no longer matches empty parentheses, requiring at least one non-parenthesis character within matched groups to prevent unintended captures.

Changes

Cohort / File(s) Summary
Regex Pattern Refinement
questions/utils.py
Modified regex in get_question_group_title from \((?:[^()]*|\([^()]*\))*\) to `((?:[^()]

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A parenthesis dance, so tight and refined,
No empty pairs left behind,
One line changed, one line true,
Security regex, we thank you!

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive The linked issue #4176 references a code-scanning alert but provides no specific coding requirements or objectives to validate against the changes. Provide detailed requirements from the code-scanning issue #4176 to verify whether the regex fix adequately addresses the identified security or performance concern.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix a greedy exponential regex' clearly describes the main change: fixing a regex pattern that had exponential complexity behavior.
Out of Scope Changes check ✅ Passed The single regex change in questions/utils.py is directly related to fixing the greedy exponential regex mentioned in the PR title and linked issue.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix4176

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.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 28, 2026

🧹 Preview Environment Cleaned Up

The preview environment for this PR has been destroyed.

Resource Status
🌐 Preview App ✅ Deleted
🗄️ PostgreSQL Branch ✅ Deleted
⚡ Redis Database ✅ Deleted
🔧 GitHub Deployments ✅ Removed
📦 Docker Image ⚠️ Retained (auto-cleanup via GHCR policies)

Cleanup triggered by PR close at 2026-02-03T11:49:36Z

@hlbmtc
Copy link
Contributor

hlbmtc commented Jan 30, 2026

I think we can fully deprecate get_question_group_title, since the migration was applied a long time ago:

  1. Deprecate CPChangeData.format_question_title
  2. Deprecate get_question_group_title
  3. Replace {{ item.format_question_title }} with {{ item.question.label }} in notifications/templates/emails/post_cp_change.html
  4. Regenerate MJML

@elisescu
Copy link
Contributor Author

elisescu commented Feb 3, 2026

@hlbmtc have another look now

@elisescu elisescu merged commit 6424c4d into main Feb 3, 2026
15 checks passed
@elisescu elisescu deleted the fix4176 branch February 3, 2026 11:49
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.

11

3 participants