Skip to content

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

Merged
mateodelnorte merged 1 commit into
mainfrom
fix/restore-notify-parent
Mar 26, 2026
Merged

mateodelnorte merged 1 commit 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
    • Added automation to notify the parent repository whenever changes are pushed to the main branch. The notification includes repository and commit metadata so the parent can track child-repo updates and react to new pushes.

@coderabbitai

coderabbitai Bot commented Mar 26, 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 30 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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 63687879-6385-4a73-9f45-e80e72bef519

📥 Commits

Reviewing files that changed from the base of the PR and between 481e6e3 and b66d690.

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

Walkthrough

Adds a new GitHub Actions workflow that triggers on pushes to the main branch and sends a repository_dispatch event (child-repo-updated) to the harmony-labs/meta repository with the child repo name, commit SHA, and actor in the JSON payload.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
​.github/workflows/notify-parent.yml
New workflow: triggers on push to main, runs a single job that invokes peter-evans/repository-dispatch@v4 using secrets.PARENT_REPO_PAT, sends event-type: child-repo-updated and client-payload including repository.name, github.sha, and github.actor.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 I hop on branches, light and cheery,
I tell parent repo when pushes get merry,
"Child updated!" I softly declare,
With SHA and actor fluttering in the air,
A tiny courier with ears full of flair 🥕✨

🚥 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 accurately summarizes the main change: restoring a GitHub Actions workflow file that notifies the parent repository, with a simplified implementation approach.
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

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 re-introduces a simplified notify-parent.yml workflow that fires a repository_dispatch event to harmony-labs/meta whenever a commit lands on main, enabling the parent repo's release-please pipeline to react to child-repo changes. The implementation is straightforward and the wiring looks correct overall, but there are two issues worth addressing before merge:\n\n- short_sha field holds the full SHA — ${{ github.sha }} is 40 characters, not a short hash. If the companion workflow in harmony-labs/meta (PR #62) reads this field expecting an abbreviated ref it will receive the wrong format. The field should be renamed to sha, or a preceding run step should truncate the value.\n- Unnecessary checkout step — no repository files are needed for a pure dispatch job; removing it speeds up the workflow slightly.

Confidence Score: 4/5

Safe to merge once the short_sha field name or value is corrected to match what the parent workflow expects.

The workflow is simple and the dispatch wiring is correct. The only substantive issue is a naming/value mismatch (short_sha carrying a full SHA) that could break downstream parsing in the parent repo — worth fixing before merge, but limited in blast radius since it only affects the parent's ability to interpret the payload. The unnecessary checkout is a trivial cleanup.

.github/workflows/notify-parent.yml — verify short_sha field against what harmony-labs/meta#62 actually consumes.

Important Files Changed

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
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` 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

Comment thread .github/workflows/notify-parent.yml Outdated
client-payload: >-
{
"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 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.

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 481e6e3.

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 — renamed short_sha to sha (sender sends full SHA, parent truncates to 7 chars), removed checkout step, added permissions: {} block.

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

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.

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 481e6e3.

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 — renamed short_sha to sha (sender sends full SHA, parent truncates to 7 chars), removed checkout step, added permissions: {} block.

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

📥 Commits

Reviewing files that changed from the base of the PR and between bf9ad34 and 5c32e61.

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

Comment thread .github/workflows/notify-parent.yml Outdated
Comment thread .github/workflows/notify-parent.yml
Comment thread .github/workflows/notify-parent.yml Outdated
@mateodelnorte
mateodelnorte force-pushed the fix/restore-notify-parent branch 2 times, most recently from 481e6e3 to e02e260 Compare March 26, 2026 13:01
No checkout needed, proper toJSON quoting for all payload fields.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mateodelnorte
mateodelnorte force-pushed the fix/restore-notify-parent branch from e02e260 to b66d690 Compare March 26, 2026 13:21
@mateodelnorte
mateodelnorte merged commit 14175f4 into main Mar 26, 2026
7 checks passed
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