Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/generate-toolkit-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ This workflow regenerates toolkit JSON and opens a PR with the changes. It can b

## What it does

1. Builds the toolkit docs generator.
2. Generates toolkit JSON in `toolkit-docs-generator/data/toolkits` using the Engine tool metadata and summary endpoints.
1. Type-checks and tests the toolkit docs generator.
2. Generates toolkit JSON in `toolkit-docs-generator/data/toolkits` using the Engine tool metadata endpoint.
3. Syncs integrations sidebar navigation from the generated JSON.
4. Creates or updates a PR on the stable `automation/toolkit-docs` branch if any files changed. Later runs overwrite that open PR with the latest generated docs.

Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/generate-toolkit-docs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Generate toolkit docs
# Description: Generate toolkit JSON from Engine API, then sync sidebar navigation.
# Flow:
# 1) Build the toolkit docs generator
# 1) Type-check and test the toolkit docs generator
# 2) Generate toolkit JSON into toolkit-docs-generator/data/toolkits
# 3) Sync integrations sidebar _meta.tsx from toolkit-docs-generator/data/toolkits
# 4) Create or update a PR if changes were produced
Expand All @@ -10,6 +10,11 @@ on:
repository_dispatch:
types: [porter_deploy_succeeded]
workflow_dispatch:
inputs:
pr_branch:
description: "Optional isolated branch for a verification PR"
required: false
type: string
# 11:00 UTC = 3 AM PST / 4 AM PDT — late enough that DST drift doesn't matter.
schedule:
- cron: "0 11 * * *"
Expand Down Expand Up @@ -48,9 +53,8 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build toolkit docs generator
run: pnpm build
working-directory: toolkit-docs-generator
- name: Validate toolkit docs generator
run: pnpm run toolkit-docs:check

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale gate blocks scheduled regen

Medium Severity

The new toolkit-docs:check step runs the full generator Vitest suite, including the committed-data stale-summaries test, before generate. If toolkit-docs-generator/data/toolkits on the checked-out ref already has summaryStale: true, validation fails and the workflow never runs generation—the same path that would refresh those summaries and open the auto PR.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 15bf213. Configure here.


- name: Generate toolkit docs
run: |
Expand Down Expand Up @@ -96,22 +100,24 @@ jobs:
with:
token: ${{ secrets.DOCS_PUBLISHABLE_GH_TOKEN }}
commit-message: "[AUTO] Adding MCP Servers docs update"
title: "[AUTO] Adding MCP Servers docs update"
title: ${{ inputs.pr_branch && '[TEST] Generated toolkit docs verification' || '[AUTO] Adding MCP Servers docs update' }}
body: |
This PR was generated after a Porter deploy succeeded.
This PR was generated by the toolkit docs workflow.

- Trigger: ${{ github.event_name }}
- Source ref: ${{ github.ref_name }}
- Deploy env: ${{ github.event.client_payload.env || 'unknown' }}
- Deploy SHA: ${{ github.event.client_payload.deploy_sha || 'unknown' }}
- Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
# Stable branch so later runs update the open auto-PR instead of
# opening a new one each time. create-pull-request force-pushes the
# latest generated docs onto this branch.
branch: automation/toolkit-docs
base: ${{ inputs.pr_branch && github.ref_name || github.event.repository.default_branch || 'main' }}
branch: ${{ inputs.pr_branch || 'automation/toolkit-docs' }}
delete-branch: true

- name: Request team review
if: steps.cpr.outputs.pull-request-number != ''
if: steps.cpr.outputs.pull-request-number != '' && (github.event_name != 'workflow_dispatch' || inputs.pr_branch == '')
continue-on-error: true
run: gh pr edit ${{ steps.cpr.outputs.pull-request-number }} --add-reviewer ArcadeAI/engineering-tools-and-dx
env:
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"lint": "pnpm exec ultracite check",
"format": "pnpm exec ultracite fix",
"prepare": "husky install",
"toolkit-docs:typecheck": "tsc --noEmit --project toolkit-docs-generator/tsconfig.json",
"toolkit-docs:test": "vitest run --root toolkit-docs-generator --config vitest.config.ts",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong Vitest config for generator

Medium Severity

The toolkit-docs:test script passes --config vitest.config.ts from the repo root, so Vitest loads the root config instead of toolkit-docs-generator/vitest.config.ts. The CI gate therefore skips that project’s test settings (including Vitest typechecking), while toolkit-docs:typecheck excludes **/*.test.ts.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 15bf213. Configure here.

"toolkit-docs:check": "pnpm run toolkit-docs:typecheck && pnpm run toolkit-docs:test",
"translate": "pnpm dlx tsx scripts/i18n-sync/index.ts && pnpm format",
"llmstxt": "pnpm dlx tsx scripts/generate-llmstxt.ts",
"test": "vitest --run",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ test("porter workflow includes required triggers", () => {
});

test("porter workflow generates docs and opens a PR", () => {
expect(workflowContents).toContain("pnpm run toolkit-docs:check");
expect(workflowContents).not.toContain("run: pnpm build");
expect(workflowContents).not.toContain("name: Build toolkit docs generator");
expect(workflowContents).toContain("pnpm dlx tsx src/cli/index.ts generate");
expect(workflowContents).toContain("--skip-unchanged");
expect(workflowContents).toContain("--require-complete");
Expand Down Expand Up @@ -60,3 +63,13 @@ test("workflow dispatch keeps default full-run behavior", () => {
expect(workflowContents).not.toContain("inputs.providers");
expect(workflowContents).not.toContain("PROVIDERS_INPUT=");
});

test("workflow dispatch can create an isolated verification PR", () => {
expect(workflowContents).toContain("pr_branch:");
expect(workflowContents).toContain(
"inputs.pr_branch || 'automation/toolkit-docs'"
);
expect(workflowContents).toContain(
"inputs.pr_branch && github.ref_name || github.event.repository.default_branch || 'main'"
);
});
Loading