Skip to content

chore: restore notify-parent workflow (simplified) - #10

Closed
mateodelnorte wants to merge 37 commits into
mainfrom
fix/restore-notify-parent
Closed

mateodelnorte wants to merge 37 commits into
mainfrom
fix/restore-notify-parent

Conversation

@mateodelnorte

@mateodelnorte mateodelnorte commented Mar 26, 2026 •

Copy link
Copy Markdown
Contributor

Re-adds notify-parent.yml to trigger parent meta repo's release-please when this child repo merges to main.

Simplified: no commit message parsing, just dispatches repo name and SHA. Companion to gitkb/meta#62.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated internal notification workflow automation to improve efficiency and streamline dependency update notifications.

mateodelnorte and others added 30 commits October 14, 2024 14:51
…command added. able to leverage cached aliases. TODO: ensure color/streaming of child commands after cwd
  Usage: meta [options] [command]

  Options:

    -V, --version  output the version number
    -h, --help     output usage information

  Commands:

    git            manage your meta repo and child git repositories
    init           initialize a new meta repo
    exec|loop      execute a command against meta repo and child repo dirs
    project        create, import, and remove child repositories
    help [cmd]     display help for [cmd]
- Moved CONTEXT.md and IMPLEMENTATION_PLAN.md to .context/ directory
- Expanded .gitignore with comprehensive patterns for dependencies, testing, production, development, logs, editors, TypeScript, Rust, models, cache, and child repositories
- Updated .meta to reference harmony-labs repositories and added meta-git project
- Removed .processed_contextignore.tmp and .tool-versions files
- Updated Cargo dependencies: added libloading, thiserror, and meta-git
- Simplified loop CLI by removing parallel execution option
- Added meta-git as a dynamic library with dependencies on anyhow and meta
- Removed parallel execution references from loop README and code
- Adjusted meta and integration tests accordingly
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use workspace-level version, edition, license, and repository fields
instead of duplicating values. Adds crate description for crates.io.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add clear usage examples and options table
- Add configuration section with .looprc format
- Add execution flow diagram
- Add output modes documentation
- Add meta integration comparison table
- Add library usage example

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
mateodelnorte and others added 6 commits January 31, 2026 18:48
- Test on ubuntu, macos, windows
- Clippy with -D warnings
- Format check
- Swatinem/rust-cache for maximal caching

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Automatically formats code in PRs before CI runs.

Benefits:
- Prevents format failures in CI
- Reduces developer friction
- Keeps code consistently formatted

Based on gitkb/core auto-format workflow.
Add push trigger to auto-format workflow so formatting issues
get auto-fixed even when pushing directly to main.

Guard against infinite loops by skipping when the actor is
github-actions[bot].

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* ci: add cascading notification support

- Add repository_dispatch trigger to CI for upstream dependency updates
- Add notify-parent.yml to notify meta when CI passes (on push or cascade)

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

* fix: address code review feedback

- 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)
- Add missing actor output in push event path

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

* fix(ci): add workspace Cargo.toml for workspace inheritance

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>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
#8)

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>
The parent meta repo's on-child-update workflow has been removed —
these dispatch events go nowhere. The parent doesn't build or test
child repos; the sync PRs were empty noise.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Mar 26, 2026 •

Copy link
Copy Markdown

Walkthrough

This PR simplifies a GitHub workflow by removing the repository_dispatch trigger and eliminating a two-step CI gating mechanism (wait-for-ci and notify-parent jobs). The changes consolidate into a single notify job that runs on push to main, updates the GitHub Action from v3 to v4, and reduces the dispatched payload to include only three fields instead of seven computed ones.

Changes

Cohort / File(s) Summary
Workflow Notification Simplification
.github/workflows/notify-parent.yml
Removed repository_dispatch trigger and two-job CI gating flow (wait-for-ci + notify-parent). Replaced with single notify job on push to main. Updated peter-evans/repository-dispatch from v3 to v4. Simplified dispatched payload from 7 computed fields to 3: repo_name, short_sha, actor.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A workflow once tangled with gates,
Now hops swift—no waiting, no waits!
The payload grows light,
The dispatch feels right,
And v4 celebrates at the gates! 🎉

🚥 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 title 'chore: restore notify-parent workflow (simplified)' directly and accurately describes the main change: restoring a simplified version of 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
  • Commit unit tests in branch fix/restore-notify-parent
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch fix/restore-notify-parent

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

@greptile-apps

greptile-apps Bot commented Mar 26, 2026

Copy link
Copy Markdown

Greptile Summary

This PR restores a simplified notify-parent.yml workflow that fires on every push to main and dispatches a child-repo-updated event to harmony-labs/meta, carrying repo_name, short_sha, and actor in the payload.\n\nKey changes:\n- Removes the wait-for-ci gate — the parent is now notified immediately on push, before CI finishes; merges that fail CI will still trigger the parent.\n- Removes commit-message parsing and the repository_dispatch trigger path.\n- Upgrades peter-evans/repository-dispatch from v3 → v4.\n- Bug: the short_sha field is populated with github.sha (full 40-char SHA), not an abbreviated SHA — this breaks the naming contract established by the old workflow and expected by the companion consumer in harmony-labs/meta#62.\n- The actions/checkout@v4 step is now unused and can be removed.

Confidence Score: 4/5

Safe to merge after fixing the short_sha / full-SHA mismatch; all other changes are clean simplifications.

One concrete naming/value bug (short_sha receiving the full SHA) needs a targeted fix; the overall simplification is sound, the action upgrade is appropriate, and the rest of the changes are straightforward removals.

.github/workflows/notify-parent.yml — specifically the short_sha field value on line 23.

Important Files Changed

Filename Overview
.github/workflows/notify-parent.yml Simplifies notify-parent workflow to a single dispatch step — but short_sha field is populated with the full 40-char github.sha rather than an abbreviated SHA, breaking the field's naming contract with the parent consumer.

Sequence Diagram

sequenceDiagram
    participant GH as GitHub (push to main)
    participant WF as notify-parent.yml
    participant PAT as PARENT_REPO_PAT secret
    participant META as harmony-labs/meta

    GH->>WF: push event (branch: main)
    WF->>PAT: authenticate
    WF->>META: repository_dispatch<br/>event-type: child-repo-updated<br/>payload: { repo_name, short_sha*, actor }
    META-->>META: triggers release-please workflow
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: .github/workflows/notify-parent.yml
Line: 23

Comment:
**`short_sha` receives full 40-char SHA, not short form**

`github.sha` is always the full 40-character commit SHA. The field is named `short_sha` (matching the old payload contract where `git rev-parse --short HEAD` produced a 7-char SHA), but the value here is the complete hash. If the consumer in `harmony-labs/meta#62` reads `short_sha` expecting the abbreviated form — e.g. for display, tagging, or string matching — it will receive the full SHA instead.

Either rename the field to `sha` to match what is actually being sent, or derive the short SHA from the first 7 characters (requires a run step since GitHub Actions context doesn't expose a short-SHA variable directly):

```suggestion
              "sha": "${{ github.sha }}",
```

Or, if the short form is required, add a step before `Notify parent repo`:

```yaml
- name: Get short SHA
  id: vars
  run: echo "short_sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
```

and reference `${{ steps.vars.outputs.short_sha }}` in the payload.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: .github/workflows/notify-parent.yml
Line: 11-12

Comment:
**Unused `checkout` step**

`actions/checkout@v4` is no longer needed in this simplified workflow — no subsequent step reads files from the repository. Removing it would shave a few seconds off every run and reduce unnecessary token usage.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "chore: restore notify-parent workflow (s..." | Re-trigger Greptile

Comment thread .github/workflows/notify-parent.yml Outdated
"type": ${{ toJSON(steps.source.outputs.type) }},
"actor": ${{ toJSON(steps.source.outputs.actor) }}
"repo_name": ${{ toJSON(github.event.repository.name) }},
"short_sha": "${{ github.sha }}",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 short_sha receives full 40-char SHA, not short form

github.sha is always the full 40-character commit SHA. The field is named short_sha (matching the old payload contract where git rev-parse --short HEAD produced a 7-char SHA), but the value here is the complete hash. If the consumer in harmony-labs/meta#62 reads short_sha expecting the abbreviated form — e.g. for display, tagging, or string matching — it will receive the full SHA instead.

Either rename the field to sha to match what is actually being sent, or derive the short SHA from the first 7 characters (requires a run step since GitHub Actions context doesn't expose a short-SHA variable directly):

Suggested change
"short_sha": "${{ github.sha }}",
"sha": "${{ github.sha }}",

Or, if the short form is required, add a step before Notify parent repo:

- name: Get short SHA
  id: vars
  run: echo "short_sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"

and reference ${{ steps.vars.outputs.short_sha }} in the payload.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/notify-parent.yml
Line: 23

Comment:
**`short_sha` receives full 40-char SHA, not short form**

`github.sha` is always the full 40-character commit SHA. The field is named `short_sha` (matching the old payload contract where `git rev-parse --short HEAD` produced a 7-char SHA), but the value here is the complete hash. If the consumer in `harmony-labs/meta#62` reads `short_sha` expecting the abbreviated form — e.g. for display, tagging, or string matching — it will receive the full SHA instead.

Either rename the field to `sha` to match what is actually being sent, or derive the short SHA from the first 7 characters (requires a run step since GitHub Actions context doesn't expose a short-SHA variable directly):

```suggestion
              "sha": "${{ github.sha }}",
```

Or, if the short form is required, add a step before `Notify parent repo`:

```yaml
- name: Get short SHA
  id: vars
  run: echo "short_sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
```

and reference `${{ steps.vars.outputs.short_sha }}` in the payload.

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 6dc986b.

Comment thread .github/workflows/notify-parent.yml Outdated
Comment on lines 11 to 12
- name: Checkout
uses: actions/checkout@v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Unused checkout step

actions/checkout@v4 is no longer needed in this simplified workflow — no subsequent step reads files from the repository. Removing it would shave a few seconds off every run and reduce unnecessary token usage.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/notify-parent.yml
Line: 11-12

Comment:
**Unused `checkout` step**

`actions/checkout@v4` is no longer needed in this simplified workflow — no subsequent step reads files from the repository. Removing it would shave a few seconds off every run and reduce unnecessary token usage.

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 6dc986b.

@mateodelnorte
mateodelnorte force-pushed the fix/restore-notify-parent branch from dd1cd6a to 6dc986b Compare March 26, 2026 12:37

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

🤖 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 8-16: Remove the now-orphaned repository_dispatch trigger for
event type "dependency-updated" from the ci.yml workflow: locate the
repository_dispatch section that lists dependency-updated and delete that
trigger (or replace it with the correct event if intended), ensuring only the
active push/child-repo-updated flow remains; reference symbols to modify are the
repository_dispatch trigger and the event type "dependency-updated" in the
ci.yml workflow.
- Around line 19-21: The payload field "short_sha" currently contains the full
40-char commit from github.sha; either rename the field to "sha" to reflect the
full SHA (update the JSON key "short_sha" -> "sha") or compute a true short SHA
before building the client-payload (add a step that writes
short_sha=${GITHUB_SHA::7} to GITHUB_OUTPUT, reference it as
steps.vars.outputs.short_sha in the client-payload), and ensure the
client-payload uses the chosen field consistently (update occurrences of
"short_sha" or add "sha" accordingly).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 142dad3d-b3a5-4d31-aeb1-19640ac8aa6f

📥 Commits

Reviewing files that changed from the base of the PR and between 7521073 and 6dc986b.

📒 Files selected for processing (1)
  • .github/workflows/notify-parent.yml

Comment on lines +8 to 16
notify:
runs-on: ubuntu-latest
steps:
- name: Wait for CI
uses: lewagon/wait-on-check-action@v1.5.0
with:
ref: ${{ github.sha }}
check-name: 'Test (ubuntu-latest)'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10

notify-parent:
needs: wait-for-ci
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Determine source
id: source
env:
EVENT_NAME: ${{ github.event_name }}
PAYLOAD_REPO: ${{ github.event.client_payload.repo }}
PAYLOAD_REPO_NAME: ${{ github.event.client_payload.repo_name }}
PAYLOAD_SHA: ${{ github.event.client_payload.sha }}
PAYLOAD_SHORT_SHA: ${{ github.event.client_payload.short_sha }}
PAYLOAD_MESSAGE: ${{ github.event.client_payload.message }}
PAYLOAD_TYPE: ${{ github.event.client_payload.type }}
PAYLOAD_ACTOR: ${{ github.event.client_payload.actor }}
GH_REPOSITORY: ${{ github.repository }}
GH_REPO_NAME: ${{ github.event.repository.name }}
GH_ACTOR: ${{ github.actor }}
run: |
write_output() {
local key="$1" value="$2"
local delim="__EOF__$(date +%s%N)_$RANDOM"
{
printf '%s<<%s\n' "$key" "$delim"
printf '%s\n' "$value"
printf '%s\n' "$delim"
} >> "$GITHUB_OUTPUT"
}

if [ "$EVENT_NAME" = "repository_dispatch" ]; then
write_output repo "$PAYLOAD_REPO"
write_output repo_name "$PAYLOAD_REPO_NAME"
write_output sha "$PAYLOAD_SHA"
write_output short_sha "$PAYLOAD_SHORT_SHA"
write_output message "$PAYLOAD_MESSAGE"
write_output type "$PAYLOAD_TYPE"
write_output actor "$PAYLOAD_ACTOR"
else
MSG=$(git log -1 --pretty=%s)
write_output message "$MSG"
write_output repo "$GH_REPOSITORY"
write_output repo_name "$GH_REPO_NAME"
write_output actor "$GH_ACTOR"
write_output sha "$(git rev-parse HEAD)"
write_output short_sha "$(git rev-parse --short HEAD)"
re_feat='^feat[:(]'; re_fix='^fix[:(]'; re_chore='^chore[:(]'
re_docs='^docs[:(]'; re_test='^test[:(]'; re_refactor='^refactor[:(]'
if [[ "$MSG" =~ $re_feat ]]; then write_output type "feat"
elif [[ "$MSG" =~ $re_fix ]]; then write_output type "fix"
elif [[ "$MSG" =~ $re_chore ]]; then write_output type "chore"
elif [[ "$MSG" =~ $re_docs ]]; then write_output type "docs"
elif [[ "$MSG" =~ $re_test ]]; then write_output type "test"
elif [[ "$MSG" =~ $re_refactor ]]; then write_output type "refactor"
else write_output type "other"
fi
fi

- name: Notify parent repo
uses: peter-evans/repository-dispatch@v3
uses: peter-evans/repository-dispatch@v4
with:
token: ${{ secrets.PARENT_REPO_PAT }}
repository: harmony-labs/meta
event-type: child-repo-updated

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

Consider removing the orphaned repository_dispatch trigger in ci.yml.

According to the context, .github/workflows/ci.yml still declares a repository_dispatch trigger for event type dependency-updated (lines 8-9). With this workflow simplified to only push-trigger and dispatch child-repo-updated, nothing will fire that dependency-updated event anymore, leaving dead configuration in ci.yml.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/notify-parent.yml around lines 8 - 16, Remove the
now-orphaned repository_dispatch trigger for event type "dependency-updated"
from the ci.yml workflow: locate the repository_dispatch section that lists
dependency-updated and delete that trigger (or replace it with the correct event
if intended), ensuring only the active push/child-repo-updated flow remains;
reference symbols to modify are the repository_dispatch trigger and the event
type "dependency-updated" in the ci.yml workflow.

Comment on lines +19 to +21
"repo_name": ${{ toJSON(github.event.repository.name) }},
"short_sha": ${{ toJSON(github.sha) }},
"actor": ${{ toJSON(github.actor) }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Field short_sha contains the full SHA, not a short SHA.

github.sha returns the full 40-character commit SHA. If the parent workflow expects a short SHA (e.g., 7 characters), this will be inconsistent. Either rename the field to sha to accurately reflect its content, or add a step to compute the actual short SHA.

Option 1: Rename field to match content
            {
              "repo_name": ${{ toJSON(github.event.repository.name) }},
-             "short_sha": ${{ toJSON(github.sha) }},
+             "sha": ${{ toJSON(github.sha) }},
              "actor": ${{ toJSON(github.actor) }}
            }
Option 2: Compute actual short SHA
    steps:
      - name: Compute short SHA
        id: vars
        run: echo "short_sha=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
      - name: Notify parent repo
        uses: peter-evans/repository-dispatch@v4
        with:
          token: ${{ secrets.PARENT_REPO_PAT }}
          repository: harmony-labs/meta
          event-type: child-repo-updated
          client-payload: >-
            {
              "repo_name": ${{ toJSON(github.event.repository.name) }},
              "short_sha": ${{ toJSON(steps.vars.outputs.short_sha) }},
              "actor": ${{ toJSON(github.actor) }}
            }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"repo_name": ${{ toJSON(github.event.repository.name) }},
"short_sha": ${{ toJSON(github.sha) }},
"actor": ${{ toJSON(github.actor) }}
"repo_name": ${{ toJSON(github.event.repository.name) }},
"sha": ${{ toJSON(github.sha) }},
"actor": ${{ toJSON(github.actor) }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/notify-parent.yml around lines 19 - 21, The payload field
"short_sha" currently contains the full 40-char commit from github.sha; either
rename the field to "sha" to reflect the full SHA (update the JSON key
"short_sha" -> "sha") or compute a true short SHA before building the
client-payload (add a step that writes short_sha=${GITHUB_SHA::7} to
GITHUB_OUTPUT, reference it as steps.vars.outputs.short_sha in the
client-payload), and ensure the client-payload uses the chosen field
consistently (update occurrences of "short_sha" or add "sha" accordingly).

Re-adds notify-parent.yml to trigger parent meta repo's release-please
when this child repo merges to main. Simplified: no checkout needed,
all payload fields properly quoted with toJSON.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mateodelnorte
mateodelnorte force-pushed the fix/restore-notify-parent branch from 6dc986b to 3c3d9b2 Compare March 26, 2026 12:45
@mateodelnorte
mateodelnorte deleted the fix/restore-notify-parent branch March 26, 2026 12:48
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