Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
367ea6c
Implement AI Assistant with resized avatar and sample prompts
richardkiene Aug 1, 2025
a4bb430
Add enhanced UI features and Run Query in Editor functionality
richardkiene Aug 1, 2025
a4d479e
Enhance AI assistant with dynamic responses and persistent context
richardkiene Aug 5, 2025
eb4cd56
Refactor AI conversation system with context isolation and enhanced UX
richardkiene Aug 5, 2025
a623249
Add comprehensive test suite and CI/CD pipeline
richardkiene Aug 6, 2025
d9dcc53
Refactor DataAccess layer to remove hardcoded database assumptions
richardkiene Aug 6, 2025
947ca77
Fix connection state initialization and prevent automatic AI restoration
richardkiene Aug 10, 2025
94c671e
Update Electron to latest version 37.2.6 and electron-builder to 26.0.12
richardkiene Aug 10, 2025
cc76a40
Fix missing proactive analysis methods in AdvancedAIAgent
richardkiene Aug 10, 2025
8205601
Add Playwright E2E testing framework for Electron UI
richardkiene Aug 10, 2025
705171a
Add mock server for E2E tests to enable CI/CD testing
richardkiene Aug 10, 2025
1f9bef3
Add comprehensive E2E test suite with full UI coverage
richardkiene Aug 10, 2025
c80eeb8
Complete E2E test coverage with 100% pass rate
richardkiene Aug 10, 2025
cdedbac
Fix E2E test data isolation to prevent polluting dev environment
richardkiene Aug 10, 2025
bc749f2
Fix AI connection not being properly initialized for Analytics
richardkiene Aug 11, 2025
9ea187b
Fix undefined Analytics reference - use window.Analytics
richardkiene Aug 11, 2025
4473f72
Add E2E tests for AI connection and analysis functionality
richardkiene Aug 11, 2025
2457b33
Fix Analytics using hardcoded localhost instead of actual Ollama endp…
richardkiene Aug 11, 2025
76529bc
Fix Analytics.isConnected being reset when switching views
richardkiene Aug 11, 2025
d8d584c
Fix AI analytics visualization and data parsing issues
richardkiene Aug 11, 2025
46c03e1
Fix query editor HTML structure and implement AI analysis dropdown
richardkiene Aug 11, 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
169 changes: 169 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
name: Continuous Integration

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest

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

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

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run test suite
run: npm test

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-node-${{ matrix.node-version }}
path: |
test_results.txt
final_test_results.txt
retention-days: 30

test-cross-platform:
name: Cross-Platform Tests
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [18.x]

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

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run test suite
run: npm test

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.os }}
path: |
test_results.txt
final_test_results.txt
retention-days: 30

lint-and-security:
name: Code Quality & Security
runs-on: ubuntu-latest

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

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

- name: Install dependencies
run: npm ci

- name: Run security audit
run: npm audit --audit-level=moderate
continue-on-error: true

- name: Check for outdated packages
run: npm outdated
continue-on-error: true

build-test:
name: Test Build Process
runs-on: ubuntu-latest
needs: [test]

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

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

- name: Install dependencies
run: npm ci

- name: Test build process
run: npm run pack

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-test-artifacts
path: dist/
retention-days: 7

coverage-report:
name: Generate Coverage Report
runs-on: ubuntu-latest
needs: [test]

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

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

- name: Install dependencies
run: npm ci

- name: Run tests with verbose output
run: npm run test:verbose

- name: Generate test summary
run: |
echo "## Test Results Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ -f final_test_results.txt ]; then
echo "### Final Test Results:" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat final_test_results.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi
if [ -f test_results.txt ]; then
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Detailed Results:" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
tail -20 test_results.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi
59 changes: 59 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: E2E Tests

on:
push:
branches: [ main, develop, 'feature/**' ]
pull_request:
branches: [ main, develop ]

jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci

- name: Install Playwright browsers
run: npx playwright install --with-deps chromium

- name: Run unit tests
run: npm run test:unit

- name: Run integration tests
run: npm run test:integration

- name: Run E2E tests
run: npm run test:e2e
env:
CI: true

- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results-${{ matrix.os }}-node${{ matrix.node-version }}
path: |
tests/e2e/test-results/
tests/e2e/reports/
tests/e2e/screenshots/

- name: Upload coverage reports
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
uses: codecov/codecov-action@v3
with:
files: ./coverage/lcov.info
flags: e2e
name: e2e-coverage
165 changes: 165 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
name: Pull Request Checks

on:
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened, ready_for_review]

jobs:
pr-validation:
name: PR Validation
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false

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

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

- name: Install dependencies
run: npm ci

- name: Run full test suite
id: tests
run: |
echo "Running comprehensive test suite..."
npm test
echo "test_status=success" >> $GITHUB_OUTPUT
continue-on-error: false

- name: Validate test results
run: |
if [ -f final_test_results.txt ]; then
echo "Final test results found:"
cat final_test_results.txt

# Check for test failures
if grep -q "FAILED\|ERROR\|0 passed" final_test_results.txt; then
echo "❌ Tests failed - blocking PR merge"
exit 1
fi

# Extract test count and verify all passed
if grep -q "187.*passed" final_test_results.txt; then
echo "✅ All 187 tests passed - PR can proceed"
else
echo "⚠️ Test count mismatch - expected 187 tests"
exit 1
fi
else
echo "❌ Test results file not found"
exit 1
fi

- name: Comment test results on PR
if: always()
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
let testResults = '';

try {
if (fs.existsSync('final_test_results.txt')) {
testResults = fs.readFileSync('final_test_results.txt', 'utf8');
}
} catch (error) {
testResults = 'Could not read test results';
}

const success = '${{ steps.tests.outcome }}' === 'success';
const emoji = success ? '✅' : '❌';
const status = success ? 'PASSED' : 'FAILED';

const comment = `## ${emoji} Test Results - ${status}

**Time Buddy Test Suite Results:**

\`\`\`
${testResults}
\`\`\`

${success ?
'🎉 All tests passed! This PR is ready for review and merge.' :
'🚫 Tests failed. Please fix the issues before merging this PR.'}

---
*Automated test results from GitHub Actions*`;

github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});

security-scan:
name: Security Scan
runs-on: ubuntu-latest

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

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

- name: Install dependencies
run: npm ci

- name: Run security audit
run: |
echo "Running security audit..."
npm audit --audit-level=high
continue-on-error: false

pr-requirements-check:
name: PR Requirements
runs-on: ubuntu-latest

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

- name: Check PR title and description
uses: actions/github-script@v7
with:
script: |
const pr = context.payload.pull_request;

// Check PR title
if (!pr.title || pr.title.length < 10) {
core.setFailed('PR title must be at least 10 characters long and descriptive');
return;
}

// Check PR description
if (!pr.body || pr.body.trim().length < 20) {
core.setFailed('PR description must be provided and at least 20 characters long');
return;
}

console.log('✅ PR title and description requirements met');

- name: Validate branch naming
run: |
BRANCH_NAME="${{ github.head_ref }}"

if [[ ! $BRANCH_NAME =~ ^(feature|fix|hotfix|refactor|docs|test|chore)/.+ ]]; then
echo "❌ Branch name must follow pattern: type/description"
echo " Valid prefixes: feature, fix, hotfix, refactor, docs, test, chore"
echo " Current branch: $BRANCH_NAME"
exit 1
fi

echo "✅ Branch naming convention followed: $BRANCH_NAME"
Loading
Loading