Sync Synapse custom modules to staging/prod#5316
Conversation
Extend the Synapse template-sync workflow to also ship the custom Python modules under packages/matrix/support/synapse/modules (the OIDC user_mapping_provider) to S3, so staging/prod Synapse can import them. - Rename sync-synapse-templates.yml -> sync-synapse-assets.yml (no longer template-only). - Trigger on changes under modules/** in addition to templates/**. - Add a second `aws s3 sync` pushing modules -> s3://$BUCKET/modules, excluding test files. The existing force-new-deployment step already restarts Synapse and picks up both synced directories. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a8ddefd18a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| paths: | ||
| - "packages/matrix/support/synapse/templates/**" | ||
| - "packages/matrix/support/synapse/modules/**" |
There was a problem hiding this comment.
Include workflow edits in the push paths
When this PR lands by itself, the push.paths filter is evaluated against the files changed by that push; GitHub's workflow syntax docs state, “If at least one path matches,” the workflow runs. This commit only renames/edits .github/workflows/sync-synapse-assets.yml, so neither listed path matches and the promised automatic staging sync/restart will not happen; the module added earlier remains absent from S3 until someone manually dispatches the workflow or a later templates/modules change occurs. Include the workflow file in the path filter for this bootstrap case or otherwise make the initial sync explicit.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
Extends the GitHub Actions workflow that syncs Synapse assets to S3 so it ships both Synapse email templates and custom Synapse Python modules (for the OIDC user mapping provider), and restarts the target ECS service to pick up the updated assets.
Changes:
- Rename/re-scope the workflow from “templates-only” to “assets” and broaden the push trigger to include
modules/**. - Add an
aws s3 syncstep to publishpackages/matrix/support/synapse/modulesintos3://$BUCKET/modules, excluding test files. - Update the concurrency group name to reflect the broader workflow purpose.
Comments suppressed due to low confidence (1)
.github/workflows/sync-synapse-assets.yml:24
- To reliably honor the workflow_dispatch
environmentinput, prefer the same fallback pattern used elsewhere in the repo (e.g.manual-deploy.yml), sinceinputs.*can be unavailable in some workflow expression contexts. Without the fallback, manual runs may incorrectly default into the staging concurrency group.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What
Extends the Synapse asset-sync workflow to ship the custom Python modules under
packages/matrix/support/synapse/modules(the OIDCuser_mapping_provideradded in #5300) to staging/prod Synapse, alongside the existing email-template sync.sync-synapse-templates.yml→sync-synapse-assets.yml— the workflow is no longer template-only.modules/**in addition totemplates/**.aws s3 syncstep pushingmodules→s3://$BUCKET/modules, excluding test files (--exclude "test_*").aws ecs update-service --force-new-deploymentstep already restarts Synapse and picks up both synced directories.Why
Part of provisioning Google sign-in on staging. The dev mapping provider currently only runs locally; this carries it to the deployed Synapse. The matching
cardstack/infraPR mountss3://$BUCKET/modulesinto the container at/data/modulesand setsPYTHONPATHso Synapse can import it.Sequencing
This is one of three PRs. It is safe to merge independently — it only makes the module available in S3. The host feature-flag flip (a separate PR) lands last, after the infra OIDC config is deployed and verified.
Testing
After merge, the
Sync Matrix Synapse Assetsworkflow run should pushboxel_oidc_mapping_provider.pytos3://cardstack-matrix-synapse-staging/modulesand restartsynapse-staging.🤖 Generated with Claude Code