Skip to content

Conversation

@mroderick
Copy link
Collaborator

@mroderick mroderick commented Feb 1, 2026

The branch from this PR has been branched from #2455, please review and merge that one first and then rebase this one.


Summary

This PR includes two major improvements:

1. Fix Issue #2367 - Empty coaches list in workshop feedback form

Problem: When students tried to submit workshop feedback, the coaches dropdown was empty and they couldn't complete the form.

Root Cause: The feedback controller filtered for coaches where attended=true, but:

  • Feedback emails are sent the day after workshops
  • Coaches are only marked attended=true when organizers manually verify attendance
  • At feedback time, coaches have attending=true but attended=nil

Solution:

  • Changed query to use accepted_or_attended scope (includes coaches who either RSVP'd OR had attendance verified)
  • Added ORDER BY attended DESC NULLS LAST to prioritize verified coaches first
  • Students can now submit feedback immediately without waiting for attendance verification

Tests Added:

  • Test for coaches who RSVP'd but haven't been verified yet
  • Test for verified coaches appearing before unverified coaches in dropdown

Fixes #2367

Test Results

All tests passing:

  • ✅ 9/9 feedback tests pass
  • ✅ Full test suite passes in parallel
  • ✅ Coverage maintained at ~95%

Screenshots

Before (Issue #2367)

No coaches in dropdown - user cannot submit feedback

After (Issue #2367)

Coaches appear in dropdown, verified coaches listed first

Resolves issues with two failing feature tests that were timing-dependent
when interacting with Chosen.js select dropdowns.

Changes:
- Rewrote select_from_chosen helper to use JavaScript instead of simulating clicks
- Increased Capybara.default_max_wait_time to 5 seconds for JS tests
- Added explicit waits for Chosen dropdown initialization
- Used select_from_chosen helper consistently across tests

The new approach directly sets select values via JavaScript and triggers
Chosen's update events, avoiding race conditions from clicking and typing
into the animated dropdown UI.

All 777 tests now pass consistently with seed 63863.
Suppress Puma startup messages during test runs to reduce noise
and make test output easier to read.
Configure parallel test execution to speed up CI builds and local
test runs.

## Changes

- Add parallel_tests gem for running tests concurrently
- Configure database.yml to support TEST_ENV_NUMBER for parallel databases
- Update GitHub Actions workflow to run tests across 4 parallel runners
- Configure SimpleCov to merge coverage results from parallel runs

## Local Usage

Run tests in parallel with 4 processes:
```
bundle exec parallel_rspec spec/ -n 4
```

Run with a specific seed:
```
bundle exec parallel_rspec spec/ -n 4 -o '--seed 1234'
```

One-time setup (creates test, test2, test3, test4 databases):
```
bundle exec rake parallel:setup
```

## Performance

Local verification shows 1.84x speedup (162s → 88s) with identical
coverage results (95.19%). Expected similar speedup in CI.
Configure SimpleCov to generate unique coverage files for each parallel
CI runner and merge them for reporting.

Changes:
- Detect CI parallel execution via CI_NODE_INDEX environment variable
- Generate unique command names (RSpec-0, RSpec-1, etc.) per runner
- Preserve resultset files immediately after test completion
- Merge all resultsets in separate coverage job before reporting

Local parallel execution still works using TEST_ENV_NUMBER detection.
Improves CI speedup from 1.84x to 2.35x based on local testing.
Each runner now handles ~17 specs instead of ~26.
Resolves issue where no coaches appeared in the feedback dropdown when
students tried to submit workshop feedback.

Root cause: The feedback controller was filtering for coaches where
attended=true, but attendance is only marked after organizers manually
verify it. When feedback emails are sent (the day after workshop),
coaches have attending=true but attended=nil.

Changes:
- Updated set_coaches to use accepted_or_attended scope instead of attended
- Added ORDER BY with NULLS LAST to prioritize verified coaches first
- Added test for coaches who RSVPd but haven't been verified yet
- Added test for verified coaches appearing before unverified coaches

This allows students to submit feedback immediately after workshops,
even before organizers verify attendance, while still prioritizing
verified coaches when that data is available.

Fixes codebar#2367
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.

Codebar Workshop Feedback Submit

1 participant