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)
Sat, Dec 21, 9:27 AM
Unknown Object (File)
Wed, Dec 11, 9:26 PM
Unknown Object (File)
Nov 25 2024, 10:07 AM
Unknown Object (File)
Nov 21 2024, 1:44 AM
Unknown Object (File)
Nov 18 2024, 10:14 PM
Unknown Object (File)
Nov 17 2024, 10:11 AM
Unknown Object (File)
Nov 15 2024, 10:51 PM
Unknown Object (File)
Nov 15 2024, 9:01 PM
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).