Skip to content
This repository was archived by the owner on Oct 28, 2026. It is now read-only.

Add a mode that deploys the staging tree as it stands - #29

Merged
Zippybonzo merged 1 commit into
mainfrom
claude/deployment-composer-merge-plugins-1hk6gi
Aug 24, 2026
Merged

Zippybonzo merged 1 commit into
mainfrom
claude/deployment-composer-merge-plugins-1hk6gi

Conversation

@Zippybonzo

Copy link
Copy Markdown
Member

The escape hatch for work that never came from a ref: a file edited directly on staging, a patch applied by hand, a checkout repaired in place.

Sync staging (/deployments/sync) deploys /srv/mediawiki-staging exactly as it is on disk — no fetch, no checkout, nothing selected. The plan is the full-tree rsync-local, then rsync-remote per appserver, with the same staging canary gate, per-server canary, l10n option and depool/repool rollout every other deployment gets. Two-step wizard (options → review), since there is nothing to pick.

How it works

The pipeline needed almost no special-casing. ShimCalls::syncPlanFor() returns a full-tree plan for the new DeploymentIntent::SyncStaging, and with no line items the git and patch preparation steps fall away on their own. Planner and runner still go through that one method, so the reviewed plan is literally what runs.

The wizard drops its selection step rather than rendering an empty picker, and the server refuses submitted items under this intent (prohibited) instead of silently ignoring them.

Permissions

Gated on its own permission, deploy.sync_staging, rather than the per-type deploy grants — it is not scoped to a repository, so it ships whatever anyone else has staged too. Enforced in both places as everything else here is: StoreDeploymentRequest + DeploymentPolicy for the form, DeploymentAuthorizer for the job. Seeded for ops and mediawiki-admins; existing installs pick it up by re-running the seeder.

Staging-only is still offered for a sync (it updates the production tree on the staging host and runs its canary, without touching appservers), so an account without deploy.production_servers can use the mode in that limited form — consistent with how the other intents treat that permission.

No undo point

Recording no refs means no snapshot, so rollback is not offered afterwards and a failed sync enqueues none: the deployment never changed the staging tree, so there is nothing to undo. Both the wizard and the run screen say so, and the history row reads "Synced /srv/mediawiki-staging as it stood" rather than showing an empty line-item list.

Verification

New tests/Feature/SyncStagingTest.php, 12 tests: whole-tree rsync with no --path, never touches git, canary still gates the rollout, staging-only stops after the local sync, no rollback on failure, the three wizard endpoints, items refused, and both halves of the permission check.

Full suite 236/236 green, Pint clean, npm run build succeeds.


Generated by Claude Code

The escape hatch for work that never came from a ref: a file edited
directly on staging, a patch applied by hand, a checkout repaired in
place. "Sync staging" (/deployments/sync) carries no line items and does
no git work at all — the plan is the full-tree rsync plus the same canary
gate and depool/repool rollout every other deployment gets.

The pipeline needed almost nothing for it: syncPlanFor() returns a
full-tree plan for the new intent, and with no refs the preparation steps
fall away on their own. The wizard drops its selection step rather than
showing an empty picker, and the server refuses submitted items under this
intent instead of ignoring them.

Gated on its own permission (deploy.sync_staging) rather than the
per-repository deploy grants, because it is not scoped to a repository: it
ships whatever anyone else has staged too. Checked in both places, as
everything else is — the form and DeploymentAuthorizer. Seeded for ops and
mediawiki-admins.

Recording no refs also means no undo point, so rollback is not offered
afterwards and a failed sync enqueues none: nothing about the staging tree
was changed by the deployment, so there is nothing to undo.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QKzD8eUV1sT45NMNnjKSAg
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 10 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a6ec71c6-73d2-43f8-abeb-c9d223bec937

📥 Commits

Reviewing files that changed from the base of the PR and between 14d812f and ba30b8f.

📒 Files selected for processing (19)
  • README.md
  • app/Actions/Deployments/CreateDeployment.php
  • app/Enums/DeploymentIntent.php
  • app/Http/Controllers/Api/BootstrapController.php
  • app/Http/Controllers/Api/DeploymentWizardController.php
  • app/Http/Requests/StoreDeploymentRequest.php
  • app/Models/Deployment.php
  • app/Policies/DeploymentPolicy.php
  • app/Services/Deployment/DeploymentAuthorizer.php
  • app/Services/Deployment/DeploymentPlanner.php
  • app/Services/Deployment/DeploymentRunner.php
  • app/Services/Salt/ShimCalls.php
  • app/Support/Permissions.php
  • database/seeders/RolesAndPermissionsSeeder.php
  • resources/js/apps/deployments/components/DeployOptions.vue
  • resources/js/apps/deployments/manifest.js
  • resources/js/apps/deployments/pages/DeployWizardPage.vue
  • resources/js/apps/deployments/pages/DeploymentShowPage.vue
  • tests/Feature/SyncStagingTest.php

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Zippybonzo
Zippybonzo merged commit bfe0334 into main Aug 24, 2026
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants