mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 05:12:41 +01:00
Mark questionable column nullability for later
Summary: Ref T1191. Ref T6203. While generating expected schemata, I ran into these columns which seem to have sketchy nullability. - Mark most of them for later resolution (T6203). They work fine today and don't need to block T1191. Changing them can break the application, so we can't autofix them. - Forgive a couple of them that are sort-of reasonable or going to get wiped out. Test Plan: Saw 94 remaining warnings. Reviewers: btrahan Reviewed By: btrahan Subscribers: hach-que, epriestley Maniphest Tasks: T1191, T6203 Differential Revision: https://secure.phabricator.com/D10593
This commit is contained in:
parent
4f87adc438
commit
03519c53bb
23 changed files with 111 additions and 26 deletions
|
@ -171,10 +171,10 @@ abstract class PhabricatorConfigStorageSchema extends Phobject {
|
||||||
case self::ISSUE_MISSING:
|
case self::ISSUE_MISSING:
|
||||||
case self::ISSUE_SURPLUS:
|
case self::ISSUE_SURPLUS:
|
||||||
case self::ISSUE_SUBFAIL:
|
case self::ISSUE_SUBFAIL:
|
||||||
|
case self::ISSUE_NULLABLE:
|
||||||
return self::STATUS_FAIL;
|
return self::STATUS_FAIL;
|
||||||
case self::ISSUE_SUBWARN:
|
case self::ISSUE_SUBWARN:
|
||||||
case self::ISSUE_COLUMNTYPE:
|
case self::ISSUE_COLUMNTYPE:
|
||||||
case self::ISSUE_NULLABLE:
|
|
||||||
return self::STATUS_WARN;
|
return self::STATUS_WARN;
|
||||||
case self::ISSUE_SUBNOTE:
|
case self::ISSUE_SUBNOTE:
|
||||||
case self::ISSUE_CHARSET:
|
case self::ISSUE_CHARSET:
|
||||||
|
|
|
@ -36,6 +36,14 @@ final class DifferentialChangeset extends DifferentialDAO
|
||||||
'fileType' => 'uint32',
|
'fileType' => 'uint32',
|
||||||
'addLines' => 'uint32',
|
'addLines' => 'uint32',
|
||||||
'delLines' => 'uint32',
|
'delLines' => 'uint32',
|
||||||
|
|
||||||
|
// T6203/NULLABILITY
|
||||||
|
// These should all be non-nullable, and store reasonable default
|
||||||
|
// JSON values if empty.
|
||||||
|
'awayPaths' => 'text?',
|
||||||
|
'metadata' => 'text?',
|
||||||
|
'oldProperties' => 'text?',
|
||||||
|
'newProperties' => 'text?',
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
'diffID' => array(
|
'diffID' => array(
|
||||||
|
|
|
@ -57,9 +57,13 @@ final class DifferentialDiff
|
||||||
'branch' => 'text255?',
|
'branch' => 'text255?',
|
||||||
'bookmark' => 'text255?',
|
'bookmark' => 'text255?',
|
||||||
'arcanistProjectPHID' => 'phid?',
|
'arcanistProjectPHID' => 'phid?',
|
||||||
'creationMethod' => 'text255',
|
|
||||||
'description' => 'text255',
|
|
||||||
'repositoryUUID' => 'text64?',
|
'repositoryUUID' => 'text64?',
|
||||||
|
|
||||||
|
// T6203/NULLABILITY
|
||||||
|
// These should be non-null; all diffs should have a creation method
|
||||||
|
// and the description should just be empty.
|
||||||
|
'creationMethod' => 'text255?',
|
||||||
|
'description' => 'text255?',
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
'revisionID' => array(
|
'revisionID' => array(
|
||||||
|
|
|
@ -84,7 +84,7 @@ final class DifferentialRevision extends DifferentialDAO
|
||||||
'lastReviewerPHID' => 'phid?',
|
'lastReviewerPHID' => 'phid?',
|
||||||
'lineCount' => 'uint32?',
|
'lineCount' => 'uint32?',
|
||||||
'mailKey' => 'bytes40',
|
'mailKey' => 'bytes40',
|
||||||
'branchName' => 'text255',
|
'branchName' => 'text255?',
|
||||||
'arcanistProjectPHID' => 'phid?',
|
'arcanistProjectPHID' => 'phid?',
|
||||||
'repositoryPHID' => 'phid?',
|
'repositoryPHID' => 'phid?',
|
||||||
),
|
),
|
||||||
|
|
|
@ -8,7 +8,7 @@ final class HarbormasterObject extends HarbormasterDAO {
|
||||||
return array(
|
return array(
|
||||||
self::CONFIG_AUX_PHID => true,
|
self::CONFIG_AUX_PHID => true,
|
||||||
self::CONFIG_COLUMN_SCHEMA => array(
|
self::CONFIG_COLUMN_SCHEMA => array(
|
||||||
'name' => 'text255',
|
'name' => 'text255?',
|
||||||
),
|
),
|
||||||
) + parent::getConfiguration();
|
) + parent::getConfiguration();
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,11 @@ final class HarbormasterSchemaSpec extends PhabricatorConfigSchemaSpec {
|
||||||
'id' => 'id',
|
'id' => 'id',
|
||||||
'logID' => 'id',
|
'logID' => 'id',
|
||||||
'encoding' => 'text32',
|
'encoding' => 'text32',
|
||||||
'size' => 'uint32',
|
|
||||||
|
// T6203/NULLABILITY
|
||||||
|
// Both the type and nullability of this column are crazily wrong.
|
||||||
|
'size' => 'uint32?',
|
||||||
|
|
||||||
'chunk' => 'bytes',
|
'chunk' => 'bytes',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -31,9 +31,13 @@ final class HarbormasterBuildLog extends HarbormasterDAO
|
||||||
return array(
|
return array(
|
||||||
self::CONFIG_AUX_PHID => true,
|
self::CONFIG_AUX_PHID => true,
|
||||||
self::CONFIG_COLUMN_SCHEMA => array(
|
self::CONFIG_COLUMN_SCHEMA => array(
|
||||||
'logSource' => 'text255',
|
// T6203/NULLABILITY
|
||||||
'logType' => 'text255',
|
// It seems like these should be non-nullable? All logs should have a
|
||||||
'duration' => 'uint32',
|
// source, etc.
|
||||||
|
'logSource' => 'text255?',
|
||||||
|
'logType' => 'text255?',
|
||||||
|
'duration' => 'uint32?',
|
||||||
|
|
||||||
'live' => 'bool',
|
'live' => 'bool',
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
|
|
|
@ -103,10 +103,13 @@ final class HarbormasterBuildTarget extends HarbormasterDAO
|
||||||
self::CONFIG_COLUMN_SCHEMA => array(
|
self::CONFIG_COLUMN_SCHEMA => array(
|
||||||
'className' => 'text255',
|
'className' => 'text255',
|
||||||
'targetStatus' => 'text64',
|
'targetStatus' => 'text64',
|
||||||
'name' => 'text255',
|
|
||||||
'dateStarted' => 'epoch?',
|
'dateStarted' => 'epoch?',
|
||||||
'dateCompleted' => 'epoch?',
|
'dateCompleted' => 'epoch?',
|
||||||
'buildGeneration' => 'uint32',
|
'buildGeneration' => 'uint32',
|
||||||
|
|
||||||
|
// T6203/NULLABILITY
|
||||||
|
// This should not be nullable.
|
||||||
|
'name' => 'text255?',
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
'key_build' => array(
|
'key_build' => array(
|
||||||
|
|
|
@ -29,8 +29,13 @@ final class HarbormasterBuildStep extends HarbormasterDAO
|
||||||
self::CONFIG_COLUMN_SCHEMA => array(
|
self::CONFIG_COLUMN_SCHEMA => array(
|
||||||
'className' => 'text255',
|
'className' => 'text255',
|
||||||
'sequence' => 'uint32',
|
'sequence' => 'uint32',
|
||||||
'name' => 'text255',
|
|
||||||
'description' => 'text',
|
'description' => 'text',
|
||||||
|
|
||||||
|
// T6203/NULLABILITY
|
||||||
|
// This should not be nullable. Current `null` values indicate steps
|
||||||
|
// which predated editable names. These should be backfilled with
|
||||||
|
// default names, then the code for handling `null` shoudl be removed.
|
||||||
|
'name' => 'text255?',
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
'key_plan' => array(
|
'key_plan' => array(
|
||||||
|
|
|
@ -36,10 +36,13 @@ final class HeraldRule extends HeraldDAO
|
||||||
'contentType' => 'text255',
|
'contentType' => 'text255',
|
||||||
'mustMatchAll' => 'bool',
|
'mustMatchAll' => 'bool',
|
||||||
'configVersion' => 'uint32',
|
'configVersion' => 'uint32',
|
||||||
'repetitionPolicy' => 'uint32',
|
|
||||||
'ruleType' => 'text255',
|
'ruleType' => 'text255',
|
||||||
'isDisabled' => 'uint32',
|
'isDisabled' => 'uint32',
|
||||||
'triggerObjectPHID' => 'phid?',
|
'triggerObjectPHID' => 'phid?',
|
||||||
|
|
||||||
|
// T6203/NULLABILITY
|
||||||
|
// This should not be nullable.
|
||||||
|
'repetitionPolicy' => 'uint32?',
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
'key_phid' => null,
|
'key_phid' => null,
|
||||||
|
|
|
@ -78,6 +78,11 @@ final class ManiphestTask extends ManiphestDAO
|
||||||
'ownerOrdering' => 'text64?',
|
'ownerOrdering' => 'text64?',
|
||||||
'originalEmailSource' => 'text255?',
|
'originalEmailSource' => 'text255?',
|
||||||
'subpriority' => 'double',
|
'subpriority' => 'double',
|
||||||
|
|
||||||
|
// T6203/NULLABILITY
|
||||||
|
// This should not be nullable. It's going away soon anyway.
|
||||||
|
'ccPHIDs' => 'text?',
|
||||||
|
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
'key_phid' => null,
|
'key_phid' => null,
|
||||||
|
|
|
@ -34,8 +34,11 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
|
||||||
),
|
),
|
||||||
self::CONFIG_COLUMN_SCHEMA => array(
|
self::CONFIG_COLUMN_SCHEMA => array(
|
||||||
'status' => 'text255',
|
'status' => 'text255',
|
||||||
'message' => 'text',
|
|
||||||
'relatedPHID' => 'phid?',
|
'relatedPHID' => 'phid?',
|
||||||
|
|
||||||
|
// T6203/NULLABILITY
|
||||||
|
// This should just be empty if there's no body.
|
||||||
|
'message' => 'text?',
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
'status' => array(
|
'status' => array(
|
||||||
|
|
|
@ -48,6 +48,10 @@ final class PhabricatorPaste extends PhabricatorPasteDAO
|
||||||
'language' => 'text64',
|
'language' => 'text64',
|
||||||
'mailKey' => 'bytes20',
|
'mailKey' => 'bytes20',
|
||||||
'parentPHID' => 'phid?',
|
'parentPHID' => 'phid?',
|
||||||
|
|
||||||
|
// T6203/NULLABILITY
|
||||||
|
// Pastes should always have a view policy.
|
||||||
|
'viewPolicy' => 'policy?',
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
'parentPHID' => array(
|
'parentPHID' => array(
|
||||||
|
|
|
@ -31,7 +31,12 @@ final class PhameBlog extends PhameDAO
|
||||||
'name' => 'text64',
|
'name' => 'text64',
|
||||||
'description' => 'text',
|
'description' => 'text',
|
||||||
'domain' => 'text255?',
|
'domain' => 'text255?',
|
||||||
'joinPolicy' => 'policy',
|
|
||||||
|
// T6203/NULLABILITY
|
||||||
|
// These policies should always be non-null.
|
||||||
|
'joinPolicy' => 'policy?',
|
||||||
|
'editPolicy' => 'policy?',
|
||||||
|
'viewPolicy' => 'policy?',
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
'key_phid' => null,
|
'key_phid' => null,
|
||||||
|
|
|
@ -91,9 +91,17 @@ final class PhamePost extends PhameDAO
|
||||||
self::CONFIG_COLUMN_SCHEMA => array(
|
self::CONFIG_COLUMN_SCHEMA => array(
|
||||||
'title' => 'text255',
|
'title' => 'text255',
|
||||||
'phameTitle' => 'text64',
|
'phameTitle' => 'text64',
|
||||||
'body' => 'text',
|
|
||||||
'visibility' => 'uint32',
|
'visibility' => 'uint32',
|
||||||
'datePublished' => 'epoch?',
|
|
||||||
|
// T6203/NULLABILITY
|
||||||
|
// These seem like they should always be non-null?
|
||||||
|
'blogPHID' => 'phid?',
|
||||||
|
'body' => 'text?',
|
||||||
|
'configData' => 'text?',
|
||||||
|
|
||||||
|
// T6203/NULLABILITY
|
||||||
|
// This one probably should be nullable?
|
||||||
|
'datePublished' => 'epoch',
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
'key_phid' => null,
|
'key_phid' => null,
|
||||||
|
|
|
@ -35,9 +35,12 @@ final class PhrictionContent extends PhrictionDAO
|
||||||
'title' => 'text',
|
'title' => 'text',
|
||||||
'slug' => 'text128',
|
'slug' => 'text128',
|
||||||
'content' => 'text',
|
'content' => 'text',
|
||||||
'description' => 'text',
|
|
||||||
'changeType' => 'uint32',
|
'changeType' => 'uint32',
|
||||||
'changeRef' => 'uint32?',
|
'changeRef' => 'uint32?',
|
||||||
|
|
||||||
|
// T6203/NULLABILITY
|
||||||
|
// This should just be empty if not provided?
|
||||||
|
'description' => 'text?',
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
'documentID' => array(
|
'documentID' => array(
|
||||||
|
|
|
@ -70,7 +70,10 @@ final class PonderAnswer extends PonderDAO
|
||||||
self::CONFIG_COLUMN_SCHEMA => array(
|
self::CONFIG_COLUMN_SCHEMA => array(
|
||||||
'voteCount' => 'sint32',
|
'voteCount' => 'sint32',
|
||||||
'content' => 'text',
|
'content' => 'text',
|
||||||
'contentSource' => 'text',
|
|
||||||
|
// T6203/NULLABILITY
|
||||||
|
// This should always exist.
|
||||||
|
'contentSource' => 'text?',
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
'key_phid' => null,
|
'key_phid' => null,
|
||||||
|
|
|
@ -38,10 +38,13 @@ final class PonderQuestion extends PonderDAO
|
||||||
'voteCount' => 'sint32',
|
'voteCount' => 'sint32',
|
||||||
'status' => 'uint32',
|
'status' => 'uint32',
|
||||||
'content' => 'text',
|
'content' => 'text',
|
||||||
'contentSource' => 'text',
|
|
||||||
'heat' => 'double',
|
'heat' => 'double',
|
||||||
'answerCount' => 'uint32',
|
'answerCount' => 'uint32',
|
||||||
'mailKey' => 'bytes20',
|
'mailKey' => 'bytes20',
|
||||||
|
|
||||||
|
// T6203/NULLABILITY
|
||||||
|
// This should always exist.
|
||||||
|
'contentSource' => 'text?',
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
'key_phid' => null,
|
'key_phid' => null,
|
||||||
|
|
|
@ -125,11 +125,16 @@ final class PhabricatorProject extends PhabricatorProjectDAO
|
||||||
'name' => 'text255',
|
'name' => 'text255',
|
||||||
'status' => 'text32',
|
'status' => 'text32',
|
||||||
'phrictionSlug' => 'text128?',
|
'phrictionSlug' => 'text128?',
|
||||||
'joinPolicy' => 'policy',
|
|
||||||
'isMembershipLocked' => 'bool',
|
'isMembershipLocked' => 'bool',
|
||||||
'profileImagePHID' => 'phid?',
|
'profileImagePHID' => 'phid?',
|
||||||
'icon' => 'text32',
|
'icon' => 'text32',
|
||||||
'color' => 'text32',
|
'color' => 'text32',
|
||||||
|
|
||||||
|
// T6203/NULLABILITY
|
||||||
|
// These are definitely wrong and should always exist.
|
||||||
|
'editPolicy' => 'policy?',
|
||||||
|
'viewPolicy' => 'policy?',
|
||||||
|
'joinPolicy' => 'policy?',
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
'key_phid' => null,
|
'key_phid' => null,
|
||||||
|
|
|
@ -155,10 +155,12 @@ final class ReleephRequest extends ReleephDAO
|
||||||
),
|
),
|
||||||
self::CONFIG_COLUMN_SCHEMA => array(
|
self::CONFIG_COLUMN_SCHEMA => array(
|
||||||
'requestCommitPHID' => 'phid?',
|
'requestCommitPHID' => 'phid?',
|
||||||
'commitIdentifier' => 'text40',
|
'commitIdentifier' => 'text40?',
|
||||||
'pickStatus' => 'uint32',
|
'commitPHID' => 'phid?',
|
||||||
|
'pickStatus' => 'uint32?',
|
||||||
'inBranch' => 'bool',
|
'inBranch' => 'bool',
|
||||||
'mailKey' => 'bytes20',
|
'mailKey' => 'bytes20',
|
||||||
|
'userIntents' => 'text?',
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
'key_phid' => null,
|
'key_phid' => null,
|
||||||
|
|
|
@ -30,8 +30,11 @@ final class PhabricatorRepositoryRefCursor extends PhabricatorRepositoryDAO
|
||||||
self::CONFIG_COLUMN_SCHEMA => array(
|
self::CONFIG_COLUMN_SCHEMA => array(
|
||||||
'refType' => 'text32',
|
'refType' => 'text32',
|
||||||
'refNameHash' => 'bytes12',
|
'refNameHash' => 'bytes12',
|
||||||
'refNameEncoding' => 'text16',
|
|
||||||
'commitIdentifier' => 'text40',
|
'commitIdentifier' => 'text40',
|
||||||
|
|
||||||
|
// T6203/NULLABILITY
|
||||||
|
// This probably should not be nullable; refNameRaw is not nullable.
|
||||||
|
'refNameEncoding' => 'text16?',
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
'key_cursor' => array(
|
'key_cursor' => array(
|
||||||
|
|
|
@ -12,11 +12,14 @@ final class PhabricatorUserSSHKey extends PhabricatorUserDAO {
|
||||||
public function getConfiguration() {
|
public function getConfiguration() {
|
||||||
return array(
|
return array(
|
||||||
self::CONFIG_COLUMN_SCHEMA => array(
|
self::CONFIG_COLUMN_SCHEMA => array(
|
||||||
'name' => 'text255',
|
|
||||||
'keyType' => 'text255',
|
|
||||||
'keyBody' => 'text',
|
|
||||||
'keyHash' => 'bytes32',
|
'keyHash' => 'bytes32',
|
||||||
'keyComment' => 'text255?',
|
'keyComment' => 'text255?',
|
||||||
|
|
||||||
|
// T6203/NULLABILITY
|
||||||
|
// These seem like they should not be nullable.
|
||||||
|
'name' => 'text255?',
|
||||||
|
'keyType' => 'text255?',
|
||||||
|
'keyBody' => 'text?',
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
'userPHID' => array(
|
'userPHID' => array(
|
||||||
|
|
|
@ -36,6 +36,13 @@ final class PhabricatorWorkerActiveTask extends PhabricatorWorkerTask {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$config[self::CONFIG_COLUMN_SCHEMA] = array(
|
||||||
|
// T6203/NULLABILITY
|
||||||
|
// This isn't nullable in the archive table, so at a minimum these
|
||||||
|
// should be the same.
|
||||||
|
'dataID' => 'uint32?',
|
||||||
|
) + $parent[self::CONFIG_COLUMN_SCHEMA];
|
||||||
|
|
||||||
return $config + $parent;
|
return $config + $parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue