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
68 changes: 24 additions & 44 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,73 +2,53 @@ name: E2E Tests

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

jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest

services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: funcommute_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
cache: 'npm'

- name: Install Supabase CLI
uses: supabase/setup-cli@v1
with:
version: latest

- name: Install dependencies
run: npm ci

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

- name: Setup test database
run: |
# Add database setup commands here
echo "Setting up test database..."
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/funcommute_test

- name: Build application
run: npm run build
env:
NODE_ENV: test
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/funcommute_test
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }}
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}

- name: Run Playwright tests
run: npm run test:e2e
- name: Run lint
run: npm run lint

- name: Run type checks
run: npm run type-check

- name: Run Jest
run: npm run test:ci

- name: Run local Supabase E2E harness
run: npm run test:e2e:local
env:
NODE_ENV: test
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/funcommute_test
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }}
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
E2E_LIVE_AI: '0'

- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
retention-days: 30
17 changes: 16 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

# next.js
/.next/
/.next.*/
/.swc/
/out/

# production
Expand All @@ -19,6 +21,7 @@
# misc
.DS_Store
*.pem
**/._*

# debug
npm-debug.log*
Expand All @@ -32,9 +35,21 @@ yarn-error.log*
# vercel
.vercel

# generated browser reports
/playwright-report/
/test-results/

# local Codex/OMO runtime evidence
/.omo/

# generated local Supabase migrations and runtime state
/supabase/migrations/
/supabase/.temp/
/supabase/.branches/

# typescript
*.tsbuildinfo
next-env.d.ts

.vercel
mcp.json
mcp.json
282 changes: 282 additions & 0 deletions DESIGN.md

Large diffs are not rendered by default.

30 changes: 16 additions & 14 deletions database/migrations/001_ai_pm_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ CREATE TABLE IF NOT EXISTS ai_conversations (
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- R
LS (Row Level Security) 정책 설정
-- RLS (Row Level Security) 정책 설정

-- projects 테이블 RLS 활성화
ALTER TABLE projects ENABLE ROW LEVEL SECURITY;
Expand Down Expand Up @@ -298,8 +297,8 @@ CREATE POLICY "Conversation creators and admins can delete conversations" ON ai_
SELECT 1 FROM user_profiles
WHERE id = auth.uid() AND role = 'admin'
)
);-
- 인덱스 생성으로 쿼리 성능 최적화
);
-- 인덱스 생성으로 쿼리 성능 최적화

-- projects 테이블 인덱스
CREATE INDEX IF NOT EXISTS idx_projects_created_by ON projects(created_by);
Expand Down Expand Up @@ -341,8 +340,8 @@ CREATE INDEX IF NOT EXISTS idx_ai_conversations_updated_at ON ai_conversations(u
-- 복합 인덱스: 프로젝트별 워크플로우 단계 대화 조회 최적화
CREATE INDEX IF NOT EXISTS idx_ai_conversations_project_workflow ON ai_conversations(project_id, workflow_step);
-- 복합 인덱스: 사용자별 대화 조회 최적화
CREATE INDEX IF NOT EXISTS idx_ai_conversations_user_project ON ai_conversations(user_id, project_id);-
- 트리거 함수 및 트리거 생성
CREATE INDEX IF NOT EXISTS idx_ai_conversations_user_project ON ai_conversations(user_id, project_id);
-- 트리거 함수 및 트리거 생성

-- updated_at 자동 업데이트 함수 (이미 존재할 수 있으므로 IF NOT EXISTS 사용)
CREATE OR REPLACE FUNCTION update_updated_at_column()
Expand Down Expand Up @@ -414,8 +413,9 @@ DROP TRIGGER IF EXISTS create_initial_planning_document_version ON planning_docu
CREATE TRIGGER create_initial_planning_document_version
AFTER INSERT ON planning_documents
FOR EACH ROW
EXECUTE FUNCTION create_initial_document_version();-- 유용한 뷰 및
함수 생성
EXECUTE FUNCTION create_initial_document_version();

-- 유용한 뷰 및 함수 생성

-- 프로젝트 멤버 정보와 사용자 프로필을 조인한 뷰
CREATE OR REPLACE VIEW project_members_with_profiles AS
Expand Down Expand Up @@ -445,7 +445,7 @@ SELECT
up.email as creator_email,
up.full_name as creator_name
FROM projects p
JOIN user_profiles up ON p.created_by = up.id;
LEFT JOIN user_profiles up ON p.created_by = up.id;

-- 문서 상세 정보 뷰 (작성자 및 승인자 정보 포함)
CREATE OR REPLACE VIEW planning_documents_with_users AS
Expand Down Expand Up @@ -482,8 +482,8 @@ RETURNS TABLE (
BEGIN
RETURN QUERY
WITH workflow_steps AS (
SELECT generate_series(1, 9) as step_num,
CASE generate_series(1, 9)
SELECT workflow.step_num,
CASE workflow.step_num
WHEN 1 THEN '서비스 개요 및 목표 설정'
WHEN 2 THEN '타겟 사용자 분석'
WHEN 3 THEN '핵심 기능 정의'
Expand All @@ -494,6 +494,7 @@ BEGIN
WHEN 8 THEN '성과 지표 및 측정 방법'
WHEN 9 THEN '런칭 및 마케팅 전략'
END as step_name
FROM generate_series(1, 9) AS workflow(step_num)
),
document_stats AS (
SELECT
Expand Down Expand Up @@ -549,8 +550,9 @@ BEGIN
(SELECT MAX(ac.updated_at) FROM ai_conversations ac WHERE ac.project_id = p.id)
) DESC NULLS LAST;
END;
$$ LANGUAGE plpgsql;-- 마
이그레이션 완료 로그
$$ LANGUAGE plpgsql;

-- 마이그레이션 완료 로그
DO $$
BEGIN
RAISE NOTICE 'AI PM 데이터베이스 스키마 마이그레이션이 완료되었습니다.';
Expand All @@ -572,4 +574,4 @@ COMMENT ON TABLE ai_conversations IS 'AI와의 대화 내역을 저장하는 테
COMMENT ON COLUMN planning_documents.workflow_step IS '워크플로우 단계 (1-9): AIPM.md의 9단계 프로세스';
COMMENT ON COLUMN planning_documents.status IS '문서 상태: private(개인), pending_approval(승인대기), official(공식)';
COMMENT ON COLUMN project_members.role IS '프로젝트 내 역할: 콘텐츠기획, 서비스기획, UIUX기획, 개발자';
COMMENT ON COLUMN ai_conversations.messages IS 'AI 대화 메시지 배열 (JSON 형태)';
COMMENT ON COLUMN ai_conversations.messages IS 'AI 대화 메시지 배열 (JSON 형태)';
12 changes: 6 additions & 6 deletions database/migrations/002_approval_workflow.sql
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ SELECT
p.name as project_name,
creator.email as creator_email,
creator.full_name as creator_name,
CASE pd.workflow_step
WHEN 1, 2, 3, 6, 7, 8 THEN '서비스기획'
WHEN 4 THEN 'UIUX기획'
WHEN 5 THEN '개발자'
WHEN 9 THEN '콘텐츠기획,서비스기획'
CASE
WHEN pd.workflow_step IN (1, 2, 3, 6, 7, 8) THEN '서비스기획'
WHEN pd.workflow_step = 4 THEN 'UIUX기획'
WHEN pd.workflow_step = 5 THEN '개발자'
WHEN pd.workflow_step = 9 THEN '콘텐츠기획,서비스기획'
END as required_approver_role
FROM planning_documents pd
JOIN projects p ON pd.project_id = p.id
Expand Down Expand Up @@ -294,4 +294,4 @@ COMMENT ON TABLE document_approval_history IS '문서 승인 히스토리를 추
COMMENT ON COLUMN document_approval_history.action IS '승인 액션: requested(요청), approved(승인), rejected(반려)';
COMMENT ON COLUMN document_approval_history.previous_status IS '이전 문서 상태';
COMMENT ON COLUMN document_approval_history.new_status IS '새로운 문서 상태';
COMMENT ON COLUMN document_approval_history.reason IS '반려 사유 (반려 시에만 사용)';
COMMENT ON COLUMN document_approval_history.reason IS '반려 사유 (반려 시에만 사용)';
2 changes: 1 addition & 1 deletion database/migrations/005_project_counts_view.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ SELECT
creator.full_name as creator_name
FROM
projects p
JOIN
LEFT JOIN
user_profiles creator ON p.created_by = creator.id;
5 changes: 4 additions & 1 deletion database/migrations/009_update_member_rls.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ CREATE POLICY "Project members and admins can add new members" ON project_member
)
);

RAISE NOTICE 'project_members 테이블의 INSERT 정책이 업데이트되었습니다.';
DO $$
BEGIN
RAISE NOTICE 'project_members 테이블의 INSERT 정책이 업데이트되었습니다.';
END $$;
4 changes: 2 additions & 2 deletions database/migrations/011_fix_project_counts_view_rls.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SELECT
creator.full_name as creator_name
FROM
projects p
JOIN
LEFT JOIN
user_profiles creator ON p.created_by = creator.id;

ALTER VIEW projects_with_counts SET (security_invoker = true);
ALTER VIEW projects_with_counts SET (security_invoker = true);
Loading
Loading