-
Notifications
You must be signed in to change notification settings - Fork 87
[generate-manifest] add repository_dispatch Trigger #234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughAdds a repository_dispatch trigger to the generate-manifest workflow and updates REPO_URL sourcing to prefer github.event.inputs.repo_url or fallback to github.event.client_payload.repo_url across steps and PR metadata; PR creation now uses MCPM_PERSONAL_ACCESS_TOKEN and includes Co-Authored-By metadata. Changes
Sequence Diagram(s)sequenceDiagram
actor ExternalSystem as External System
participant GitHub as GitHub
participant Workflow as generate-manifest workflow
participant Script as scripts/get_manifest.py
participant PR as Pull Request
ExternalSystem->>GitHub: repository_dispatch (type=generate-manifest, client_payload.repo_url)
GitHub-->>Workflow: trigger workflow
Workflow->>Workflow: resolve REPO_URL = inputs.repo_url || client_payload.repo_url
Workflow->>Script: run get_manifest.py (env REPO_URL)
Workflow->>Workflow: extract repo name from REPO_URL
Workflow->>PR: create/update PR using MCPM_PERSONAL_ACCESS_TOKEN with commit/body referencing REPO_URL
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
.github/workflows/generate-manifest.yml (4)
40-41: Add a guard for missing repo_url to prevent silent failures and confusing runs.If repository_dispatch is sent without client_payload.repo_url (or with an empty string), REPO_URL becomes empty. The Python script will then receive an empty argument and fail later, and subsequent steps may derive empty repo/branch names. Fail fast with a clear error.
Apply this diff to hard-fail when REPO_URL is not provided:
- REPO_URL="${{ github.event.inputs.repo_url || github.event.client_payload.repo_url }}" - python scripts/get_manifest.py "$REPO_URL" + REPO_URL="${{ github.event.inputs.repo_url || github.event.client_payload.repo_url }}" + if [ -z "$REPO_URL" ]; then + echo "ERROR: repo_url not provided via workflow_dispatch input or repository_dispatch.client_payload.repo_url" >&2 + exit 1 + fi + python scripts/get_manifest.py "$REPO_URL"
46-46: Guard the repo name extraction against empty REPO_URL.Without a payload, this step will compute an empty repo/branch name (e.g., add-manifest-), which can produce confusing PRs or branch collisions.
Apply this diff to validate before processing:
- REPO_URL="${{ github.event.inputs.repo_url || github.event.client_payload.repo_url }}" + REPO_URL="${{ github.event.inputs.repo_url || github.event.client_payload.repo_url }}" + if [ -z "$REPO_URL" ]; then + echo "ERROR: REPO_URL is empty; cannot derive repo name for branch" >&2 + exit 1 + fi REPO_NAME=$(echo "$REPO_URL" | sed 's/.*github\.com[:/]//' | sed 's/\.git$//' | tr '/' '-') echo "repo_name=$REPO_NAME" >> $GITHUB_OUTPUT echo "branch_name=add-manifest-$REPO_NAME" >> $GITHUB_OUTPUTOptional consolidation: consider emitting the resolved repo_url as an output here to reuse it across later steps (see next comments):
echo "repo_url=$REPO_URL" >> $GITHUB_OUTPUT
58-58: Reference a single resolved repo_url output to avoid repeated expressions and potential empties.Use the value already resolved in the “Extract repo name for branch” step to keep commit messages consistent and avoid an empty string if the payload is missing.
First, add this line to the “Extract repo name for branch” step (near Line 49) so it exposes repo_url:
echo "repo_url=$REPO_URL" >> $GITHUB_OUTPUTThen update this line as follows:
- Generated manifest JSON for repository: ${{ github.event.inputs.repo_url || github.event.client_payload.repo_url }} + Generated manifest JSON for repository: ${{ steps.repo-info.outputs.repo_url }}
67-67: Reuse the resolved repo_url in the PR body for consistency and maintainability.Same rationale as commit message: avoid duplicating the fallback expression and risking an empty value.
Apply this diff:
- This PR adds a new MCP server manifest generated from the repository: ${{ github.event.inputs.repo_url || github.event.client_payload.repo_url }} + This PR adds a new MCP server manifest generated from the repository: ${{ steps.repo-info.outputs.repo_url }}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.github/workflows/generate-manifest.yml(4 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
.github/workflows/generate-manifest.yml (1)
scripts/get_manifest.py (1)
main(196-219)
🔇 Additional comments (1)
.github/workflows/generate-manifest.yml (1)
10-11: Good addition: repository_dispatch trigger is correctly scoped to a custom type.Declaring types: [generate-manifest] keeps the surface area narrow and predictable.
|
Summary The workflow now supports both manual ( Review Looks good—adds flexible triggering with minimal changes. A few small notes:
Nice quality-of-life improvement! |
|
🎉 This PR is included in version 2.7.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
PR Type
Enhancement
Description
Add repository_dispatch trigger to generate-manifest workflow
Support external API calls for manifest generation
Update repo_url handling for both trigger types
Diagram Walkthrough
File Walkthrough
generate-manifest.yml
Add repository_dispatch trigger and dual input support.github/workflows/generate-manifest.yml
repository_dispatchtrigger withgenerate-manifestevent typegithub.event.inputs.repo_urlandgithub.event.client_payload.repo_urlSummary by CodeRabbit
New Features
Chores