Skip to content

chore: delete demo mode#20393

Merged
d-bytebase merged 5 commits into
mainfrom
delete-demo-mode
May 25, 2026
Merged

chore: delete demo mode#20393
d-bytebase merged 5 commits into
mainfrom
delete-demo-mode

Conversation

@d-bytebase
Copy link
Copy Markdown
Collaborator

Summary

Removes Bytebase's --demo mode end-to-end. The demo server (demo.bytebase.com) was driven by a baked-in SQL dump plus a server flag that loaded it on startup; this PR rips out the flag, the dump, the deploy workflow, and every UI surface that branched on serverInfo.demo.

48 files net, ~6,100 lines removed.

What goes away

  • --demo CLI flag, Profile.Demo field, demo.LoadDemoData(), pgdata-demo data dir
  • backend/demo/ package (Go code + 5.5K-line data/dump.sql)
  • bool demo = 5 from ActuatorInfo proto (field 5 reserved)
  • BannerDemo, DemoSigninForm, demo badge in VersionMenuItem, isDemo store getter
  • auth.sign-in.demo-account, common.demo-mode, banner.request-demo, banner.cloud, banner.deploy locale keys
  • //go:build !minidemo tag on ultimate.go; merged minimal.go into it
  • .github/workflows/build-push-demo-image.yml + demo-daily-deploy.yml
  • bytebase-action default --url https://demo.bytebase.com (now empty, required)
  • RELEASE Docker build arg (the only remaining caller passed RELEASE=release, same as the default — see below)
  • mkdir /var/opt/bytebase/pgdata-demo in scripts/Dockerfile
  • demo.bytebase.com link in README.md

E2E bootstrap rewrite

frontend/tests/e2e/framework/mode-start-new-bytebase.ts previously relied on --demo to pre-populate an admin and sample instances. New flow:

  1. Spawn server (no --demo)
  2. Poll /healthz
  3. POST /v1/auth/signup — first user becomes workspace admin automatically
  4. POST /v1/auth/login — get a body token (signup only sets cookies)
  5. POST /v1/actuator:setupSample — provisions test-sample-instance + prod-sample-instance on PORT+3 / PORT+4
  6. Wait for both instances to register via listInstances()
  7. TCP probe PORT+3 / PORT+4 until they accept connections

New pollUntil() helper captures the last error per phase so timeout failures surface the underlying cause instead of a generic "did not become ready" message.

Breaking Changes

Category Change
Configuration --demo server flag removed. Bytebase will fail to start with unknown flag: --demo. No replacement — the demo mode is gone.
Proto ActuatorInfo.demo (field 5) removed; field reserved. Existing clients reading serverInfo.demo will get the default (false).
Configuration bytebase-action --url default changed from https://demo.bytebase.com to empty. The flag is now required.
Build RELEASE Docker build arg removed. Builds now always use the release tag.
Build minidemo Go build tag removed. Builds always include all DB drivers.
Internal frontend/tests/e2e/AGENTS.md notes a new gap: the freshly signed-up workspace runs on the free plan, so specs that exercise enterprise-gated features (masking, classification) must inject a license via PATCH /v1/subscription/license signed with LICENSE_PRIVATE_KEY. The previous demo dump baked the license in.

Test plan

  • go build -ldflags "-w -s" -p=16 -o ./bytebase-build/bytebase ./backend/bin/server/main.go
  • go build -tags "release,embed_frontend,docker" (matches new Dockerfile tags)
  • golangci-lint run --allow-parallel-runners — 0 issues
  • pnpm --dir frontend fix — clean
  • pnpm --dir frontend type-check — clean
  • pnpm --dir frontend test — 2021 passed (1 obsolete BannerDemo test removed)
  • playwright test --list — 47 specs enumerate
  • E2E run on a fresh server to validate the new signup + setupSample bootstrap (deferred to CI; specs that require an enterprise license will fail until license injection is wired up — see AGENTS.md gap above)

🤖 Generated with Claude Code

Removes the --demo server flag and everything it pulled in: backend/demo
package + dump.sql, demo banner/badge/signin form, demo locale keys,
"bool demo" actuator proto field (reserved 5), --minidemo build tag,
and the GitHub workflows that built/deployed the demo image.

Rewrites the e2e bootstrap to replace --demo's pre-populated admin and
sample instances with /v1/auth/signup followed by /v1/actuator:setupSample,
with TCP readiness probes on the sample Postgres ports. Drops the
bytebase-action default --url of https://demo.bytebase.com (now required).
Removes the RELEASE Docker build arg since the only remaining caller was
already passing RELEASE=release.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@d-bytebase d-bytebase requested review from a team, RainbowDashy and ecmadao as code owners May 25, 2026 13:05
@cla-bot cla-bot Bot added the cla-signed label May 25, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 25, 2026

The latest Buf updates on your PR. Results from workflow Proto linter / lint-protos (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed⏩ skippedMay 25, 2026, 2:06 PM

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 98a394834b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread frontend/tests/e2e/framework/mode-start-new-bytebase.ts
Comment thread action/command/root.go
P2: reject empty --url at flag-validation time in bytebase-action with a
clear error, instead of falling through to a confusing network failure.
Also requires the URL to be absolute (scheme + host).

P1: install an enterprise license during e2e bootstrap when the
BYTEBASE_E2E_LICENSE env var is set, via PATCH /v1/subscription/license.
Without the env var the bootstrap warns and continues on free plan, so
masking/classification specs can opt in once a dev license is provided
out of band.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dc149d43d5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread frontend/tests/e2e/framework/mode-start-new-bytebase.ts
Codex flagged that the previous fix still let masking specs run on free
plan and fail. Plumb env.hasLicense through the bootstrap, and have
masking-exemption.spec.ts skip itself in beforeAll when no license is
present, instead of failing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 33c47d1a3e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread frontend/tests/e2e/framework/mode-start-new-bytebase.ts
Codex flagged that the new bootstrap dropped the demo dump's pre-seeded
dba1@example.com user, which two plan-detail specs use as a second
approver. Add createUser + addWorkspaceRoleMember helpers and create
dba1@example.com with workspaceDBA role after admin signup.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ea0436a6d4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread frontend/tests/e2e/framework/api-client.ts Outdated
Codex caught that getActuatorInfo() requested /v1/actuator, but the
gateway only exposes GetActuatorInfo at /v1/actuator/info. The bootstrap
hits this unconditionally before provisioning the DBA fixture, so the
whole e2e suite would 404 on clean environments.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

@d-bytebase d-bytebase merged commit e672b48 into main May 25, 2026
22 checks passed
@d-bytebase d-bytebase deleted the delete-demo-mode branch May 25, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants