Skip to content
Merged
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
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4
Expand All @@ -28,6 +28,7 @@ jobs:

- name: Security audit
run: npm audit --audit-level=high
continue-on-error: true

- name: Format check
run: npx prettier --check .
Expand All @@ -38,5 +39,12 @@ jobs:
- name: Build
run: npm run build

- name: Test
- name: Test with coverage
run: npm test

- name: Upload coverage to Codecov
if: matrix.node-version == '20.x'
uses: codecov/codecov-action@v4
with:
file: ./coverage/lcov.info
fail_ci_if_error: false
50 changes: 50 additions & 0 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Claude Code Review

on:
pull_request:
types: [opened, synchronize]

jobs:
claude-review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: read
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
prompt: |
Review PR #${{ github.event.pull_request.number }} in ${{ github.repository }}.

This is an MCP (Model Context Protocol) server for the Coolify API. Focus on:

**Critical Issues:**
- Security vulnerabilities (exposed tokens, injection attacks, unsafe data handling)
- Breaking changes to the MCP tool interface
- Bugs that would cause runtime errors

**Code Quality:**
- TypeScript type safety - ensure proper typing, avoid `any`
- Error handling - all API calls should have proper error handling
- Consistency with existing patterns in coolify-client.ts and mcp-server.ts

**Testing:**
- New functionality should have corresponding tests
- Tests should cover edge cases and error conditions

Keep feedback concise and actionable. Skip minor style issues that Prettier/ESLint will catch.

Use `gh pr comment` to post your review. If no critical issues, say "✅ LGTM - No critical issues found."

claude_args: '--allowed-tools "Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Read,Glob,Grep"'
53 changes: 53 additions & 0 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Claude Code

on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]

jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: read

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

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

- name: Install dependencies
run: npm ci

- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
additional_permissions: |
actions: read

# Allow Claude to use all tools for flexibility
claude_args: '--allowed-tools "*"'
16 changes: 16 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,20 @@ export default {
},
extensionsToTreatAsEsm: ['.ts'],
testPathIgnorePatterns: ['/node_modules/', '/dist/', '\\.d\\.ts$'],
collectCoverage: true,
collectCoverageFrom: [
'src/lib/**/*.ts',
'!src/lib/mcp-server.ts', // MCP SDK wrapper - tested via integration
'!src/**/*.d.ts',
],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'text-summary', 'lcov'],
coverageThreshold: {
global: {
statements: 80,
branches: 80,
functions: 80,
lines: 80,
},
},
};
Loading
Loading