SiSi

SiSi Documentation › Product Development Process

Staging Instances

Feature staging slots let a developer and designer test a branch before it merges. Each slot is a full copy of the platform with its own database. Slots are tracked in the Staging Inventory list in ClickUp.

Main Staging is separate: it always runs main, and it is where QA happens after merge. Never claim or deploy to it by hand. See Main Staging.

Slots #

Each slot has a letter, a git branch named deploy/staging/<letter>, and its own URL in the form https://<letter>.sisi.staging.mysisi.app. For example, slot A is a.sisi.staging.mysisi.app.

Claim a slot #

  1. Find an available slot in the Staging Inventory list.
  2. Assign it to yourself.
  3. Fill in its Feature field with what you are testing.

Deploy to a slot #

First update the slot's branch to include your changes. From a branch you already have:

git push -f origin <your-feature-branch>:deploy/staging/<letter>

Make sure you push to the right branch. For follow-up pushes, this safer form only overwrites the branch if your local copy of it matches the remote:

git push --force-with-lease origin <your-feature-branch>:deploy/staging/<letter>

Then run both GitHub Actions, selecting the slot's branch (deploy/staging/<letter>):

When each deploy finishes, it records the slot's URL on the PR, in a comment listing the commit each deploy put on the slot, and in each linked task's Staging Instance field. It finds the PR by matching the deployed commit to an open PR's head commit. If you deployed a commit that isn't your PR's head, enter the PR number in the deploy's pr-number input.

If the server goes down #

After a large database update, a slot's server sometimes goes down. In the browser console this shows as a 504 error or a CORS error, depending on the browser; a request to the server directly shows the 504. Give it 5 minutes. If it's still down after that, run the backend deploy again. This can also happen on demo, but not on production.

Release a slot #

When you are done with a slot, unassign yourself and clear its Feature field in the Staging Inventory list.

Renamed or modified migrations #

If you rename or modify a migration that has already been applied to a slot, the slot's database needs a manual fix. Fill out the Staging Database Modification Request Form with the SQL to run. Once you get confirmation that it has been applied, redeploy the backend.

Renaming a migration #

UPDATE migration SET id = '0000-new-name-a.sql' WHERE id = '0000-old-name-a.sql';
UPDATE migration SET id = '0000-new-name-b.sql' WHERE id = '0000-old-name-b.sql';

Modifying a migration #

Send SQL that brings the database to the right shape, including any changes to the migration table. Either:

For example, if this migration:

CREATE TABLE "table" ("name" varchar);

changes to:

CREATE TABLE "table" ("name" varchar DEFAULT '');

the patch is:

ALTER TABLE "table" ALTER COLUMN "name" SET DEFAULT '';

and the unapply-and-reapply version is:

DROP TABLE "table";
DELETE FROM migration WHERE id = '0000-migration.sql';

Full reset #

Sometimes it's simpler to wipe the database and start again. This deletes the database and all of its contents, runs the migrations on a fresh database, and repopulates the data from scratch. Fill out the same form and put "Full reset" in the SQL Code field.

Main Staging #

Main Staging deploys automatically on every push to main that changes the frontend or backend, including release commits. Deploys queue rather than cancel each other, so the latest commit always ends up there. It is where QA tests merged work, and it is never recorded on a task's Staging Instance field.