Skip to content

fix(ci): store regex in variables to fix notify-parent parse error - #7

Merged
mateodelnorte merged 1 commit into
mainfrom
fix/notify-parent-regex
Feb 19, 2026
Merged

mateodelnorte merged 1 commit into
mainfrom
fix/notify-parent-regex

Conversation

@mateodelnorte

@mateodelnorte mateodelnorte commented Feb 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Stores regex patterns in bash variables before using them in [[ =~ ]] tests
  • Fixes bash parse error: ( in [:(] character class was interpreted as unmatched subshell opener
  • Error: unexpected EOF while looking for matching ')' (exit code 2)
  • Broken since cascading notification support was added

Root cause

# Broken — bash parses ( as subshell opener before regex engine sees it
if [[ "$MSG" =~ ^feat[:(] ]]; then ...

# Fixed — variable content passes directly to regex engine
re_feat='^feat[:(]'
if [[ "$MSG" =~ $re_feat ]]; then ...

Context

  • Part of [[tasks/meta-64]] / [[incidents/notify-parent-broken]]
  • Same fix applied to all 5 affected child repos

Test plan

  • Workflow passes on next push to main after merge

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Improved workflow automation: more reliable propagation of event data and stable output formatting.
    • Centralized and consistent handling of workflow outputs for dispatch and non-dispatch events.
    • Added automated classification of commit messages to better categorize workflow runs.

@coderabbitai

coderabbitai Bot commented Feb 18, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@mateodelnorte has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 54 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.

Walkthrough

Adds a write_output helper and branches to propagate event payload or commit-derived fields into GITHUB_OUTPUT; centralizes output formatting, pre-declares regex variables for message-type classification, and replaces inline echoes with write_output in the notify-parent workflow. (50 words)

Changes

Cohort / File(s) Summary
GitHub Actions workflow
.github/workflows/notify-parent.yml
Adds a write_output helper to append key/value pairs to GITHUB_OUTPUT with a stable delimiter; propagates event payload fields when EVENT_NAME is repository_dispatch, otherwise derives fields from the latest commit; extracts regexes into named variables (re_feat, re_fix, re_chore, re_docs, re_test, re_refactor) and uses them to classify message type; removes direct echo writes and centralizes output logic.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through lines of YAML keen and bright,
I bundled echoes into one tidy write,
Payloads and commits now speak the same name,
Regex ribbons tied — the workflow's not the same! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'fix(ci): store regex in variables to fix notify-parent parse error' directly aligns with the main change: storing regex patterns in bash variables to resolve a parsing error in the notify-parent workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 fix/notify-parent-regex

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented Feb 18, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes a bash parsing error that caused the notify-parent workflow to fail with unexpected EOF while looking for matching ')'. The issue occurred because bash interpreted the opening parenthesis in the regex character class [:(] as a subshell opener before the regex engine could process it.

Changes:

  • Stored all 6 regex patterns in bash variables before use in [[ =~ ]] tests
  • Variables pass their content directly to the regex engine, bypassing bash's subshell parsing
  • Preserves all original regex logic while fixing the parse error

Technical correctness:

  • The fix is the standard bash best practice for using regex with special characters
  • All regex patterns correctly match conventional commit prefixes like feat: or feat(
  • No functional changes to the commit type detection logic

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The fix applies a standard bash best practice to resolve a well-documented parse error. The change is minimal (storing regex in variables), preserves all existing logic, and addresses a specific syntax issue that was causing CI failures. No functional changes to the workflow behavior.
  • No files require special attention

Important Files Changed

Filename Overview
.github/workflows/notify-parent.yml Stores regex patterns in variables to fix bash parse error with character class [:(]

Last reviewed commit: 4336db7

@mateodelnorte
mateodelnorte force-pushed the fix/notify-parent-regex branch 2 times, most recently from eec2b7f to a6117f3 Compare February 19, 2026 00:27

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/notify-parent.yml:
- Around line 43-49: The write_output() helper currently uses a fixed delimiter
"__EOF__" when appending to GITHUB_OUTPUT, which can collide with payloads;
change write_output() to generate a unique delimiter per invocation (e.g., UUID,
random hex, or timestamp) and use that delimiter in the three printf calls so
the boundary is guaranteed unique before appending to GITHUB_OUTPUT; update
references to the delimiter inside write_output() (the printf lines that emit
the start marker and closing marker) to use the generated variable instead of
"__EOF__".

Comment thread .github/workflows/notify-parent.yml
Bash interprets `(` in `[:(]` character classes as an unmatched
subshell opener, causing "unexpected EOF while looking for matching ')'"
(exit code 2). Storing the regex in a variable avoids this because bash
passes variable content directly to the regex engine without shell parsing.

Resolves [[incidents/notify-parent-broken]]
Implements [[tasks/meta-64]]

Co-authored-by: Claude <claude@anthropic.com>
@mateodelnorte
mateodelnorte force-pushed the fix/notify-parent-regex branch from a6117f3 to e9ff61f Compare February 19, 2026 03:23
@mateodelnorte
mateodelnorte merged commit 22bc43a into main Feb 19, 2026
7 checks passed
@mateodelnorte
mateodelnorte deleted the fix/notify-parent-regex branch February 19, 2026 04:03
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