chore: restore notify-parent workflow (simplified) - #12
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughAdds a new GitHub Actions workflow that triggers on pushes to the Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Dev (push)
participant Actions as GitHub Actions
participant Parent as Parent Repo (harmony-labs/meta)
rect rgba(135,206,235,0.5)
Dev->>Actions: push to main
Actions->>Actions: run notify job\nprepare client-payload
Actions->>Parent: repository_dispatch\nevent-type: child-repo-updated\nclient-payload: {repo, sha, actor}
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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)
Comment |
Greptile SummaryThis PR re-introduces a simplified Confidence Score: 4/5Safe to merge once the The workflow is simple and the dispatch wiring is correct. The only substantive issue is a naming/value mismatch (
|
| Filename | Overview |
|---|---|
| .github/workflows/notify-parent.yml | New workflow dispatching a child-repo-updated event to harmony-labs/meta on every push to main; contains a misleading short_sha field that actually holds the full 40-char SHA, and an unnecessary checkout step. |
Sequence Diagram
sequenceDiagram
participant Push as Push to main (meta_project_cli)
participant GHA as GitHub Actions notify-parent.yml
participant Dispatch as peter-evans/repository-dispatch
participant Meta as harmony-labs/meta
Push->>GHA: Trigger on push to main
GHA->>Dispatch: POST with PARENT_REPO_PAT
Note over Dispatch: event-type: child-repo-updated<br/>payload: repo_name, short_sha (full SHA!), actor
Dispatch->>Meta: repository_dispatch event
Meta->>Meta: Trigger 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` field contains the full SHA**
`${{ github.sha }}` expands to the full 40-character commit SHA (e.g. `5c32e6154464259bb304b2eced542cc5b8f051f3`), not a short one. If the receiving workflow in `harmony-labs/meta` parses `short_sha` expecting a 7–8 character abbreviated hash (for display, linking, or git operations) it will silently receive the wrong format.
Either rename the field to `sha` to accurately reflect its content, or truncate the value to produce a proper short SHA. For a true short SHA you would need a preceding `run` step:
```yaml
- name: Set short SHA
id: vars
run: echo "short_sha=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
```
and then reference `${{ steps.vars.outputs.short_sha }}` in the payload. Alternatively, simply rename the key to `sha` if the parent workflow is being updated in parallel (harmony-labs/meta#62) and can accept the full SHA.
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:
**Unnecessary `checkout` step**
The only action this job performs is dispatching a repository event via `peter-evans/repository-dispatch`. No repository files are read or written, so checking out the source tree adds latency with no benefit. The entire `Checkout` step (lines 11–12) can be removed to keep the job lean.
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
| client-payload: >- | ||
| { | ||
| "repo_name": ${{ toJSON(github.event.repository.name) }}, | ||
| "short_sha": "${{ github.sha }}", |
There was a problem hiding this comment.
short_sha field contains the full SHA
${{ github.sha }} expands to the full 40-character commit SHA (e.g. 5c32e6154464259bb304b2eced542cc5b8f051f3), not a short one. If the receiving workflow in harmony-labs/meta parses short_sha expecting a 7–8 character abbreviated hash (for display, linking, or git operations) it will silently receive the wrong format.
Either rename the field to sha to accurately reflect its content, or truncate the value to produce a proper short SHA. For a true short SHA you would need a preceding run step:
- name: Set short SHA
id: vars
run: echo "short_sha=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"and then reference ${{ steps.vars.outputs.short_sha }} in the payload. Alternatively, simply rename the key to sha if the parent workflow is being updated in parallel (gitkb/meta#62) and can accept the full SHA.
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` field contains the full SHA**
`${{ github.sha }}` expands to the full 40-character commit SHA (e.g. `5c32e6154464259bb304b2eced542cc5b8f051f3`), not a short one. If the receiving workflow in `harmony-labs/meta` parses `short_sha` expecting a 7–8 character abbreviated hash (for display, linking, or git operations) it will silently receive the wrong format.
Either rename the field to `sha` to accurately reflect its content, or truncate the value to produce a proper short SHA. For a true short SHA you would need a preceding `run` step:
```yaml
- name: Set short SHA
id: vars
run: echo "short_sha=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
```
and then reference `${{ steps.vars.outputs.short_sha }}` in the payload. Alternatively, simply rename the key to `sha` if the parent workflow is being updated in parallel (harmony-labs/meta#62) and can accept the full SHA.
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Fixed — renamed short_sha to sha (sender sends full SHA, parent truncates to 7 chars), removed checkout step, added permissions: {} block.
| - name: Checkout | ||
| uses: actions/checkout@v4 |
There was a problem hiding this comment.
The only action this job performs is dispatching a repository event via peter-evans/repository-dispatch. No repository files are read or written, so checking out the source tree adds latency with no benefit. The entire Checkout step (lines 11–12) can be removed to keep the job lean.
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/notify-parent.yml
Line: 11-12
Comment:
**Unnecessary `checkout` step**
The only action this job performs is dispatching a repository event via `peter-evans/repository-dispatch`. No repository files are read or written, so checking out the source tree adds latency with no benefit. The entire `Checkout` step (lines 11–12) can be removed to keep the job lean.
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Fixed — renamed short_sha to sha (sender sends full SHA, parent truncates to 7 chars), removed checkout step, added permissions: {} block.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 14-25: The payload field "short_sha" currently contains the full
SHA via `${{ github.sha }}`; either rename the key to something like "full_sha"
to accurately reflect its value, or change the workflow to supply an actual
short SHA (e.g., run a checkout step and capture `git rev-parse --short HEAD`
into an output/env and use that value for the "short_sha" field). Update the
repository-dispatch step (the action using peter-evans/repository-dispatch and
the client-payload JSON) to use the chosen key/value so the parent repo receives
the correct identifier.
- Around line 11-12: Remove the unnecessary "Checkout" step (uses:
actions/checkout@v4) from the workflow: delete the entire step block named
"Checkout" and ensure no subsequent steps rely on repository files—confirm they
only reference GitHub context variables like github.event.repository.name,
github.sha, and github.actor; if any step does require the repo contents, either
restore checkout or adjust that step accordingly.
- Line 15: The payload field short_sha currently contains the full commit id
(github.sha); update the action invocation where
peter-evans/repository-dispatch@v4 is used to either truncate github.sha to a
short form (e.g., first 7 chars) before assigning it to short_sha or rename the
payload key to sha or full_sha so the name matches the full 40-char value;
ensure you change the payload key consistently and validate the parent repo
handler (harmony-labs/meta) expects the chosen field name/format.
🪄 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: 082561e6-0ae2-4b20-9ac9-25e1ec389b4c
📒 Files selected for processing (1)
.github/workflows/notify-parent.yml
481e6e3 to
e02e260
Compare
No checkout needed, proper toJSON quoting for all payload fields. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
e02e260 to
b66d690
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