+
Skip to content
Draft
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
6 changes: 6 additions & 0 deletions .changeset/vast-teeth-yell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@inkeep/agents-core": patch
"@inkeep/agents-manage-ui": patch
---

fix of incorrect validation errors for internal agents vs external agents in Dashboard
135 changes: 135 additions & 0 deletions .github/composite-actions/cypress-e2e/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: 'Cypress E2E Tests'
description: 'Run Cypress end-to-end tests with backend and frontend services'

inputs:
node-version:
description: 'Node.js version to use'
required: false
default: '22.x'
pnpm-version:
description: 'pnpm version to use'
required: false
default: '10.10.0'

runs:
using: 'composite'
steps:
- name: Setup Cypress cache
uses: actions/cache@v4
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-cypress-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-cypress-

- name: Install Cypress binary
shell: bash
run: cd agents-manage-ui && npx cypress install

# Start the backend API server
- name: Start Backend API Server
shell: bash
run: |
pnpm --filter @inkeep/agents-manage-api dev &
echo $! > backend.pid
env:
TURBO_TELEMETRY_DISABLED: 1
TURBO_CACHE_DIR: .turbo
ENVIRONMENT: test
OPENAI_API_KEY: ${{ env.OPENAI_API_KEY || 'sk-test-key-for-ci-testing' }}
ANTHROPIC_API_KEY: ${{ env.ANTHROPIC_API_KEY || 'sk-ant-test-key-for-ci-testing' }}
DB_FILE_NAME: test.db
NODE_OPTIONS: --max-old-space-size=4096

# Start the frontend development server
- name: Start Frontend Development Server
shell: bash
run: |
pnpm --filter @inkeep/agents-manage-ui dev &
echo $! > frontend.pid
env:
TURBO_TELEMETRY_DISABLED: 1
TURBO_CACHE_DIR: .turbo
NODE_OPTIONS: --max-old-space-size=4096

# Wait for services to be ready
- name: Wait for Backend API Server
shell: bash
run: |
echo "Waiting for backend API server to be ready..."
timeout 60 bash -c 'until curl -f http://localhost:3002/health 2>/dev/null; do sleep 2; done'
echo "Backend API server is ready!"

- name: Push Weather Example Project
shell: bash
run: cd examples && npx inkeep push --project weather-project

- name: Wait for Frontend Development Server
shell: bash
run: |
echo "Waiting for frontend development server to be ready..."
timeout 60 bash -c 'until curl -f http://localhost:3000 2>/dev/null; do sleep 2; done'
echo "Frontend development server is ready!"

# Run Cypress e2e tests
- name: Run Cypress E2E Tests
shell: bash
run: pnpm --filter @inkeep/agents-manage-ui test:e2e:ci
env:
TURBO_TELEMETRY_DISABLED: 1
TURBO_CACHE_DIR: .turbo
NODE_OPTIONS: --max-old-space-size=4096
CI: true

# Cleanup: Stop the services
- name: Stop Services
if: always()
shell: bash
run: |
echo "Stopping services..."
if [ -f backend.pid ]; then
kill $(cat backend.pid) 2>/dev/null || true
rm -f backend.pid
fi
if [ -f frontend.pid ]; then
kill $(cat frontend.pid) 2>/dev/null || true
rm -f frontend.pid
fi
# Kill any remaining Node.js processes
pkill -f "pnpm.*dev" 2>/dev/null || true

# Upload Cypress screenshots and videos on failure
- name: Upload Cypress Screenshots
if: failure()
uses: actions/upload-artifact@v4
with:
name: cypress-screenshots
path: agents-manage-ui/cypress/screenshots
retention-days: 7

- name: Upload Cypress Videos
if: failure()
uses: actions/upload-artifact@v4
with:
name: cypress-videos
path: agents-manage-ui/cypress/videos
retention-days: 7

# Create summary report
- name: Create E2E Test Summary
if: always()
shell: bash
run: |
echo "## Cypress E2E Test Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

if [ "${{ job.status }}" == "success" ]; then
echo "✅ **All Cypress E2E tests passed successfully!**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The validation test completed without errors." >> $GITHUB_STEP_SUMMARY
else
echo "❌ **Cypress E2E tests failed**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "One or more E2E tests failed. Review the logs above for details." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Screenshots and videos have been uploaded as artifacts for debugging." >> $GITHUB_STEP_SUMMARY
fi
40 changes: 22 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,61 +16,58 @@ concurrency:
jobs:
ci:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v5

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

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.10.0
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

# Create necessary directories for postinstall scripts
- name: Prepare directories
run: |
mkdir -p agents-docs/.source
touch agents-docs/.source/index.ts

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

restore-keys: ${{ runner.os }}-pnpm-store-

- name: Setup Turborepo cache
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-

restore-keys: ${{ runner.os }}-turbo-

- name: Install dependencies
run: |
pnpm install --frozen-lockfile
# Ensure agents-manage-ui dependencies are properly installed
cd agents-manage-ui && pnpm install --frozen-lockfile && cd ..

# Clean database files before running tests
- name: Clean database files
run: |
echo "Cleaning up any existing database files..."
find . -name "*.db" -o -name "*.sqlite" | grep -v node_modules | xargs -r rm -f

# Run all CI checks in parallel with Turborepo
- name: Run CI checks
id: ci-check
Expand All @@ -89,7 +86,14 @@ jobs:
DB_FILE_NAME: test.db
NODE_OPTIONS: --max-old-space-size=4096
CI: true


# Run Cypress E2E tests using composite action
- name: Run Cypress E2E Tests
uses: ./.github/composite-actions/cypress-e2e
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-ci-testing' }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY || 'sk-ant-test-key-for-ci-testing' }}

# Create summary report
- name: Create CI Summary
if: always()
Expand All @@ -107,4 +111,4 @@ jobs:
echo "One or more checks failed. Review the logs above for details." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Run \`pnpm check\` locally to reproduce the CI checks." >> $GITHUB_STEP_SUMMARY
fi
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ dist
.playwright-mcp
.vercel
.idea/
agents-manage-ui/cypress/screenshots/
15 changes: 15 additions & 0 deletions agents-manage-ui/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineConfig } from 'cypress';

export default defineConfig({
// Default is Electron, we choose Chrome instead
defaultBrowser: 'chrome',
e2e: {
baseUrl: 'http://localhost:3000',
// Increase default viewport, we choose use MacBook 15 viewport size
viewportWidth: 1440,
viewportHeight: 900,
setupNodeEvents(_on, _config) {
// implement node event listeners here
},
},
});
23 changes: 23 additions & 0 deletions agents-manage-ui/cypress/e2e/validation.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/// <reference types="cypress" />

describe('Validation', () => {
beforeEach(() => {
cy.visit('/');
});

it('for agent validate only prompt as required field', () => {
// Click create graph button
cy.contains('Create graph').click();

// Wait for app to initialize
cy.contains('Save').should('exist');

// Trigger Cmd+S to save
cy.get('body').type('{cmd+s}');

// Check for validation errors
cy.contains('Validation Errors (1)').should('exist');
cy.contains('Agent Errors (1)').click();
cy.contains('Agent is missing required field: Prompt').should('exist');
});
});
5 changes: 5 additions & 0 deletions agents-manage-ui/cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}
25 changes: 25 additions & 0 deletions agents-manage-ui/cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
17 changes: 17 additions & 0 deletions agents-manage-ui/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ***********************************************************
// This example support/e2e.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'
7 changes: 5 additions & 2 deletions agents-manage-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@
"format:check": "biome format",
"typecheck": "tsc --noEmit",
"test": "vitest --run",
"test:coverage": "vitest --run --coverage"
"test:coverage": "vitest --run --coverage",
"test:e2e": "cypress open",
"test:e2e:ci": "cypress run --headless"
},
"dependencies": {
"@codemirror/lint": "^6.8.5",
"@ai-sdk/react": "2.0.11",
"@codemirror/autocomplete": "^6.19.0",
"@codemirror/lang-json": "^6.0.2",
"@codemirror/lint": "^6.8.5",
"@codemirror/view": "^6.38.4",
"@hookform/resolvers": "^5.2.1",
"@inkeep/agents-core": "workspace:^",
Expand Down Expand Up @@ -110,6 +112,7 @@
"@types/react": "^19",
"@types/react-dom": "^19",
"@vitest/coverage-v8": "^3.2.4",
"cypress": "^15.3.0",
"jsdom": "^26.1.0",
"tailwind-scrollbar": "^4.0.2",
"tailwindcss": "^4",
Expand Down
Loading
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载