Page MenuHomePhabricator

Use string constants, not integer constants, to represent task status internally
ClosedPublic

Authored by epriestley on Mar 21 2014, 1:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 3, 3:21 AM
Unknown Object (File)
Thu, May 2, 8:06 PM
Unknown Object (File)
Mon, Apr 29, 2:39 PM
Unknown Object (File)
Sat, Apr 27, 11:22 PM
Unknown Object (File)
Wed, Apr 24, 10:11 PM
Unknown Object (File)
Wed, Apr 10, 8:57 PM
Unknown Object (File)
Tue, Apr 9, 7:18 PM
Unknown Object (File)
Apr 1 2024, 7:11 AM
Subscribers

Details

Summary

Ref T1812. I think integer constants are going to be confusing and error prone for users to interact with. For example, because we use 0-5, adding a second "open" status like "needs verification" without disrupting the existing statuses would require users to define a status with, e.g., constant 6, but order it between constants 0 and 1. And if they later remove statuses, they need to avoid reusing existing constants.

Instead, use more manageable string constants like "open", "resolved", etc.

We must migrate three tables:

  • The task table itself, to update task status.
  • The transaction table, to update historic status changes.
  • The saved query table, to update saved queries which specify status sets.
Test Plan
  • Saved a query with complicated status filters.
  • Ran migrations.
  • Looked at the query, at existing tasks, and at task transactions.
  • Forced migrations to run again to verify idempotentcy/safety.

Diff Detail

Repository
rP Phabricator
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

epriestley retitled this revision from to Use string constants, not integer constants, to represent task status internally.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
  • Fix two (int) casts in the TransactionEditor.
btrahan edited edge metadata.
This revision is now accepted and ready to land.Mar 25 2014, 7:14 PM
epriestley updated this revision to Diff 20416.

Closed by commit rP0a76d82a7c4d (authored by @epriestley).