Initial project structure for MCP interceptors (#3)
Establishes a multi-language monorepo structure for MCP interceptors with Python and TypeScript SDKs alongside the existing Go implementation. Implements an efficient CI/CD system that only tests what changes. #### 🏗️ SDK Scaffolding - **Python SDK** (`python/sdk/`): Modern Python package using `pyproject.toml`, aligned with official MCP Python SDK patterns - **TypeScript SDK** (`typescript/sdk/`): ESM-based package structure, compatible with official MCP TypeScript SDK - **Monorepo structure**: Consistent `{language}/sdk/` pattern across all implementations #### 🚀 CI/CD Pipeline - **Path-based workflow triggering**: Only runs CI for languages that actually changed - Change Python → only Python CI runs - Change multiple languages → only those CIs run - **Status check workflow**: Single required check that dynamically validates based on changes - **Comment triggers**: Maintainers can run all checks with `/test all` PR comment
This commit is contained in:
parent
dd925ba134
commit
20974b6fa0
1 changed files with 900 additions and 3 deletions
90
.github/workflows/comment-trigger.yml
vendored
Normal file
90
.github/workflows/comment-trigger.yml
vendored
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
name: Comment Trigger
|
||||
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
actions: write
|
||||
|
||||
jobs:
|
||||
trigger-checks:
|
||||
name: Trigger Checks from Comment
|
||||
if: |
|
||||
github.event.issue.pull_request &&
|
||||
(github.event.comment.body == '/test all' ||
|
||||
github.event.comment.body == '/test-all' ||
|
||||
github.event.comment.body == '/run-all-checks') &&
|
||||
(github.event.comment.author_association == 'OWNER' ||
|
||||
github.event.comment.author_association == 'MEMBER' ||
|
||||
github.event.comment.author_association == 'COLLABORATOR')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get PR branch
|
||||
uses: actions/github-script@v7
|
||||
id: get-pr
|
||||
with:
|
||||
script: |
|
||||
const pr = await github.rest.pulls.get({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: context.issue.number
|
||||
});
|
||||
return pr.data.head.ref;
|
||||
|
||||
- name: Add reaction to comment
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
await github.rest.reactions.createForIssueComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
comment_id: context.payload.comment.id,
|
||||
content: 'rocket'
|
||||
});
|
||||
|
||||
- name: Trigger Python CI
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
await github.rest.actions.createWorkflowDispatch({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
workflow_id: 'python.yml',
|
||||
ref: '${{ fromJSON(steps.get-pr.outputs.result) }}'
|
||||
});
|
||||
|
||||
- name: Trigger Go CI
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
await github.rest.actions.createWorkflowDispatch({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
workflow_id: 'go.yml',
|
||||
ref: '${{ fromJSON(steps.get-pr.outputs.result) }}'
|
||||
});
|
||||
|
||||
- name: Trigger TypeScript CI
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
await github.rest.actions.createWorkflowDispatch({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
workflow_id: 'typescript.yml',
|
||||
ref: '${{ fromJSON(steps.get-pr.outputs.result) }}'
|
||||
});
|
||||
|
||||
- name: Comment on PR
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number,
|
||||
body: '🚀 All CI checks triggered! Check the Actions tab for progress.'
|
||||
});
|
||||
Loading…
Reference in a new issue