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
57 changes: 57 additions & 0 deletions .github/workflows/be-installation-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Test backend installation

on:
pull_request:
branches:
- develop
- main
paths:
- '**.py'
- '**.txt'
- '**/pyproject.toml'
- '**/uv.lock'
Comment on lines +8 to +12
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Consider adding more comprehensive path filters to improve workflow efficiency. The current patterns might trigger on unrelated changes.

paths:
  - 'backend-agent/**/*.py'
  - 'backend-agent/**/requirements*.txt'
  - 'backend-agent/**/pyproject.toml'
  - 'backend-agent/**/uv.lock'

workflow_dispatch:

permissions:
checks: read
contents: read

jobs:
installation-backend:
name: Test backend installation
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v5

- name: Set up Python environment
uses: actions/setup-python@v6
with:
python-version: "3.11"
token: ${{ secrets.GITHUB_TOKEN }}
Comment on lines +27 to +31
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The token parameter is not needed for actions/setup-python@v6 when using public Python distributions. This parameter is typically used for private registries or when downloading from GitHub releases.

- name: Set up Python environment
  uses: actions/setup-python@v6
  with:
    python-version: "3.11"


- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "latest"
enable-cache: true

- name: Install dependencies
run: uv sync --locked --all-extras --dev --project backend-agent

- name: Start server and check health
working-directory: backend-agent
run: |
DISABLE_AGENT=1 DB_PATH=${RUNNER_TEMP}/data.db uv run main.py > server.log 2>&1 &
for i in {1..20}; do
sleep 1
status=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/health || true)
if [ "$status" -eq 200 ]; then
echo "Health check succeeded"
cat server.log
exit 0
fi
done
Comment on lines +46 to +54
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Consider using a more explicit health check URL and add timeout handling for the curl command to prevent hanging.

for i in {1..20}; do
  sleep 1
  status=$(timeout 5 curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/health 2>/dev/null || echo "000")
  if [ "$status" -eq 200 ]; then
    echo "Health check succeeded"
    cat server.log
    exit 0
  fi
  echo "Attempt $i: Health check returned status $status"
done

echo "Health check failed after waiting"
cat server.log
exit 1
73 changes: 73 additions & 0 deletions .github/workflows/fe-installation-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Test frontend installation

on:
pull_request:
branches:
- develop
- main
paths:
- 'frontend/package*.json'
- 'frontend/**.ts'
- 'frontend/**.js'
- 'frontend/**.json'
- 'frontend/**.css'
- 'frontend/**.html'
workflow_dispatch:

permissions:
checks: read
contents: read

jobs:
installation-frontend:
name: Test frontend installation
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v5

- name: Set up Node.js environment
uses: actions/setup-node@v5
with:
node-version: "24"

- name: Install dependencies
working-directory: frontend
run: npm ci

- name: Build frontend
working-directory: frontend
run: npm run build

- name: Verify build artifacts
working-directory: frontend
run: |
if [ -d "dist/" ]; then
echo "Build artifacts found in dist/"
ls -la dist/
else
echo "Build artifacts not found"
exit 1
fi

- name: Test dev server startup
working-directory: frontend
timeout-minutes: 2
run: |
# Start the dev server in background
npm start &
DEV_SERVER_PID=$!

# Wait for server to be ready (max 60 seconds)
for i in {1..60}; do
sleep 1
if curl -f -s http://localhost:4200 > /dev/null 2>&1; then
echo "Dev server started successfully"
kill $DEV_SERVER_PID
exit 0
fi
done

echo "Dev server failed to start within 60 seconds"
kill $DEV_SERVER_PID
exit 1
Comment on lines +57 to +73
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The process cleanup logic could be improved to handle cases where the kill command fails. Consider using a more robust cleanup approach.

# Start the dev server in background
npm start &
DEV_SERVER_PID=$!

# Cleanup function
cleanup() {
  if kill -0 $DEV_SERVER_PID 2>/dev/null; then
    kill $DEV_SERVER_PID 2>/dev/null || true
    wait $DEV_SERVER_PID 2>/dev/null || true
  fi
}
trap cleanup EXIT

# Wait for server to be ready (max 60 seconds)
for i in {1..60}; do
  sleep 1
  if curl -f -s http://localhost:4200 > /dev/null 2>&1; then
    echo "Dev server started successfully"
    exit 0
  fi
done

echo "Dev server failed to start within 60 seconds"
exit 1

Comment on lines +72 to +73
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The file is missing a newline at the end. This should be added for better POSIX compliance.

          kill $DEV_SERVER_PID
          exit 1

55 changes: 0 additions & 55 deletions .github/workflows/installation-test.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/lint-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- main
paths:
- '**.py'
- 'CHANGELOG.md'
workflow_dispatch:

permissions:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/lint-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ on:
- develop
- main
paths:
- '**.json'
- '**.ts'
- '**.js'
- '**/package.json'
- 'CHANGELOG.md'
Comment on lines -9 to +12
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The path pattern change from '**.json' to '**/package.json' is more specific and appropriate, but consider if other JSON files in the frontend directory should also trigger linting (e.g., tsconfig.json, angular.json).

paths:
  - '**.ts'
  - '**.js'
  - '**/package.json'
  - '**/tsconfig*.json'
  - 'CHANGELOG.md'

workflow_dispatch:

permissions:
Expand All @@ -33,15 +34,15 @@ jobs:
node-version: 24

- name: Install Node.js dependencies
working-directory: frontend
run: |
cd frontend
npm ci

- name: Run linters
uses: reviewdog/action-eslint@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
workdir: frontend
eslint_flags: "--format rdjson --ext .js,.jsx,.ts,.tsx ./"
fail_level: error
workdir: frontend
48 changes: 0 additions & 48 deletions frontend/.eslintrc.json

This file was deleted.

49 changes: 49 additions & 0 deletions frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { defineConfig, globalIgnores } from "eslint/config";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default defineConfig([globalIgnores(["projects/**/*"]), {
files: ["**/*.ts"],

extends: compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates",
),

rules: {
"@angular-eslint/directive-selector": ["error", {
type: "attribute",
prefix: "app",
style: "camelCase",
}],

"@angular-eslint/component-selector": ["error", {
type: "element",
prefix: "app",
style: "kebab-case",
}],

semi: 2,
},
}, {
files: ["**/*.html"],

extends: compat.extends(
"plugin:@angular-eslint/template/recommended",
"plugin:@angular-eslint/template/accessibility",
),

rules: {},
}]);
23 changes: 5 additions & 18 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading