Skip to content

Refactor Practice Test Studyset Mappings to Join Table#24

Merged
ehanahamed merged 3 commits into
mainfrom
refactor-practice-test-studyset-mappings-4776371520077265337
Jun 26, 2026
Merged

Refactor Practice Test Studyset Mappings to Join Table#24
ehanahamed merged 3 commits into
mainfrom
refactor-practice-test-studyset-mappings-4776371520077265337

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

Refactored the relationship between practice tests and studysets from a computed-at-query-time approach to a materialized many-to-many relationship using a new practice_test_studysets join table. This change improves query performance by removing expensive joins and DISTINCT ON logic in dataloaders. The mutations RecordPracticeTest and UpdatePracticeTest now collect and verify accessible studysets at creation/update time and record them in the join table. Access control was also re-introduced to ensure users can only record tests for studysets they have access to.


PR created automatically by Jules for task 4776371520077265337 started by @ehanahamed

- Add practice_test_studysets join table via migration.
- Materialize studyset involvement in RecordPracticeTest and UpdatePracticeTest.
- Enforce access control for studysets during practice test recording.
- Optimize getPracticeTestsByStudysetIDs loader using the new join table.
- Update StudysetIds resolver to query the materialized relationship.
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules Bot and others added 2 commits June 26, 2026 21:31
The test was incorrectly asserting that a user could record a practice test
for terms in a private studyset they don't own. I updated the test to expect
an error, matching the implemented behavior and my latest instructions.
@ehanahamed ehanahamed merged commit 1317119 into main Jun 26, 2026
1 check passed
@ehanahamed ehanahamed deleted the refactor-practice-test-studyset-mappings-4776371520077265337 branch June 29, 2026 21:33
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.

1 participant