Repository navigation
Conversation
Each slot is an independent Compose project (ppdev-sN) with its own ports, hostname (ppN.localhost), secrets and state under dev-stack/slots/N. scripts/pr.sh checks a pull request out into a worktree and runs it on a slot; slot.sh manages slots; fixture.sh saves, loads and checks complete slot states, with fixtures/default as a committed seed recipe. The server gains PEOPLEPORTAL_CORS_ORIGINS so a slot's UI origin can be allowed. Documented in dev-stack/PARALLEL.md.
This branch has not been deployed
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.
What
Run several independent People Portal dev stacks side by side, one per pull request, without touching the default
ppdevstack.up.sh --slot N/--pr N): each slot is its own Compose project (ppdev-sN), volumes, network, secrets and hostname (ppN.localhost), with a fixed port block20000 + N*20 + offsetand state under the gitignoreddev-stack/slots/N/. Ports and hostname are forced bycommon.sh, so two slots can never collide.scripts/pr.sh <n>: fetchespull/<n>/headinto a detached worktree at${PP_PR_DIR:-~/pp-pr}/<n>, installs deps withnpm ci(lockfile-hash stamp,npm install --no-package-lockfallback, lockfile restored afterwards), brings the slot up, loads a fixture and starts the server and UI from the worktree on the slot's ports.--down [--purge]tears it down. Idempotent.scripts/slot.sh:list,urls,server,ui,stop-apps,down [--purge], all acceptingNorpr:N.scripts/fixture.sh:save/load/check/list. Snapshots capture Mongo, the Authentik Postgres database and the Gitea volume; loading realigns the Authentik admin password and token, reapplies the blueprint for the target slot's redirect URIs, resets the Gitea admin and token, and retargets Gitea webhooks to the new portal port.fixtures/defaultis a committed, idempotent recipe (13 users, two teams, 10 applications; passwordportal-dev).fixture-check.pyverifies every Mongo pk reference against Authentik.PEOPLEPORTAL_CORS_ORIGINS(comma separated, default unchanged) so a slot's UI origin can be allowed.dev-stack/PARALLEL.md,fixtures/README.md, a "Parallel stacks" section in the dev-stack README.Why
Reviewing or testing more than one PR at a time currently means tearing down and re-seeding the single stack. With slots, each PR gets a full, isolated environment with the same seeded data, reachable at its own
ppN.localhosthost so browser sessions don't clobber each other.How to use
Gotchas
docker compose stop/reset.sh.PP_DEV_PORTAL_PORToverride and would proxy/apitolocalhost:3000;pr.shwarns.dev-stack; a PR that changes the stack itself has to be run from its own worktree.How it was tested
pr.sh: slots 1 and 2, 16 containers healthy, no overlapping listeners (lsof), default stack ports untouched.fixture.sh checkreports 26 cross-service references, 0 orphaned; 10 applications and 15 Authentik users per slot./api/auth/loginredirect carries each slot's ownredirect_uri(ppN.localhost:<portal port>)./api/auth/userinfo) succeeds for seeded users on both slots.fixture.sh save test-snap --slot 1thenload test-snap --slot 2: a marker written in slot 1 appears in slot 2, Gitea webhooks retargeted, consistency check clean, logins still work in both slots afterwards.pr.shre-run on a running slot: worktree already at head, dependencies skipped, apps restarted. This surfaced a shutdown race inslot.sh stop-apps(fixed: it now waits for the process tree to exit).pr.sh --down --purgefor both PRs: containers, volumes, slot state, registry entries and worktrees removed.bash -nand shellcheck on the scripts.