Skip to content

Development: Fix pair programming status during analysis pipeline#211

Merged
az108 merged 5 commits intomainfrom
fix-pair-programming
Mar 5, 2026
Merged

Development: Fix pair programming status during analysis pipeline#211
az108 merged 5 commits intomainfrom
fix-pair-programming

Conversation

@az108
Copy link
Copy Markdown
Collaborator

@az108 az108 commented Mar 5, 2026

Checklist

General

  • I tested all changes and their related features with all corresponding user types.

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) and too complex database calls.
  • I strictly followed the principle of data economy for all database calls.
  • I strictly followed the server coding and design guidelines.
  • I documented the Java code using JavaDoc style.

Client

  • Important: I implemented the changes with a very good performance, prevented too many (unnecessary) REST calls and made sure the UI is responsive, even with large data (e.g. using paging).
  • I strictly followed the principle of data economy for all client-server REST calls.
  • I strictly followed the client coding and design guidelines.
  • I documented the React code.

Motivation and Context

Fixes #210

After making the server the single source of truth for PP status, all teams showed NOT_FOUND badges when no attendance was uploaded, PP badges disappeared during analysis phases, failed teams were excluded from PP analysis, and an async recompute raced with AI analysis.

Description

Server changes:

  • PairProgrammingService: getPairProgrammingStatus() and calculateScore() return null when no attendance data exists (no Excel uploaded), instead of NOT_FOUND
  • AnalysisResultPersistenceService: Move calculateGitOnlyCqi() before checkAndMarkFailed() so PP is computed for all teams including failed ones. Stop clearing PP fields when marking teams as failed. Include cqiDetails in the failed team response DTO.
  • AnalysisQueryService: reconstructCqiDetails() now returns a result when only PP fields are set (for failed teams on page refresh)
  • StreamingAnalysisPipelineService: Run PP recompute synchronously after GIT_DONE (instead of async) to avoid race condition with AI analysis

Client changes:

  • TeamsList/TeamDetail: Show yellow "Pending" PP badge for all teams without PP status when attendance is uploaded (covers failed teams, DONE teams, and all in-progress states)
  • TeamsList: AI_ANALYZING teams now sort above completed teams
  • Teams page: Removed uploadedAttendanceFileName dependency from PP recomputing poll

Steps for Testing

Prerequisites:

  1. Log in to Harmonia
  2. Select a course and exercise with pair programming enabled

Test 1: No attendance uploaded

  1. Start analysis without uploading attendance
  2. Verify no PP badges appear at any phase (not NOT_FOUND)

Test 2: Attendance uploaded before analysis

  1. Upload attendance Excel
  2. Start analysis (FULL or SIMPLE mode)
  3. During PENDING/DOWNLOADING/GIT_ANALYZING → yellow "Pending" PP badges for all teams
  4. After GIT_DONE → correct PASS/FAIL/NOT_FOUND/WARNING badges appear (including for failed teams)
  5. AI_ANALYZING teams appear above completed teams

Test 3: Attendance uploaded during analysis

  1. Start analysis without attendance
  2. Upload attendance while analysis runs
  3. Press upload → correct PP badges appear after recompute

Test 4: Page refresh

  1. After analysis completes, refresh the page
  2. All PP badges (including for failed teams) should persist from DB

Review Progress

Code Review

  • Code Review 1

Manual Tests

  • Test 1

Screenshots

🤖 Generated with Claude Code

az108 and others added 4 commits March 5, 2026 04:22
- Return null from getPairProgrammingStatus/calculateScore when no attendance
  data exists (instead of NOT_FOUND for every team)
- Compute PP status for all teams including failed ones by moving
  calculateGitOnlyCqi before checkAndMarkFailed
- Preserve PP fields in checkAndMarkFailed (don't clear them)
- Run PP recompute synchronously after GIT_DONE to avoid race with AI analysis
- Show yellow "Pending" PP badge during all analysis phases (including for
  failed/DONE teams when attendance is uploaded)
- Fix AI_ANALYZING sort order to appear above completed teams
- Fix reconstructCqiDetails to return results when only PP fields are set

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
On GIT_DONE, fetch team summaries from DB and selectively merge only
pairProgrammingStatus and PP sub-metrics into the SSE-driven cache.
This preserves analysisStatus (AI_ANALYZING etc.) while picking up
PP statuses from the synchronous recompute.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolve conflicts in Teams.tsx: keep PP merge logic in onGitDone
and adopt main's templateAuthors accumulation pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@az108 az108 changed the title Bugfix: Fix pair programming status during analysis pipeline Development: Fix pair programming status during analysis pipeline Mar 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 5, 2026

🤖 No OpenAPI or client changes needed.

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 5, 2026

🤖 No OpenAPI or client changes needed.

@az108 az108 merged commit 7acae4d into main Mar 5, 2026
12 checks passed
@az108 az108 deleted the fix-pair-programming branch March 5, 2026 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pair programming status: NOT_FOUND shown for all teams, badges missing during analysis

1 participant