Migrate ExCS finished projects to complete - #1021
Open
zetter-rpf wants to merge 4 commits into
Open
zetter-rpf wants to merge 4 commits into
zetter-rpf wants to merge 4 commits into
Conversation
Test coverage93.57% line coverage reported by SimpleCov. |
raspberrypiherokubot
temporarily deployed
to
editor-api-p-migrated-m-kdtqcp
September 17, 2026 07:56
Inactive
zetter-rpf
force-pushed
the
migrated-mark-as-finished
branch
from
September 17, 2026 08:25
096400c to
847aee5
Compare
zetter-rpf
marked this pull request as ready for review
September 17, 2026 09:24
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Historical projects entering the complete state are not converted to submitted.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Migrates Experience CS projects marked as finished into the submitted state while suppressing Salesforce synchronization.
Changes:
- Converts eligible projects with transition metadata.
- Adds scoped Salesforce-sync suppression.
- Updates migration and model test coverage.
File summaries
| File | Summary |
|---|---|
spec/requests/experience_cs_project_migrations/update_spec.rb |
Tests migration conversion and sync suppression. |
spec/models/school_project_spec.rb |
Updates transition metadata expectations. |
lib/feature_flags.rb |
Adds scoped Salesforce suppression. |
app/models/school_project.rb |
Supports transition metadata. |
app/models/current.rb |
Stores request-scoped suppression state. |
app/controllers/api/experience_cs_project_migrations_controller.rb |
Performs migration conversion. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
zetter-rpf
marked this pull request as draft
September 17, 2026 09:34
zetter-rpf
force-pushed
the
migrated-mark-as-finished
branch
from
September 17, 2026 13:16
847aee5 to
1668ccd
Compare
zetter-rpf
force-pushed
the
migrated-mark-as-finished
branch
from
September 17, 2026 13:21
1668ccd to
de87af8
Compare
Previously Experience CS marked projects submitted by setting school_projects.finished, bypassing the state machine we use for other classroom projects. So it's clear that these are from a migration and not submitted by the student at the time that the transition happened, I've avoided setting the user id and added metadata to the transition. I've chosen to make the projects as completed rather than submitted as this is what the original backfill did when project states were introduced - the worry was changing them to submitted would create a backlog for teachers to review. fixup
Previously Every ExCS project migration would a Salesforce::LessonSyncJob, because updating the school project to set finished to false would trigger after_commit sync. Because we are swapping a finished count to a submitted, the number we sync to salesforce won't change. Migrating thousands of projects would queue thousands of syncs for data that has not meaningfully changed. I've done this by using a request attribute that is set and restored in the block
I was trying to run this locally and it didn't work because it was pointing to the wrong directory
The intention of this number is that it's projects that have been completed by students, while the finished_projects count only tracks projects that are waiting for teacher feedback.
zetter-rpf
force-pushed
the
migrated-mark-as-finished
branch
from
September 17, 2026 13:23
de87af8 to
cecab6f
Compare
zetter-rpf
marked this pull request as ready for review
September 17, 2026 13:28
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Status
Points for consideration:
This changes:
I've put the ability to disable the salesforce sync in as the syncing serves no purpose for this change (as the sync currently adds the finished projects to the submitted ones) and I am worried the the volume of syncs will slow down the migration.
See commits for more