diff --git a/.github/workflows/update-config-schema.yml b/.github/workflows/update-config-schema.yml index e5d0509f4..ed66ea209 100644 --- a/.github/workflows/update-config-schema.yml +++ b/.github/workflows/update-config-schema.yml @@ -1,10 +1,10 @@ name: Update MCPServerConfig Schema -# Regenerates config schema on PRs and commits it back to the branch, -# so the PR is self-contained and main is correct after merge. +# Regenerates config schema on pushes to main and opens a long-lived PR +# with the changes, so contributor PRs stay clean. on: - pull_request: + push: branches: ["main"] paths: - "src/fastmcp/utilities/mcp_server_config/**" @@ -13,14 +13,12 @@ on: permissions: contents: write + pull-requests: write jobs: update-config-schema: timeout-minutes: 5 runs-on: ubuntu-latest - if: >- - github.event_name == 'workflow_dispatch' || - github.event.pull_request.head.repo.full_name == github.repository steps: - name: Generate Marvin App token @@ -32,7 +30,6 @@ jobs: - uses: actions/checkout@v6 with: - ref: ${{ github.head_ref || github.ref }} token: ${{ steps.marvin-token.outputs.token }} - name: Install uv @@ -53,15 +50,23 @@ jobs: generate_schema('src/fastmcp/utilities/mcp_server_config/v1/schema.json') " - - name: Commit and push if changed - run: | - git config user.name "marvin-context-protocol[bot]" - git config user.email "225465937+marvin-context-protocol[bot]@users.noreply.github.com" - git add docs/public/schemas/ src/fastmcp/utilities/mcp_server_config/v1/schema.json - if git diff --cached --quiet; then - echo "Config schema is up to date" - else - git commit -m "chore: Update fastmcp.json schema" - git push - echo "Config schema updated and pushed" - fi + - name: Create Pull Request + uses: peter-evans/create-pull-request@v8 + with: + token: ${{ steps.marvin-token.outputs.token }} + commit-message: "chore: Update fastmcp.json schema" + title: "chore: Update fastmcp.json schema" + body: | + This PR updates the fastmcp.json schema files to match the current source code. + + The schema is automatically generated from `src/fastmcp/utilities/mcp_server_config/` to ensure consistency. + + **Note:** This PR is fully automated and will update itself with any subsequent changes to the schema, or close automatically if the schema becomes up-to-date through other means. + + 🤖 Generated by Marvin + branch: marvin/update-config-schema + labels: | + ignore in release notes + delete-branch: true + author: "marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>" + committer: "marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>" diff --git a/.github/workflows/update-sdk-docs.yml b/.github/workflows/update-sdk-docs.yml index 122f6ddfc..6ca5eb61d 100644 --- a/.github/workflows/update-sdk-docs.yml +++ b/.github/workflows/update-sdk-docs.yml @@ -1,10 +1,10 @@ name: Update SDK Documentation -# Regenerates SDK docs on PRs and commits them back to the branch, -# so the PR is self-contained and main is correct after merge. +# Regenerates SDK docs on pushes to main and opens a long-lived PR +# with the changes, so contributor PRs stay clean. on: - pull_request: + push: branches: ["main"] paths: - "src/**" @@ -13,14 +13,12 @@ on: permissions: contents: write + pull-requests: write jobs: update-sdk-docs: timeout-minutes: 5 runs-on: ubuntu-latest - if: >- - github.event_name == 'workflow_dispatch' || - github.event.pull_request.head.repo.full_name == github.repository steps: - name: Generate Marvin App token @@ -32,7 +30,6 @@ jobs: - uses: actions/checkout@v6 with: - ref: ${{ github.head_ref || github.ref }} token: ${{ steps.marvin-token.outputs.token }} - name: Install uv @@ -50,15 +47,23 @@ jobs: - name: Generate SDK documentation run: just api-ref-all - - name: Commit and push if changed - run: | - git config user.name "marvin-context-protocol[bot]" - git config user.email "225465937+marvin-context-protocol[bot]@users.noreply.github.com" - git add docs/python-sdk/ - if git diff --cached --quiet; then - echo "SDK documentation is up to date" - else - git commit -m "chore: Update SDK documentation" - git push - echo "SDK documentation updated and pushed" - fi + - name: Create Pull Request + uses: peter-evans/create-pull-request@v8 + with: + token: ${{ steps.marvin-token.outputs.token }} + commit-message: "chore: Update SDK documentation" + title: "chore: Update SDK documentation" + body: | + This PR updates the auto-generated SDK documentation to reflect the latest source code changes. + + 📚 Documentation is automatically generated from the source code docstrings and type annotations. + + **Note:** This PR is fully automated and will update itself with any subsequent changes to the SDK, or close automatically if the documentation becomes up-to-date through other means. Feel free to leave it open until you're ready to merge. + + 🤖 Generated by Marvin + branch: marvin/update-sdk-docs + labels: | + ignore in release notes + delete-branch: true + author: "marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>" + committer: "marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>" diff --git a/AGENTS.md b/AGENTS.md index b34e83e23..bed11163a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -96,7 +96,8 @@ When modifying MCP functionality, changes typically need to be applied across al - Uses Mintlify framework - Files must be in docs.json to be included -- Do not manually modify `docs/python-sdk/**` — a bot automatically updates these files via commits added to PRs. Changes to these files in PR diffs are expected and should not be flagged during review. +- Do not manually modify `docs/python-sdk/**` — these files are auto-generated from source code by a bot and maintained via a long-lived PR. Do not include changes to these files in contributor PRs. +- Do not manually modify `docs/public/schemas/**` or `src/fastmcp/utilities/mcp_server_config/v1/schema.json` — these are auto-generated and maintained via a long-lived PR. - **Core Principle:** A feature doesn't exist unless it is documented! ### Documentation Guidelines