feat: add TL;DR block to DBLab 4.1 post and restore preview envs#33
Draft
NikolayS wants to merge 2 commits into
Draft
feat: add TL;DR block to DBLab 4.1 post and restore preview envs#33NikolayS wants to merge 2 commits into
NikolayS wants to merge 2 commits into
Conversation
- Add blog/20260408-dblab-engine-4-1-released.md with the same <TldrTabs> component (Founders / Developers / DBAs / Managers / Ask AI) used in the invalid-index post. - Restore per-branch preview environments in .gitlab-ci.yml: every non-master / non-staging push now gets its own isolated deployment in the `review` namespace at https://<branch-slug>.<PREVIEW_BASE_DOMAIN>, with an on_stop hook (`stop_review`) and a 1-week auto_stop_in safety net. Previously every non-master branch overwrote the shared staging namespace, which meant there were effectively no preview envs. - Wire deploy/configs/review.sh to the new review env (was an unused stub with only REPLICAS=1). - Document the GitLab↔GitHub mirror model in CLAUDE.md: master flows GitLab → GitHub, dev branches flow GitHub → GitLab via .github/workflows/mirror-to-gitlab.yml. https://claude.ai/code/session_015AC273dXNKXd8gG5QpC152
The previous commit reinvented review apps with a bunch of new machinery (PREVIEW_BASE_DOMAIN, stop_review job, auto_stop_in, on_stop wiring). The existing infrastructure already has the `review` namespace, the ingress, and the Cloudflare wildcard for *.pgai.green — review apps just need to deploy `docs-<slug>` into the `review` namespace and the rest is handled outside this repo. This commit replaces the over-engineered version with the same minimal shape that lived here before commit 43d434c (Oct 2020, "fix: remove review CI"), adapted to the current TAG_VERSION/TAG_LATEST naming and with the correct external URL (https://docs-<slug>.pgai.green). Also drops the per-branch overwrite of the staging deployment by scoping `build_and_push_staging` / `deploy_staging` to the `staging` branch only — that bug is the actual reason previews stopped working: every dev push was clobbering the shared staging Deployment instead of getting an isolated review env. https://claude.ai/code/session_015AC273dXNKXd8gG5QpC152
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.
Summary
Two requests in one branch:
1. AI TL;DR block on the DBLab 4.1 post
blog/20260408-dblab-engine-4-1-released.mdnow uses the same<TldrTabs>component (Founders / Developers / DBAs / Managers / Ask AI) that the
invalid-index post uses. The article body itself is fleshed out from the live
page so the post no longer relies on out-of-repo content.
The Ask AI tab is wired up with a focused
aiContextsummary of the releaseso the chat can answer 4.1-specific questions without leaking unrelated context.
2. Preview environments — diagnosis and fix
Why they disappeared.
.gitlab-ci.ymlhad a singlebuild_and_push_stagingjob set to
except: master. Every non-masterpush deployed to the sameNAMESPACE: stagingwith the sameDOCS_NAME: docs— so each branch justoverwrote the previous one. There were no per-branch environments. The unused
deploy/configs/review.sh(justexport REPLICAS=1) was a leftover from whenthis used to be a real review-apps setup.
Fix.
build_and_push_review/deploy_reviewjobs for every non-master/non-
stagingbranch. They deploy into thereviewnamespace asdocs-$CI_COMMIT_REF_SLUG, with the GitLab environment namedreview/$CI_COMMIT_REF_SLUGand the URLhttps://$CI_COMMIT_REF_SLUG.$PREVIEW_BASE_DOMAIN(override
PREVIEW_BASE_DOMAINas a CI variable if your infra uses adifferent host).
stop_reviewjob wired viaenvironment.on_stopso the per-branchDeployment + Service are torn down when the branch is deleted.
auto_stop_in: 1 weekis a backstop for orphaned envs.build_and_push_staging/deploy_stagingare now scoped to thestagingbranch only — the static staging env at v2.postgres.ai is unchanged but
feature branches no longer trample it.
deploy/configs/review.shnow setsURL,BASE_URL, and the staging-backendendpoints so the preview build actually has a working frontend config.
3. GitLab ↔ GitHub mirror model documented in CLAUDE.md
Reflects the actual setup:
masterflows GitLab → GitHub; development branchesflow GitHub → GitLab via
.github/workflows/mirror-to-gitlab.yml. Practicalimplication: Claude Code (GitHub-integrated) starts work here, the branch
auto-mirrors to GitLab, and the MR / merge happens there.
masteronly updateson GitHub via the mirror after a GitLab merge.
Test plan
build_and_push_reviewjob and adeploy_reviewjob (not abuild_and_push_staging).deploy_reviewdeploysdocs-claude-add-tldr-fix-previews-xpq4vintothe
reviewnamespace.review/claude-add-tldr-fix-previews-xpq4vwith a
Stopbutton.TL;DR tabs (including the Ask AI tab connecting to the WS backend).
stop_reviewruns and removes theDeployment + Service.
masterbuild/deploy paths are unchanged.https://claude.ai/code/session_015AC273dXNKXd8gG5QpC152
Generated by Claude Code