@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make storage adjustment a little nicer, especially the first time

Summary:
Fixes T11583.

- When users run `bin/storage upgrade` for the first time on a new install, we currently give them a prompt which feels rough and which they can only reasonably ever answer "yes" to.
- We generally use cautionary language ("found issues with schema") in this workflow. Adjustments are now routine, so use more neutral and progress-oriented language ("found adjustments to apply").

Test Plan:
- Ran `bin/storage upgrade --namesapce kappa123`, got an adjustment using neutral language without prompting.
- Dropped a key, ran `bin/storage upgrade`, got normal workflow (but with more neutral language).

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11583

Differential Revision: https://secure.phabricator.com/D16509

+16 -5
+16 -5
src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php
··· 8 8 private $force; 9 9 private $patches; 10 10 11 + private $didInitialize; 12 + 11 13 final public function getAPI() { 12 14 return $this->api; 13 15 } ··· 176 178 "%s\n", 177 179 pht('DRYRUN: Would apply adjustments.')); 178 180 return 0; 181 + } else if ($this->didInitialize) { 182 + // If we just initialized the database, continue without prompting. This 183 + // is nicer for first-time setup and there's no reasonable reason any 184 + // user would ever answer "no" to the prompt against an empty schema. 179 185 } else if (!$this->force) { 180 186 $console->writeOut( 181 187 "\n%s\n", 182 188 pht( 183 - "Found %s issues(s) with schemata, detailed above.\n\n". 184 - "You can review issues in more detail from the web interface, ". 189 + "Found %s adjustment(s) to apply, detailed above.\n\n". 190 + "You can review adjustments in more detail from the web interface, ". 185 191 "in Config > Database Status. To better understand the adjustment ". 186 192 "workflow, see \"Managing Storage Adjustments\" in the ". 187 193 "documentation.\n\n". ··· 189 195 "migrations may take some time.", 190 196 phutil_count($adjustments))); 191 197 192 - $prompt = pht('Fix these schema issues?'); 198 + $prompt = pht('Apply these schema adjustments?'); 193 199 if (!phutil_console_confirm($prompt, $default_no = true)) { 194 200 return 1; 195 201 } ··· 197 203 198 204 $console->writeOut( 199 205 "%s\n", 200 - pht('Fixing schema issues...')); 206 + pht('Applying schema adjustments...')); 201 207 202 208 $conn = $api->getConn(null); 203 209 ··· 368 374 if (!$failed) { 369 375 $console->writeOut( 370 376 "%s\n", 371 - pht('Completed fixing all schema issues.')); 377 + pht('Completed applying all schema adjustments.')); 372 378 373 379 $err = 0; 374 380 } else { ··· 799 805 'storage before selectively applying patches.')); 800 806 return 1; 801 807 } 808 + 809 + // If we're initializing storage for the first time, track it so that 810 + // we can give the user a nicer experience during the subsequent 811 + // adjustment phase. 812 + $this->didInitialize = true; 802 813 803 814 $legacy = $api->getLegacyPatches($this->patches); 804 815 if ($legacy || $no_quickstart || $init_only) {