Set origin when syncing ExCS projects - #1006
Merged
Merged
Conversation
Test coverage93.57% line coverage reported by SimpleCov. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped, aligns with existing ExCS origin behavior, and is covered by targeted request and unit specs.
Pull request overview
Ensures Experience CS (ExCS) projects have origin = experience_cs set consistently when they are synced/updated via the ExCS admin/service flows, including migrations, aligning update behavior with existing authenticated creation behavior in the Rails API domain layer.
Changes:
- Pass
current_userintoProject::Updateand setoriginwhen the updater is an ExCS admin/service account. - Set
originduring Experience CS project migration updates. - Add request/unit specs to cover origin-setting behavior for ExCS update/migration paths and ensure non-ExCS updates don’t set origin.
File summaries
| File | Description |
|---|---|
| spec/requests/projects/update_spec.rb | Adds request coverage to assert origin behavior for ExCS admin/service updates and unchanged origin for normal updates. |
| spec/requests/experience_cs_project_migrations/update_spec.rb | Extends migration request expectations to include origin: experience_cs. |
| spec/concepts/project/update_spec.rb | Adds unit coverage for setting origin when current_user is an ExCS admin. |
| lib/concepts/project/operations/update.rb | Adds current_user input and assigns origin for ExCS admin/service updates. |
| app/controllers/api/projects_controller.rb | Passes current_user through to Project::Update so the operation can apply ExCS-specific behavior. |
| app/controllers/api/experience_cs_project_migrations_controller.rb | Sets origin while migrating a stub project into an ExCS project. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 0
- 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
approved these changes
Sep 9, 2026
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
Why this bug
experience_csis added tooriginduring authenticated project creation, not sent by ExCS.What's changed?