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
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
F13992759: D8583.id20416.diff
Tue, Oct 22, 6:36 PM
F13987872: D8583.diff
Mon, Oct 21, 11:55 AM
F13962782: D8583.id20361.diff
Oct 15 2024, 12:15 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
Branch
task5
Lint
Lint Passed
Unit
No Test Coverage

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).