Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
2f4e59e
refactor(action.yml, README.md, workflows, scripts): transition from …
Oct 22, 2025
0ea807a
fix: update default model references in action.yml, README.md, and wo…
Oct 22, 2025
cf948db
refactor(setup-mcp.sh): streamline MCP server configuration for Forge…
Oct 22, 2025
fca53e9
feat(validation): implement JSON output schema and markdown report ge…
Oct 22, 2025
b32179f
chore(setup-mcp.sh, .gitignore): update MCP server configuration and …
Oct 22, 2025
31400aa
refactor(action.yml, README.md, test-local.sh, scripts): update MCP s…
Oct 22, 2025
7418553
fix(validate.sh): correct variable assignment for status extraction
Oct 22, 2025
cb2e863
feat(workflows): add MCP connection verification steps to validation …
Oct 22, 2025
c54f7f7
feat(workflows): enhance MCP connection verification steps in validat…
Oct 22, 2025
053ee65
fix(setup-mcp.sh, action.yml): remove MCP config with authentication …
Oct 22, 2025
0a157d6
feat(testing): enhance MCP connection testing and documentation
Oct 22, 2025
1c2695c
feat(docs, setup-mcp.sh): enhance MCP integration documentation and c…
Oct 22, 2025
c4ba391
feat(scripts): enhance MCP connection testing script
Oct 22, 2025
443040b
feat(workflows): add default model variable for MCP connection testing
Oct 23, 2025
fbea854
feat(scripts, workflows): enhance MCP connection testing with model c…
Oct 23, 2025
cec0f43
feat(workflows, scripts): enhance MCP server setup and verification i…
Oct 23, 2025
774205c
feat(workflows, scripts): add Usable API token and URL for enhanced M…
Oct 23, 2025
a90a016
feat(scripts): export environment variables for MCP server testing
Oct 23, 2025
98b8198
feat(scripts): improve MCP connection testing with process checks
Oct 23, 2025
1177cef
feat(scripts): enhance MCP server setup with global installation
Oct 23, 2025
845e660
feat(scripts): update MCP server setup script for improved output and…
Oct 23, 2025
8184e31
feat(workflows): enhance .mcp.json configuration checks in testing wo…
Oct 23, 2025
c8e48f4
fix(scripts): remove USABLE_BASE_URL from MCP server setup script
Oct 23, 2025
cf085da
fix(workflows, scripts): improve security and output handling in test…
Oct 23, 2025
38369f8
fix(scripts): add newline at the end of test-mcp-connection.sh
Oct 23, 2025
4ae037f
feat(scripts): add MCP protocol testing script and enhance connection…
Oct 23, 2025
fc637fc
feat(scripts): enhance MCP connection testing with additional checks …
Oct 23, 2025
c272866
refactor(scripts): streamline MCP connection testing and enhance outp…
Oct 23, 2025
291c43d
fix(scripts): :zap: switch MCP from stdio to HTTP transport for CI co…
Oct 23, 2025
f470877
fix(scripts): :wrench: use streaming HTTP format with env.AUTHORIZATION
Oct 23, 2025
c9dc80c
refactor(scripts): :recycle: remove stdio-specific checks from MCP test
Oct 23, 2025
55481be
feat(action): enhance PR validation process with dynamic prompt handl…
Oct 23, 2025
1b29e06
feat(action): refresh MCP cache before validation to enhance reliability
Oct 23, 2025
e3205ac
feat(scripts): enhance MCP connection testing with cache refresh and …
Oct 23, 2025
3376204
feat(action): improve MCP cache refresh handling for better reliability
Oct 23, 2025
f7ebfa3
feat(action, scripts): enhance MCP server registration and cleanup pr…
Oct 23, 2025
ffbd1f4
feat(action, scripts): improve MCP cache refresh output handling
Oct 23, 2025
4e4b8dd
fix(scripts): update MCP server registration naming for consistency
Oct 23, 2025
65a047c
fix(action, scripts): update MCP server name for consistency
Oct 23, 2025
8041076
fix(scripts): add delay before starting ForgeCode for MCP server read…
Oct 23, 2025
c7d98f0
feat(config): add MCP server configuration to forge.yaml and update s…
Oct 23, 2025
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
30 changes: 22 additions & 8 deletions .github/workflows/comment-revalidation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ on:
required: false
type: string
default: ''
gemini-model:
description: 'Gemini model to use'
provider:
description: 'LLM provider (openrouter, anthropic, openai, auto)'
required: false
type: string
default: 'gemini-2.5-flash'
default: 'auto'
model:
description: 'Model to use'
required: false
type: string
default: 'anthropic/claude-haiku-4.5'
comment-title:
description: 'Title for the validation comment'
required: false
Expand All @@ -41,9 +46,15 @@ on:
type: boolean
default: false
secrets:
GEMINI_SERVICE_ACCOUNT_KEY:
description: 'Base64-encoded Gemini service account key'
required: true
OPENROUTER_API_KEY:
description: 'OpenRouter API key (or ANTHROPIC_API_KEY/OPENAI_API_KEY)'
required: false
ANTHROPIC_API_KEY:
description: 'Anthropic API key'
required: false
OPENAI_API_KEY:
description: 'OpenAI API key'
required: false
USABLE_API_TOKEN:
description: 'Usable API token'
required: true
Expand Down Expand Up @@ -273,13 +284,16 @@ jobs:
prompt-fragment-id: ${{ inputs.prompt-fragment-id || '' }}
workspace-id: ${{ inputs.workspace-id || '60c10ca2-4115-4c1a-b6d7-04ac39fd3938' }}
base-ref: ${{ steps.base-ref.outputs.base-ref }}
gemini-model: ${{ inputs.gemini-model || 'gemini-2.5-flash' }}
provider: ${{ inputs.provider || 'auto' }}
model: ${{ inputs.model || 'anthropic/claude-haiku-4.5' }}
comment-title: ${{ inputs.comment-title || '🔄 Revalidation (Comment Triggered)' }}
comment-mode: 'create'
fail-on-critical: ${{ inputs.fail-on-critical || false }}
override-comment: ${{ needs.check-trigger.outputs.comment-body }}
env:
GEMINI_SERVICE_ACCOUNT_KEY: ${{ secrets.GEMINI_SERVICE_ACCOUNT_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
USABLE_API_TOKEN: ${{ secrets.USABLE_API_TOKEN }}
COMMENT_AUTHOR: ${{ github.event.comment.user.login }}

Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/test-reusable-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ jobs:
with:
workspace-id: '60c10ca2-4115-4c1a-b6d7-04ac39fd3938'
prompt-file: 'templates/basic-validation.md'
gemini-model: 'gemini-2.5-flash'
provider: 'auto'
model: 'anthropic/claude-haiku-4.5'
comment-title: '🧪 Reusable Workflow Test'
fail-on-critical: false
secrets:
GEMINI_SERVICE_ACCOUNT_KEY: ${{ secrets.GEMINI_SERVICE_ACCOUNT_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
USABLE_API_TOKEN: ${{ secrets.USABLE_API_TOKEN }}
permissions:
contents: read
Expand Down Expand Up @@ -62,22 +63,26 @@ jobs:
**Test Configuration**:
- Workspace ID: 60c10ca2-4115-4c1a-b6d7-04ac39fd3938
- Prompt File: templates/basic-validation.md
- Model: gemini-2.5-flash
- Provider: auto
- Model: anthropic/claude-haiku-4.5
- Comment Title: 🧪 Reusable Workflow Test

**Result**: ${{ needs.test-reusable.result }}

**Next Steps**:
- If successful: Reusable workflow is ready for users
- If failed: Check workflow logs for errors

**How Users Will Call It**:
\`\`\`yaml
uses: flowcore/usable-pr-validator/.github/workflows/comment-revalidation.yml@v1
with:
workspace-id: 'their-workspace-uuid'
# Optional - defaults to auto and anthropic/claude-haiku-4.5
# provider: 'openrouter' # or 'anthropic', 'openai', 'auto'
# model: 'anthropic/claude-3.7-sonnet' # for higher quality
secrets:
GEMINI_SERVICE_ACCOUNT_KEY: \${{ secrets.GEMINI_SERVICE_ACCOUNT_KEY }}
OPENROUTER_API_KEY: \${{ secrets.OPENROUTER_API_KEY }}
USABLE_API_TOKEN: \${{ secrets.USABLE_API_TOKEN }}
\`\`\`
EOF
Expand Down
164 changes: 153 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,22 +182,109 @@ jobs:
- name: Verify Cleanup Steps
run: |
# Check that action.yml has cleanup steps
if ! grep -q "rm -f /tmp/service-account.json" action.yml; then
echo "::error::Missing cleanup for service-account.json"
if ! grep -q "rm -f /tmp/forge-config.yaml" action.yml; then
echo "::error::Missing cleanup for forge-config.yaml"
exit 1
fi
if ! grep -q "rm -f /tmp/gemini-settings.json" action.yml; then
echo "::error::Missing cleanup for gemini-settings.json"

if ! grep -q "rm -f /tmp/validation-.*\.md" action.yml; then
echo "::error::Missing cleanup for validation files"
exit 1
fi

echo "✅ Cleanup steps verified"

test-mcp-connection:
name: Test MCP Connection
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install ForgeCode
run: |
echo "Installing ForgeCode CLI..."
npm install -g forgecode@latest
forge --version

echo ""
echo "Node.js version:"
node --version
echo "npm version:"
npm --version

- name: Setup MCP Server
env:
USABLE_URL: ${{ vars.USABLE_URL || 'https://usable.dev' }}
USABLE_API_TOKEN: ${{ secrets.USABLE_API_TOKEN }}
WORKSPACE_ID: '60c10ca2-4115-4c1a-b6d7-04ac39fd3938'
run: |
./scripts/setup-mcp.sh

- name: Verify MCP Server Package
run: |
echo "Testing if @usabledev/mcp-server can be executed..."
npx --yes @usabledev/mcp-server@latest --version || echo "::warning::MCP server version check failed"

echo ""
echo "Checking .mcp.json configuration..."
echo "File exists: $([ -f .mcp.json ] && echo 'YES' || echo 'NO')"

if [ -f .mcp.json ]; then
echo ""
echo "Full .mcp.json content (with token partially masked for security):"
cat .mcp.json | sed -E 's/(mmesh_[a-zA-Z0-9_]{6})[a-zA-Z0-9_]*/\1***/g'

echo ""
echo "Parsed configuration:"
jq '.' .mcp.json 2>&1 || echo "::warning::Failed to parse JSON"

echo ""
echo "Command that will be executed:"
jq -r '.mcpServers.usable.command + " " + (.mcpServers.usable.args | join(" "))' .mcp.json 2>&1 || echo "::warning::Failed to extract command"

echo ""
echo "Environment variables configured in .mcp.json:"
jq -r '.mcpServers.usable.env | keys[]' .mcp.json 2>&1 || echo "::warning::Failed to extract env vars"
else
echo "::error::.mcp.json file not found!"
fi

echo ""
echo "ForgeCode MCP servers:"
forge mcp list

- name: Test MCP Connection
env:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
USABLE_API_TOKEN: ${{ secrets.USABLE_API_TOKEN }}
USABLE_URL: ${{ vars.USABLE_URL || 'https://usable.dev' }}
PROVIDER: ${{ vars.PROVIDER || 'auto' }}
MODEL: ${{ vars.MODEL || 'anthropic/claude-haiku-4.5' }}
run: |
./scripts/test-mcp-connection.sh

- name: Upload MCP Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: mcp-test-results
path: |
/tmp/mcp-test-*.txt
/tmp/mcp-test-*.json
retention-days: 7
if-no-files-found: warn

integration-test:
name: Integration Test
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
needs: test-mcp-connection
permissions:
contents: read
pull-requests: write
Expand Down Expand Up @@ -238,6 +325,21 @@ jobs:
## Your Task
Validate this PR for the usable-pr-validator GitHub Action repository.

### Step 0: Verify MCP Connection (REQUIRED - CRITICAL)
**YOU MUST TEST THE USABLE MCP CONNECTION FIRST:**

1. Call the `mcp_usable_list-workspaces` tool with `{"includeArchived": false}`
2. In your report, include the EXACT output showing:
- Total number of workspaces found
- Name of each workspace
- Whether the expected workspace "Flowcore" (ID: 60c10ca2-4115-4c1a-b6d7-04ac39fd3938) was found

**CRITICAL**: If you do not call this tool and show the results, your report will be considered INVALID.

Expected result: Should find at least the "Flowcore" workspace.

If the MCP connection fails, report this as a CRITICAL VIOLATION with the exact error message.

### Step 1: Get PR Changes
```bash
# Compare base ref (branch or tag) with HEAD
Expand Down Expand Up @@ -279,6 +381,22 @@ jobs:

# PR Validation Report

## MCP Connection Verification ✅ (REQUIRED)

**MCP Server**: https://usable.dev/api/mcp

### Connection Test Results:
- **Status**: Connected ✅ or Failed ❌
- **Tool Called**: `mcp_usable_list-workspaces`
- **Total Workspaces Found**: [exact number]
- **Workspaces**:
- [Workspace 1 name] (ID: [uuid])
- [Workspace 2 name] (ID: [uuid])
- ...
- **Target Workspace Found**: ✅ Flowcore (60c10ca2-4115-4c1a-b6d7-04ac39fd3938) or ❌ Not Found

**Verification Stamp**: 🔐 MCP connection verified on [timestamp]

## Summary
[Brief overview of the changes and validation results]

Expand Down Expand Up @@ -313,15 +431,15 @@ jobs:
comment-mode: 'update'
fail-on-critical: false
env:
GEMINI_SERVICE_ACCOUNT_KEY: ${{ secrets.GEMINI_SERVICE_ACCOUNT_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
USABLE_API_TOKEN: ${{ secrets.USABLE_API_TOKEN }}

- name: Debug Test Results
if: always()
run: |
echo "Test result: ${{ steps.test-action.outcome }}"
if [ -f "/tmp/validation-full-output.md" ]; then
echo "::group::Full Gemini Output"
echo "::group::Full ForgeCode Output"
cat /tmp/validation-full-output.md
echo "::endgroup::"
else
Expand All @@ -332,6 +450,7 @@ jobs:
name: Integration Test (Documentation)
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
needs: test-mcp-connection
permissions:
contents: read
pull-requests: write
Expand Down Expand Up @@ -372,6 +491,12 @@ jobs:
## Your Task
Validate documentation changes in this PR.

### Step 0: Verify MCP Connection (REQUIRED)
**YOU MUST call `mcp_usable_list-workspaces` tool first** and show the results in your report with:
- Total workspaces found
- List of workspace names and IDs
- Confirmation that "Flowcore" workspace was found

### Get Changes
```bash
# Compare base ref (branch or tag) with HEAD for markdown files
Expand Down Expand Up @@ -399,6 +524,12 @@ jobs:

# PR Validation Report

## MCP Connection Verification ✅
- **Status**: Connected ✅ or Failed ❌
- **Workspaces Found**: [count]
- **Target Workspace**: ✅ Flowcore found or ❌ Not Found
- **Verification Stamp**: 🔐 MCP verified

## Summary
[Overview of documentation changes]

Expand Down Expand Up @@ -430,15 +561,15 @@ jobs:
comment-mode: 'update'
fail-on-critical: false
env:
GEMINI_SERVICE_ACCOUNT_KEY: ${{ secrets.GEMINI_SERVICE_ACCOUNT_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
USABLE_API_TOKEN: ${{ secrets.USABLE_API_TOKEN }}

- name: Debug Documentation Results
if: always()
run: |
echo "Docs test result: ${{ steps.docs-action.outcome }}"
if [ -f "/tmp/validation-full-output.md" ]; then
echo "::group::Full Gemini Output"
echo "::group::Full ForgeCode Output"
cat /tmp/validation-full-output.md
echo "::endgroup::"
else
Expand All @@ -449,6 +580,7 @@ jobs:
name: Integration Test (Comment Revalidation)
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
needs: test-mcp-connection
permissions:
contents: read
pull-requests: write
Expand Down Expand Up @@ -489,6 +621,11 @@ jobs:
## Your Task
Test the comment revalidation feature.

### Step 0: Verify MCP Connection (REQUIRED)
**YOU MUST call `mcp_usable_list-workspaces` tool first** and show the results in your report with:
- Total workspaces found
- Verification that "Flowcore" workspace is accessible

### Step 1: Verify Override Comment

Check if there is an override/clarification comment in the PR context above (marked with 🔄).
Expand All @@ -515,6 +652,11 @@ jobs:

# PR Validation Report

## MCP Connection Verification ✅
- **Status**: Connected ✅ or Failed ❌
- **Workspaces Found**: [count]
- **Verification Stamp**: 🔐 MCP verified

## Summary
[Mention this is a comment revalidation test]
[Note if override comment was detected]
Expand Down Expand Up @@ -569,7 +711,7 @@ jobs:
comment-mode: 'update'
fail-on-critical: false
env:
GEMINI_SERVICE_ACCOUNT_KEY: ${{ secrets.GEMINI_SERVICE_ACCOUNT_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
USABLE_API_TOKEN: ${{ secrets.USABLE_API_TOKEN }}
COMMENT_AUTHOR: 'test-user'

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.DS_Store
.AppleDouble
.LSOverride
.mcp.json

# Secrets and credentials
*.json.key
Expand Down
Loading
Loading