-
Notifications
You must be signed in to change notification settings - Fork 4
PostgreSQL Enabled TaskFlow #261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8f43dc9
added debug script
mikedane-bitovi bb0a185
added combined logging and orchestration
mikedane-bitovi a1ddfa2
added bug and report
mikedane-bitovi 2ee8c31
added better test running for debugging
mikedane-bitovi 362fd83
using postgresql
mikedane-bitovi 94e6a73
added postgres mcp
mikedane-bitovi 315a79a
added buggy data
mikedane-bitovi d3a380c
added database step to debug prompt
mikedane-bitovi c8d5250
updated seed file
mikedane-bitovi 3c0329c
added env to commit for demo purposes only
mikedane-bitovi 7394b02
added copilot instructions
mikedane-bitovi 96fd16c
removed debug logs
mikedane-bitovi c623078
pinned prisma version
mikedane-bitovi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| FROM node:24-alpine | ||
| RUN apk add --no-cache bash git curl python3 make g++ pkgconf sqlite sqlite-dev | ||
| RUN apk add --no-cache bash git curl python3 make g++ pkgconf postgresql-client | ||
| WORKDIR /workspaces/${localWorkspaceFolderBasename} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| version: '3.8' | ||
| services: | ||
| app: | ||
| build: | ||
| context: .. | ||
| dockerfile: .devcontainer/Dockerfile | ||
| volumes: | ||
| - ..:/workspaces/${localWorkspaceFolderBasename}:cached | ||
| command: sleep infinity | ||
| environment: | ||
| DATABASE_URL: postgresql://taskflow:taskflow@db:5432/taskflow | ||
| depends_on: | ||
| db: | ||
| condition: service_healthy | ||
|
|
||
| db: | ||
| image: postgres:16-alpine | ||
| restart: unless-stopped | ||
| environment: | ||
| POSTGRES_USER: taskflow | ||
| POSTGRES_PASSWORD: taskflow | ||
| POSTGRES_DB: taskflow | ||
| ports: | ||
| - "5432:5432" | ||
| volumes: | ||
| - postgres_data:/var/lib/postgresql/data | ||
| healthcheck: | ||
| test: [ "CMD-SHELL", "pg_isready -U taskflow" ] | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 5 | ||
|
|
||
| volumes: | ||
| postgres_data: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # THIS FILE WILL NOT BE IGNORED BY GIT, USE FOR DEMO PURPOSES ONLY | ||
| # You can store environment variables here for local development | ||
| # IMPORTANT: DO NOT STORE SENSITIVE INFORMATION IN THIS FILE!! | ||
|
|
||
| # Database Configuration | ||
| DATABASE_URL="postgresql://taskflow:taskflow@localhost:5432/taskflow" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| See `package.json` for the available project scripts and dependencies. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| You are a senior developer helping to debug issues in a codebase. A user has reported a bug and you need to help them identify and fix the issue by examining the bug report outlined in `BUG_REPORT.md`. | ||
|
|
||
|
|
||
| Follow these steps to debug the issue: | ||
| 1. **Understand the Bug Report**: Carefully read the bug report to understand the issue, including the steps to reproduce, current behavior, expected behavior, and environment details. | ||
| 2. **Identify Relevant Code Areas**: Based on the bug report, identify which parts of the codebase are likely involved in the issue (e.g., task editing logic, database update functions, UI components). | ||
| 3. **Check the database**: Access the PostgreSQL MCP server to inspect the current state of the database. Ensure that all data is correct and consistent with expectations. | ||
| 4. **Add logging**: Add logs to both the front end and back end code paths involved. In every log, include which file you're in as well as the function and any other relevant information. This will help trace the flow of data and identify where the update is failing. | ||
| 5. **Run the tests**: Run the unit and E2E tests to see if the bug can be reproduced in the test environment. Note any failures or unexpected behaviors. | ||
| - Unit tests can be run with `npm run test` | ||
| - E2E tests can be run with `npm run test:e2e:debug` (use :debug here to see logs from both front end and back end). | ||
| - E2E tests can be filtered using the `-g` option to focus on tests related to the bug report. For example, if the bug report is about editing a task via a modal form, you can run: | ||
| ``` | ||
| npm run test:e2e:debug -- -g "edit task via modal form" | ||
| ``` | ||
| 6. **(OPTIONAL) Write a new test**: If no existing test covers the bug scenario, write a new unit or E2E test that reproduces the bug based on the steps provided in the bug report. This will help ensure that the bug is captured and can be verified as fixed later. Run the new test to confirm it fails as expected. | ||
| 7. **Fix the Bug**: Investigate the logs and code to identify the root cause of the issue. Implement a fix to ensure that the task assignee updates correctly and persists after a page refresh. | ||
| 8. **Verify the Fix**: Re-run the unit and E2E tests to confirm that the bug has been resolved and that no other functionality is broken. | ||
| 9. **Clean Up**: Remove any logging added during the debugging process to keep the codebase clean. | ||
|
|
||
| --- | ||
|
|
||
| **IMPORTANT**: Whenever you run the e2e tests use the `npm run test:e2e:debug` command to get detailed logs from both the front end and back end. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "servers": { | ||
| "postgres": { | ||
| "command": "npx", | ||
| "args": [ | ||
| "-y", | ||
| "@modelcontextprotocol/server-postgres", | ||
| "postgresql://taskflow:taskflow@localhost:5432/taskflow" | ||
| ] | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,48 @@ | ||||||
| # Bug Report: Missing Tasks on Kanban Board | ||||||
|
|
||||||
| ## 📝 Description | ||||||
|
|
||||||
| Tasks are disappearing from the Kanban board view. Users report that when they navigate to `/board`, they only see a fraction of their tasks, even though the complete list is visible on the `/tasks` page. | ||||||
|
|
||||||
| ## 🔴 Severity | ||||||
|
|
||||||
| **High** - This significantly impacts user experience and makes the board view nearly unusable. | ||||||
|
|
||||||
| ## 📍 Location | ||||||
|
|
||||||
| - **Page:** `/board` (Kanban Board) | ||||||
| - **Component:** `components/kanban-board.tsx` | ||||||
| - **Related:** `app/(dashboard)/board/page.tsx` | ||||||
|
|
||||||
| ## 🪜 Steps to Reproduce | ||||||
|
|
||||||
| 1. Navigate to the Tasks page at `/tasks` | ||||||
| 2. Note the total number of tasks displayed (should be 30) | ||||||
| 3. Navigate to the Board page at `/board` | ||||||
| 4. Observe that only a small subset of tasks appear on the board | ||||||
| 5. Count the tasks on each column - the total is much less than expected | ||||||
|
|
||||||
| ## ✅ Expected Behavior | ||||||
|
|
||||||
| All 30 tasks should be distributed across the four Kanban columns: | ||||||
| - **To Do** - Tasks with status "todo" | ||||||
| - **In Progress** - Tasks with status "in_progress" | ||||||
| - **Review** - Tasks with status "review" | ||||||
| - **Done** - Tasks with status "done" | ||||||
|
|
||||||
| The total count across all columns should match the total tasks in the database. | ||||||
|
|
||||||
| ## ❌ Actual Behavior | ||||||
|
|
||||||
| Only approximately 7 tasks appear on the Kanban board, while 23 tasks are missing. The task counts on the board columns are significantly lower than expected. | ||||||
|
|
||||||
| ## 🔍 Initial Observations | ||||||
|
|
||||||
| 1. The tasks DO exist in the database (visible on `/tasks` page) | ||||||
| 2. The issue seems to be with how tasks are being filtered or queried for the board | ||||||
| 3. No errors are shown in the console or logs | ||||||
| 4. The issue is consistent across all users | ||||||
|
|
||||||
| ## IMPORTANT Considerations | ||||||
|
|
||||||
| - Any modifications to data in the database must use the PostgreSQL MCP server. | ||||||
|
||||||
| - Any modifications to data in the database must use the PostgreSQL MCP server. | |
| - Any modifications to data in the database must use the PostgreSQL MCP server. Please use the official MCP management interface or the provided SQL scripts as documented in [MCP Server Guide](https://company-internal-docs/mcp-server-guide) to ensure data consistency and audit compliance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
.envfile should not be committed to version control as it can contain sensitive information. While the comment at the top indicates this is for demo purposes only, the.gitignorechanges show.env*files are now being tracked (lines 33-35 are commented out). This is a security risk. Even for demo purposes, use.env.examplefor sample configurations and keep.envin.gitignore.