Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
75dfe14
Add settings and help modal visibility management to UIStore
hh54188 Sep 10, 2025
fdf172d
Remove ForceConfigModal README documentation as the component is no l…
hh54188 Sep 10, 2025
77fb5cb
Enhance SettingsModal with accessibility improvements
hh54188 Sep 10, 2025
5207ed3
Refactor SettingsModal for improved user experience and validation
hh54188 Sep 11, 2025
8ca98d0
Update package dependencies in chrome-extension
hh54188 Sep 11, 2025
e2f4c01
Enhance E2E test environment setup and ESLint configuration
hh54188 Sep 11, 2025
197ac39
Add clipboardy dependency and enhance E2E test scripts
hh54188 Sep 11, 2025
508fb87
Remove outdated E2E test documentation files
hh54188 Sep 11, 2025
bc363a7
Add drag-drop E2E test script to package.json
hh54188 Sep 11, 2025
b6f5a5c
Enhance E2E test configuration in vitest.config.js
hh54188 Sep 11, 2025
e01ba6e
Remove E2E test workflow from GitHub Actions
hh54188 Sep 15, 2025
da06071
Update E2E test workflow and enhance environment variable handling
hh54188 Sep 15, 2025
e9dd5e4
Merge branch 'rich-unit-tests' of github.com:hh54188/ai-assistant-chr…
hh54188 Sep 15, 2025
d676563
Remove E2E test workflow from GitHub Actions
hh54188 Sep 15, 2025
d2eb79e
Remove test-pipeline.yml workflow from GitHub Actions
hh54188 Sep 15, 2025
9b481a8
Add dotenv dependency and improve test setup
hh54188 Sep 15, 2025
d73a03c
Refactor CI pipeline by removing unnecessary unit test steps and sens…
hh54188 Sep 15, 2025
59b2087
Enhance CI pipeline and E2E test configuration
hh54188 Sep 15, 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
263 changes: 263 additions & 0 deletions .github/workflows/ci-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
name: CI Pipeline

on:
workflow_dispatch:
pull_request:
branches: [ master ]
push:
branches: [ master ]

jobs:
# Unit Tests for Chrome Extension
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: chrome-extension/package-lock.json

- name: Install Chrome Extension dependencies
working-directory: ./chrome-extension
run: npm ci

- name: Build Chrome Extension
working-directory: ./chrome-extension
run: npm run build

- name: Run Unit Tests (Components)
working-directory: ./chrome-extension
run: npm run test:components

- name: Run Unit Tests (Stores)
working-directory: ./chrome-extension
run: npm run test:stores

- name: Run Unit Tests (All)
working-directory: ./chrome-extension
run: npm run test

- name: Generate Test Coverage
working-directory: ./chrome-extension
run: npm run test:coverage

- name: Upload Coverage Reports
uses: codecov/codecov-action@v3
with:
file: ./chrome-extension/coverage/lcov.info
flags: unit-tests
name: chrome-extension-coverage

# Backend Tests
# backend-tests:
# name: Backend Tests
# runs-on: ubuntu-latest

# steps:
# - name: Checkout code
# uses: actions/checkout@v4

# - name: Setup Node.js
# uses: actions/setup-node@v4
# with:
# node-version: '18'
# cache: 'npm'
# cache-dependency-path: backend/package-lock.json

# - name: Install Backend dependencies
# working-directory: ./backend
# run: npm ci

# - name: Run Backend Tests
# working-directory: ./backend
# env:
# GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# NOTION_API_KEY: ${{ secrets.NOTION_API_KEY }}
# FIRECRAWL_API_KEY: ${{ secrets.FIRECRAWL_API_KEY }}
# NODE_ENV: test
# PORT: 3001
# run: |
# # Run individual test files since there's no test script in backend package.json
# node tests/test-gemini-conversation-tokens.js
# node tests/test-gemini-token-counting.js
# node tests/test-base64-image-upload.js
# node tests/test-file-attachments.js
# node tests/test-chat-sessions.js

# E2E Tests
e2e-tests:
name: E2E Tests
runs-on: ubuntu-latest

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: |
chrome-extension/package-lock.json
backend/package-lock.json

- name: Install Chrome Extension dependencies
working-directory: ./chrome-extension
run: npm ci

- name: Install Backend dependencies
working-directory: ./backend
run: npm ci

- name: Build Chrome Extension for E2E
working-directory: ./chrome-extension
run: npm run build

- name: Install Puppeteer dependencies
run: |
sudo apt-get update
sudo apt-get install -y wget gnupg
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list
sudo apt-get update
sudo apt-get install -y google-chrome-stable

- name: Run E2E Tests - Gemini Chat
working-directory: ./chrome-extension
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
NOTION_API_KEY: ${{ secrets.NOTION_API_KEY }}
FIRECRAWL_API_KEY: ${{ secrets.FIRECRAWL_API_KEY }}
NODE_ENV: test
CI: true
GITHUB_ACTIONS: true
run: npm run test:e2e:chat

- name: Run E2E Tests - Image Upload
working-directory: ./chrome-extension
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
NOTION_API_KEY: ${{ secrets.NOTION_API_KEY }}
FIRECRAWL_API_KEY: ${{ secrets.FIRECRAWL_API_KEY }}
NODE_ENV: test
CI: true
GITHUB_ACTIONS: true
run: npm run test:e2e:image

- name: Run E2E Tests - Drag and Drop
working-directory: ./chrome-extension
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
NOTION_API_KEY: ${{ secrets.NOTION_API_KEY }}
FIRECRAWL_API_KEY: ${{ secrets.FIRECRAWL_API_KEY }}
NODE_ENV: test
CI: true
GITHUB_ACTIONS: true
run: npm run test:e2e:drag-drop

# - name: Run All E2E Tests
# working-directory: ./chrome-extension
# env:
# GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# NOTION_API_KEY: ${{ secrets.NOTION_API_KEY }}
# FIRECRAWL_API_KEY: ${{ secrets.FIRECRAWL_API_KEY }}
# NODE_ENV: test
# CI: true
# GITHUB_ACTIONS: true
# run: npm run test:e2e
# continue-on-error: true # Allow partial failures for debugging

- name: Upload E2E Test Screenshots
uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-test-screenshots
path: chrome-extension/tests/e2e/screenshots/
retention-days: 1

# Lint and Code Quality
# lint-and-quality:
# name: Lint and Code Quality
# runs-on: ubuntu-latest

# steps:
# - name: Checkout code
# uses: actions/checkout@v4

# - name: Setup Node.js
# uses: actions/setup-node@v4
# with:
# node-version: '18'
# cache: 'npm'
# cache-dependency-path: chrome-extension/package-lock.json

# - name: Install Chrome Extension dependencies
# working-directory: ./chrome-extension
# run: npm ci

# - name: Run ESLint
# working-directory: ./chrome-extension
# run: npm run lint

# Build Verification
build-verification:
name: Build Verification
runs-on: ubuntu-latest

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: |
chrome-extension/package-lock.json
backend/package-lock.json

- name: Install Chrome Extension dependencies
working-directory: ./chrome-extension
run: npm ci

- name: Build Chrome Extension
working-directory: ./chrome-extension
run: npm run build

- name: Verify Extension Files
run: |
echo "Verifying Chrome Extension build files..."
ls -la chrome-extension/dist/
test -f chrome-extension/dist/manifest.json
test -f chrome-extension/dist/background.js
test -f chrome-extension/dist/content.js
test -f chrome-extension/dist/main.js
echo "✅ All required extension files present"


- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts-${{ matrix.os }}
path: |
chrome-extension/dist/
retention-days: 1

19 changes: 19 additions & 0 deletions chrome-extension/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,23 @@ export default defineConfig([
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
},
},
{
files: ['tests/**/*.{js,jsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: {
...globals.node,
...globals.browser,
chrome: 'readonly',
},
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
Comment on lines +35 to +45
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The ecmaVersion: 2020 on line 35 is redundant because parserOptions.ecmaVersion: 'latest' on line 42 is also specified. In ESLint's flat config, parserOptions are nested under languageOptions, and the more specific setting takes precedence. To avoid confusion and keep the configuration clean, you should remove the redundant ecmaVersion from the top level of languageOptions.

      globals: {
        ...globals.node,
        ...globals.browser,
        chrome: 'readonly',
      },
      parserOptions: {
        ecmaVersion: 'latest',
        ecmaFeatures: { jsx: true },
        sourceType: 'module',
      },

},
rules: {
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]', argsIgnorePattern: '^_' }],
},
},
])
Loading
Loading