Skip to content
This repository was archived by the owner on Nov 3, 2026. It is now read-only.

ci: add notify-downstream workflow - #2

Merged
mateodelnorte merged 3 commits into
mainfrom
ci/notify-downstream
Feb 14, 2026
Merged

mateodelnorte merged 3 commits into
mainfrom
ci/notify-downstream

Conversation

@mateodelnorte

@mateodelnorte mateodelnorte commented Feb 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds notify-downstream.yml workflow that dispatches dependency-updated events to downstream dependents (meta_cli, meta_git_cli, meta_project_cli, meta_rust_cli) after CI passes on main
  • Part of cascading notification chain across the meta workspace

Test plan

  • Verify workflow YAML is valid
  • After merge, push a test commit and verify dispatch events fire

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Added an automated downstream notification workflow that triggers on pushes to main, waits for CI to finish, and then dispatches standardized notifications to dependent repositories containing the latest commit SHA, short SHA, message, and an inferred change type.

Notifies downstream dependents (meta_cli, meta_git_cli, meta_project_cli,
meta_rust_cli) via repository_dispatch when CI passes on main.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Feb 14, 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 2 minutes and 20 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

A new GitHub Actions workflow triggers on pushes to main, waits for CI to finish, extracts commit metadata (SHA, short SHA, message, actor), derives a change type from the commit message prefix, and dispatches repository_dispatch events to five downstream repositories with a consistent payload.

Changes

Cohort / File(s) Summary
New Notification Workflow
.github/workflows/notify-downstream.yml
Adds a workflow with two jobs: wait-for-ci (polls for the "Test (ubuntu-latest)" check) and notify (checks out code, extracts commit SHA/message/actor, infers change type from commit prefix, and sends repository_dispatch payloads to five downstream repos using PARENT_REPO_PAT).

Sequence Diagram(s)

sequenceDiagram
    actor Developer
    participant GitHub as GitHub (Push Event)
    participant Actions as GitHub Actions Workflow
    participant CI as CI Check (ubuntu-latest)
    participant Repo as Repository
    participant Downstream as Downstream Repos (5 targets)

    Developer->>GitHub: Push to main
    GitHub->>Actions: Trigger notify-downstream workflow

    rect rgba(100,150,200,0.5)
        Actions->>CI: wait-for-ci job polls check status
        CI-->>Actions: Check complete
    end

    rect rgba(150,200,100,0.5)
        Actions->>Repo: Checkout repository
        Repo-->>Actions: Code and metadata
        Actions->>Actions: Extract commit SHA, short SHA, message, actor
        Actions->>Actions: Infer type from commit prefix (feat/fix/chore/docs/test/refactor/other)
    end

    rect rgba(200,150,100,0.5)
        Actions->>Downstream: Dispatch repository events to 5 targets with payload (repo, repo_name, sha, short_sha, message, type, actor)
        Downstream-->>Actions: Events received
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A quiet hop from main to stream,
I sniff the SHA and read the theme,
I tag the type and send it on,
Five doors knocked before the dawn,
Little rabbit, workflow dream.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci: add notify-downstream workflow' accurately and clearly summarizes the main change—adding a new GitHub Actions workflow for notifying downstream repositories.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ 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 ci/notify-downstream

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

@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: 5

🤖 Fix all issues with AI agents
In @.github/workflows/notify-downstream.yml:
- Around line 44-110: Replace the four duplicated repository-dispatch steps with
a single matrix-based job (e.g., job name notify) that defines a
strategy.matrix.repo containing the list of downstream repos and a single step
"Notify ${{ matrix.repo }}" that uses peter-evans/repository-dispatch@v3; keep
the existing commit extraction step (id: commit) and reuse its outputs
(steps.commit.outputs.sha, short_sha, message, type) in the client-payload, set
strategy.fail-fast: false so one failure doesn't stop other notifications, and
update the repository field to use ${{ matrix.repo }}.
- Around line 8-17: The wait-for-ci job currently lacks a job timeout and
doesn't restrict which CI conclusions are accepted; update the wait-for-ci job
to include a job-level timeout-minutes (e.g., 30) to avoid indefinite runs and
add the action input allowed-conclusions (set to only "success") to the
lewagon/wait-on-check-action invocation so the workflow proceeds only when the
named check (check-name input) passes; keep existing inputs (ref, repo-token,
wait-interval) intact and only add timeout-minutes on the job and
allowed-conclusions to the action.
- Around line 23-26: The workflow currently performs a full clone by setting
fetch-depth: 0 on the actions/checkout@v4 step; change the Checkout step to use
fetch-depth: 1 to perform a shallow clone (only the HEAD commit) for faster
execution and reduced network/storage, i.e. update the fetch-depth value in the
Checkout action configuration.
- Around line 28-42: The commit extraction step (step id "commit") writes raw
commit message to the "message" output which later gets interpolated into JSON
payloads, causing JSON injection when the message contains quotes/newlines;
replace this by adding a JSON-escaped output (e.g., "message_escaped") produced
by piping MSG through a JSON-escaper (jq -R -s -c `@json` or equivalent) and write
that escaped value to GITHUB_OUTPUT, then update downstream payloads (where the
current "message" output is used) to consume commit.message_escaped without
adding extra quotes so the payloads remain valid JSON.
- Line 12: Update the GitHub Actions step that references
lewagon/wait-on-check-action by changing the pinned version from v1.3.4 to
v1.5.0 (the line containing "uses: lewagon/wait-on-check-action@v1.3.4"); this
will apply the security fix (rexml bump) and enable the new fail-on-no-checks
feature—ensure the single uses entry is updated to "@v1.5.0" and run/validate
the workflow after the change.

Comment thread .github/workflows/notify-downstream.yml Resolved
Comment thread .github/workflows/notify-downstream.yml Resolved
Comment thread .github/workflows/notify-downstream.yml Resolved
Comment thread .github/workflows/notify-downstream.yml Resolved
Comment thread .github/workflows/notify-downstream.yml Resolved
- Update lewagon/wait-on-check-action v1.3.4 → v1.5.0
- Use toJSON() in client-payload to prevent JSON injection
- Tighten commit type regex (^feat → ^feat[:(])
- Use shallow clone (remove fetch-depth: 0)
- Use matrix strategy for downstream notifications

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@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

🤖 Fix all issues with AI agents
In @.github/workflows/notify-downstream.yml:
- Around line 41-48: The conditional regexes that test MSG (the if/elif block
that echoes type based on commit message) are too strict and miss variants with
a breaking-change bang (e.g., feat! or feat!(scope)): update each pattern (the
tests for "feat", "fix", "chore", "docs", "test", "refactor") to allow an
optional "!" immediately after the type before the delimiter by inserting an
optional-bang token between the type and the delimiter (so the pattern accepts
e.g. feat!, feat!(scope), feat:, feat(scope), etc.); keep the rest of the match
(delimiter check) the same and apply the same change for all listed types in
that if/elif block.

Comment on lines +41 to +48
if [[ "$MSG" =~ ^feat[:(] ]]; then echo "type=feat" >> $GITHUB_OUTPUT
elif [[ "$MSG" =~ ^fix[:(] ]]; then echo "type=fix" >> $GITHUB_OUTPUT
elif [[ "$MSG" =~ ^chore[:(] ]]; then echo "type=chore" >> $GITHUB_OUTPUT
elif [[ "$MSG" =~ ^docs[:(] ]]; then echo "type=docs" >> $GITHUB_OUTPUT
elif [[ "$MSG" =~ ^test[:(] ]]; then echo "type=test" >> $GITHUB_OUTPUT
elif [[ "$MSG" =~ ^refactor[:(] ]]; then echo "type=refactor" >> $GITHUB_OUTPUT
else echo "type=other" >> $GITHUB_OUTPUT
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Regex may miss valid conventional commit variants.

The pattern ^feat[:(] requires the type to be immediately followed by : or (. This misses valid conventional commit formats like:

  • feat!: breaking change (breaking change indicator)
  • feat!(<scope>): message (breaking change with scope)

Consider using a more permissive pattern that allows an optional ! before the delimiter:

♻️ Proposed fix
-          if [[ "$MSG" =~ ^feat[:(] ]]; then echo "type=feat" >> $GITHUB_OUTPUT
-          elif [[ "$MSG" =~ ^fix[:(] ]]; then echo "type=fix" >> $GITHUB_OUTPUT
-          elif [[ "$MSG" =~ ^chore[:(] ]]; then echo "type=chore" >> $GITHUB_OUTPUT
-          elif [[ "$MSG" =~ ^docs[:(] ]]; then echo "type=docs" >> $GITHUB_OUTPUT
-          elif [[ "$MSG" =~ ^test[:(] ]]; then echo "type=test" >> $GITHUB_OUTPUT
-          elif [[ "$MSG" =~ ^refactor[:(] ]]; then echo "type=refactor" >> $GITHUB_OUTPUT
+          if [[ "$MSG" =~ ^feat[\!\(\:] ]]; then echo "type=feat" >> $GITHUB_OUTPUT
+          elif [[ "$MSG" =~ ^fix[\!\(\:] ]]; then echo "type=fix" >> $GITHUB_OUTPUT
+          elif [[ "$MSG" =~ ^chore[\!\(\:] ]]; then echo "type=chore" >> $GITHUB_OUTPUT
+          elif [[ "$MSG" =~ ^docs[\!\(\:] ]]; then echo "type=docs" >> $GITHUB_OUTPUT
+          elif [[ "$MSG" =~ ^test[\!\(\:] ]]; then echo "type=test" >> $GITHUB_OUTPUT
+          elif [[ "$MSG" =~ ^refactor[\!\(\:] ]]; then echo "type=refactor" >> $GITHUB_OUTPUT
🤖 Prompt for AI Agents
In @.github/workflows/notify-downstream.yml around lines 41 - 48, The
conditional regexes that test MSG (the if/elif block that echoes type based on
commit message) are too strict and miss variants with a breaking-change bang
(e.g., feat! or feat!(scope)): update each pattern (the tests for "feat", "fix",
"chore", "docs", "test", "refactor") to allow an optional "!" immediately after
the type before the delimiter by inserting an optional-bang token between the
type and the delimiter (so the pattern accepts e.g. feat!, feat!(scope), feat:,
feat(scope), etc.); keep the rest of the match (delimiter check) the same and
apply the same change for all listed types in that if/elif block.

The Cargo.toml uses edition.workspace, version.workspace, etc. but CI
had no workspace root, causing all builds to fail since the config
refactoring.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mateodelnorte
mateodelnorte merged commit 11bb723 into main Feb 14, 2026
6 checks passed
@mateodelnorte
mateodelnorte deleted the ci/notify-downstream branch February 14, 2026 05:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant