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
F14058223: D8583.diff
Sun, Nov 17, 10:11 AM
F14054150: D8583.id20361.diff
Fri, Nov 15, 10:51 PM
F14053974: D8583.id20416.diff
Fri, Nov 15, 9:01 PM
F14003950: D8583.id20416.diff
Sat, Oct 26, 1:23 PM
F13992788: D8583.diff
Tue, Oct 22, 6:46 PM
F13992769: D8583.id.diff
Tue, Oct 22, 6:41 PM
F13992767: D8583.id20361.diff
Tue, Oct 22, 6:40 PM
F13992762: D8583.id20363.diff
Tue, Oct 22, 6:37 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).