Skip to content

feat: add TL;DR block to DBLab 4.1 post and restore preview envs#33

Draft
NikolayS wants to merge 2 commits into
masterfrom
claude/add-tldr-fix-previews-xpQ4V
Draft

feat: add TL;DR block to DBLab 4.1 post and restore preview envs#33
NikolayS wants to merge 2 commits into
masterfrom
claude/add-tldr-fix-previews-xpQ4V

Conversation

@NikolayS
Copy link
Copy Markdown
Contributor

Summary

Two requests in one branch:

1. AI TL;DR block on the DBLab 4.1 post

blog/20260408-dblab-engine-4-1-released.md now 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 aiContext summary of the release
so the chat can answer 4.1-specific questions without leaking unrelated context.

2. Preview environments — diagnosis and fix

Why they disappeared. .gitlab-ci.yml had a single build_and_push_staging
job set to except: master. Every non-master push deployed to the same
NAMESPACE: staging with the same DOCS_NAME: docs — so each branch just
overwrote the previous one. There were no per-branch environments. The unused
deploy/configs/review.sh (just export REPLICAS=1) was a leftover from when
this used to be a real review-apps setup.

Fix.

  • New build_and_push_review / deploy_review jobs for every non-master /
    non-staging branch. They deploy into the review namespace as
    docs-$CI_COMMIT_REF_SLUG, with the GitLab environment named
    review/$CI_COMMIT_REF_SLUG and the URL
    https://$CI_COMMIT_REF_SLUG.$PREVIEW_BASE_DOMAIN
    (override PREVIEW_BASE_DOMAIN as a CI variable if your infra uses a
    different host).
  • New stop_review job wired via environment.on_stop so the per-branch
    Deployment + Service are torn down when the branch is deleted. auto_stop_in: 1 week is a backstop for orphaned envs.
  • build_and_push_staging / deploy_staging are now scoped to the staging
    branch only — the static staging env at v2.postgres.ai is unchanged but
    feature branches no longer trample it.
  • deploy/configs/review.sh now sets URL, BASE_URL, and the staging-backend
    endpoints so the preview build actually has a working frontend config.

3. GitLab ↔ GitHub mirror model documented in CLAUDE.md

Reflects the actual setup: master flows GitLab → GitHub; development branches
flow GitHub → GitLab via .github/workflows/mirror-to-gitlab.yml. Practical
implication: Claude Code (GitHub-integrated) starts work here, the branch
auto-mirrors to GitLab, and the MR / merge happens there. master only updates
on GitHub via the mirror after a GitLab merge.

Test plan

  • CI on this branch produces a build_and_push_review job and a
    deploy_review job (not a build_and_push_staging).
  • deploy_review deploys docs-claude-add-tldr-fix-previews-xpq4v into
    the review namespace.
  • GitLab Environments page shows review/claude-add-tldr-fix-previews-xpq4v
    with a Stop button.
  • Visit the preview URL and confirm the new DBLab 4.1 post renders with the
    TL;DR tabs (including the Ask AI tab connecting to the WS backend).
  • Delete the branch and confirm stop_review runs and removes the
    Deployment + Service.
  • master build/deploy paths are unchanged.

https://claude.ai/code/session_015AC273dXNKXd8gG5QpC152


Generated by Claude Code

claude added 2 commits May 12, 2026 12:39
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants