Skip to content

Conversation

@GabrielDrapor
Copy link
Contributor

@GabrielDrapor GabrielDrapor commented Aug 15, 2025

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

flowchart LR
  A["workflow_dispatch"] --> C["generate-manifest job"]
  B["repository_dispatch"] --> C
  C --> D["Extract repo_url from inputs or payload"]
  D --> E["Generate manifest and create PR"]
Loading

File Walkthrough

Relevant files
Enhancement
generate-manifest.yml
Add repository_dispatch trigger and dual input support     

.github/workflows/generate-manifest.yml

  • Add repository_dispatch trigger with generate-manifest event type
  • Update repo_url extraction to support both
    github.event.inputs.repo_url and github.event.client_payload.repo_url
  • Modify all references to use fallback logic for repo_url parameter
+7/-4     

Summary by CodeRabbit

  • New Features

    • Manifest generation can be triggered externally via repository_dispatch.
    • Workflow accepts a repository URL from multiple sources for greater flexibility.
    • Pull request titles and bodies now reflect the resolved repository URL.
  • Chores

    • Standardized URL fallback logic across workflow steps to improve reliability.
    • PR creation now uses a personal access token and includes Co‑Authored‑By metadata.

@coderabbitai
Copy link

coderabbitai bot commented Aug 15, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds 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

Cohort / File(s) Summary of changes
Workflow trigger & inputs handling
.github/workflows/generate-manifest.yml
- Add repository_dispatch trigger (type: generate-manifest).
- Resolve REPO_URL as `github.event.inputs.repo_url

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

Possible security concern

Poem

I’m a rabbit with a tiny pen, I hop to trigger builds again.
From inputs or a client payload I trace,
A URL that finds its rightful place.
Co-authors noted, tokens set—hip-hop hooray! 🐇✨

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8db9db4 and 743e62b.

📒 Files selected for processing (1)
  • .github/workflows/generate-manifest.yml (3 hunks)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Jiarui/smart-registry-workflow

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@qodo-merge-pro
Copy link
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Possible Syntax Issue

The expression ${{ github.event.inputs.repo_url || github.event.client_payload.repo_url }} uses ||, which is not valid in GitHub Actions expression syntax. Fallbacks typically use || only within JavaScript contexts, not in workflow expressions. Consider using || inside a single expression with defaulting via || is unsupported; instead use coalesce-like patterns or conditional steps/env with if and format functions.

REPO_URL="${{ github.event.inputs.repo_url || github.event.client_payload.repo_url }}"
python scripts/get_manifest.py "$REPO_URL"
Undefined Var in Shell

In the "Extract repo name for branch" step, REPO_URL is referenced to derive REPO_NAME but is only set on that line using the same potentially invalid expression. If the expression fails or resolves to empty, REPO_URL will be empty and parsing will produce incorrect names. Consider setting a single env variable for REPO_URL earlier and reuse it.

REPO_URL="${{ github.event.inputs.repo_url || github.event.client_payload.repo_url }}"
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_OUTPUT
Missing Validation

No validation that REPO_URL exists for repository_dispatch events. If the payload lacks client_payload.repo_url, subsequent commands will fail. Add a guard to exit with a clear message when REPO_URL is empty.

    REPO_URL="${{ github.event.inputs.repo_url || github.event.client_payload.repo_url }}"
    python scripts/get_manifest.py "$REPO_URL"

- name: Extract repo name for branch
  id: repo-info
  run: |
    REPO_URL="${{ github.event.inputs.repo_url || github.event.client_payload.repo_url }}"
    REPO_NAME=$(echo "$REPO_URL" | sed 's/.*github\.com[:/]//' | sed 's/\.git$//' | tr '/' '-')
    echo "repo_name=$REPO_NAME" >> $GITHUB_OUTPUT

@qodo-merge-pro
Copy link
Contributor

qodo-merge-pro bot commented Aug 15, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Validate required input presence

If the fallback expression fails, 'REPO_URL' may be empty, producing an empty
branch name and invalid PR. Add a guard to fail fast with a clear error when no
URL is provided.

.github/workflows/generate-manifest.yml [46-49]

 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." >&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_OUTPUT
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: This suggestion correctly identifies that the repository_dispatch trigger does not enforce input presence, and adds a useful check to fail gracefully if the URL is missing.

Medium
  • Update

Copy link

@coderabbitai coderabbitai bot left a 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_OUTPUT

Optional 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_OUTPUT

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8915d2c and 8db9db4.

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

@github-actions
Copy link
Contributor

Summary

The workflow now supports both manual (workflow_dispatch) and external (repository_dispatch) triggers for generating MCP manifests, using a fallback expression to pull repo_url from either inputs or client_payload.

Review

Looks good—adds flexible triggering with minimal changes. A few small notes:

  • ${{ github.event.inputs.repo_url || github.event.client_payload.repo_url }} works, but consider defining a single env variable at the job level to avoid repetition.
  • For repository_dispatch, github.event.inputs is null; the || guard handles this, yet dropping the first term in purely dispatch-specific steps would be slightly clearer.
  • No other files touched; CI impact should be negligible.

Nice quality-of-life improvement!


View workflow run

@GabrielDrapor GabrielDrapor merged commit 12b8341 into main Aug 18, 2025
7 of 8 checks passed
@GabrielDrapor GabrielDrapor deleted the Jiarui/smart-registry-workflow branch August 18, 2025 03:36
@mcpm-semantic-release
Copy link

🎉 This PR is included in version 2.7.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants