chore: restore notify-parent workflow (simplified) - #10
mateodelnorte wants to merge 37 commits into
Conversation
…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>
- 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>
WalkthroughThis PR simplifies a GitHub workflow by removing the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
Comment |
Greptile SummaryThis PR restores a simplified Confidence Score: 4/5Safe 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.
|
| 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
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
| "type": ${{ toJSON(steps.source.outputs.type) }}, | ||
| "actor": ${{ toJSON(steps.source.outputs.actor) }} | ||
| "repo_name": ${{ toJSON(github.event.repository.name) }}, | ||
| "short_sha": "${{ github.sha }}", |
There was a problem hiding this 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):
| "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.| - name: Checkout | ||
| uses: actions/checkout@v4 |
There was a problem hiding this comment.
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.dd1cd6a to
6dc986b
Compare
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
.github/workflows/notify-parent.yml
| 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 |
There was a problem hiding this comment.
🧹 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.
| "repo_name": ${{ toJSON(github.event.repository.name) }}, | ||
| "short_sha": ${{ toJSON(github.sha) }}, | ||
| "actor": ${{ toJSON(github.actor) }} |
There was a problem hiding this comment.
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.
| "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>
6dc986b to
3c3d9b2
Compare
Re-adds
notify-parent.ymlto 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