Skip to content

feat(installer): report CLI and no-start installs - #13844

Merged
ChiragAgg5k merged 6 commits into
mainfrom
feat/track-cli-installs
Sep 23, 2026
Merged

ChiragAgg5k merged 6 commits into
mainfrom
feat/track-cli-installs

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Why

The CLI installer sends the same anonymous usage report as the web installer, but three gates dropped most CLI runs: loopback domains returned early, reporting sat inside the containers-started branch so --no-start never reported, and headless runs had no way to set a hostname. The remaining CLI runs sent a placeholder email, so they could not be told apart.

What

  • New Appwrite\Installer\Report readonly value object owns the opt-out rule (DO_NOT_TRACK, non-production, local checkout) and the payload, so the web installer, interactive CLI and headless CLI build the same shape.
  • Loopback domains are reported as-is. --no-start still reports.
  • No account collected means null name and email instead of [email protected].
  • The entry point, channel, topology and whether containers were started travel in the User-Agent: Appwrite-Installer/2.0.0 (cli-headless; stable; combined; not-started).
  • --domain on install and upgrade sets _APP_DOMAIN and _APP_DOMAIN_TARGET for headless installs.

Rollout

Merge after appwrite-labs/cloud#6030 and appwrite-labs/growth#251.

Verification

PHPStan clean on the host. Headless install --interactive=N --no-start=true --domain=smoke.example.com verified in the container writes both domain keys and exits 0.

The CLI installer already called the growth API, but three gates dropped nearly every CLI run before the request left: localhost and loopback domains returned early, tracking sat inside the containers-started branch so --no-start never reported, and headless runs had no way to set a hostname. The installations table on data.appwrite.io confirms the effect: every stored row carries a unique real email from the web form, and the CLI's placeholder account never appears.

Move the opt-out decision and payload into a readonly Installer\Report so every entry point builds the same shape, report the domain as-is and let dashboards filter loopback hosts, fire tracking after --no-start too with started=false, send null name and email when no account was collected instead of a fake one, and add source (web, cli, cli-headless), channel and topology so the split is measurable. A --domain flag on install and upgrade lets headless installs set a real hostname without editing .env afterwards.
… new fields

Cloud stores the request User-Agent on every installation row already, so the entry point, channel, topology and whether containers were started travel there rather than as new columns in the platform database.
@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → feat/track-cli-installs (after).

Metric Before After Change
🚀 Requests/sec 190.42 190.6 ⚪ +0.1%
⏱️ Latency P50 87.23 ms 90.42 ms ⚪ +3.7%
⏱️ Latency P95 218.35 ms 210.51 ms ⚪ -3.6%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 90.42 210.51 12,084 190.6 -7.84
Account 166.64 322.67 636 10.56 -27.74
TablesDB 87.68 172.49 6,572 105.71 +8.69
Storage 81.57 183.01 3,180 52.79 +2.33
Functions 124.3 249.81 1,696 28.75 -57.71

Top API waits (after)

API request Max wait (ms)
account.name.update 475.35
account.prefs.update 442.43
functions.create 438.25
functions.variables.update 422.23
storage.files.update 415.58

@ChiragAgg5k ChiragAgg5k changed the title feat(installer): report CLI and no-start installs to growth analytics feat(installer): report CLI and no-start installs Sep 22, 2026
@greptile-apps

greptile-apps Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The pull request appears safe to merge, with no outstanding correctness, security, or repository-rule findings.

Summary

The PR centralizes installer usage reporting and extends it consistently across web, interactive CLI, and headless CLI installations.

  • Adds a shared immutable report object for opt-out decisions, payload construction, and installer User-Agent metadata.
  • Reports successful --no-start installations while recording whether containers were started.
  • Removes placeholder account details and strips collected account identity from loopback reports.
  • Adds validated --domain support to headless install and upgrade flows.
  • The two previous findings are no longer outstanding: both threads were manually resolved, hostname validation now uses AppDomain, and loopback reports clear account name and email.

Reviews (3) · Last reviewed commit: "Merge branch 'main' into feat/track-cli-..."

Comment thread src/Appwrite/Platform/Tasks/Install.php Resolved
Comment thread src/Appwrite/Platform/Tasks/Install.php Resolved
The headless domain flag accepted any text, including a URL, although the value is used as a bare hostname downstream. It now uses the same validator as the web installer. A loopback host is a local or test instance, so its report keeps the machine facts but drops the admin account.
@ChiragAgg5k

Copy link
Copy Markdown
Member Author

@greptile review

@ChiragAgg5k
ChiragAgg5k merged commit 44eb304 into main Sep 23, 2026
48 of 49 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the feat/track-cli-installs branch September 23, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants