1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-24 07:42:40 +01:00
phorge-phorge/src/applications/config
epriestley 000760b645 Do a better job of handling spec errors during schema adjustment
Summary:
Ref T1191. Currently if a developer forgot to specify a column type, `storage adjust` aborts explosively mid-stream. Instead:

  - Make this a formal error with an unambiugous name/description instead of something you sort of infer by seeing "<unknown>".
  - Make this error prevent generation of adjustment warnings, so we don't try to `ALTER TABLE t CHANGE COLUMN c <unknown>`, which is nonsense.
  - When schemata errors exist, surface them prominiently in `storage adjust`.

Overall:

  - Once `storage upgrade` runs `storage adjust` automatically (soon), this will make it relatively difficult to miss these errors.
  - Letting these errors slip through no longer escalates into a more severe issue.

Test Plan:
Commented out the recent `mailKey` spec and ran `storage adjust`:

```
$ ./bin/storage adjust --force
Verifying database schemata...
Found no adjustments for schemata.

Target                                            Error
phabricator2_phriction.phriction_document.mailKey Column Has No Specification

 SCHEMATA ERRORS

The schemata have serious errors (detailed above) which the adjustment
workflow can not fix.

If you are not developing Phabricator itself, report this issue to the
upstream.

If you are developing Phabricator, these errors usually indicate that your
schema specifications do not agree with the schemata your code actually
builds.
```

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T1191

Differential Revision: https://secure.phabricator.com/D10771
2014-11-04 04:42:05 -08:00
..
application Load all keys, support unique keys, and provide an "all issues" view 2014-09-19 11:46:30 -07:00
check Minor formatting changes 2014-10-08 08:39:49 +11:00
controller Document the adjustment workflow and warn users about adjusting old MySQL 2014-11-01 08:25:05 -07:00
custom Update callsites of phutil_json_decode. 2014-06-21 00:39:37 +10:00
editor Allow bin/config to affect database configuration and migrate between local and database configuration 2014-10-08 16:15:05 -07:00
exception Apply some autofix linter rules 2014-09-10 06:55:05 +10:00
issue Add a configuration warning when memory_limit will limit file uploads 2014-09-04 12:48:34 -07:00
json Mask remaining config values, and implement set type 2013-01-16 15:06:07 -08:00
management Fix a typo in an admin tool 2014-10-21 10:11:55 -07:00
option Minor formatting changes 2014-10-08 08:39:49 +11:00
phid Rename PHIDType classes 2014-07-24 08:05:46 +10:00
query Rename PhabricatorApplication subclasses 2014-07-23 10:03:09 +10:00
response Change double quotes to single quotes. 2014-06-09 11:36:50 -07:00
schema Do a better job of handling spec errors during schema adjustment 2014-11-04 04:42:05 -08:00
storage Automatically build all Lisk schemata 2014-10-02 09:51:20 -07:00
view Make it easier to ignore setup issues 2014-09-05 12:26:58 -07:00