Page MenuHomePhabricator

Implement countdown.search and countdown.edit
ClosedPublic

Authored by amckinley on Apr 13 2017, 7:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 16, 1:15 AM
Unknown Object (File)
Feb 15 2024, 6:01 AM
Unknown Object (File)
Feb 12 2024, 7:28 PM
Unknown Object (File)
Feb 9 2024, 4:31 AM
Unknown Object (File)
Feb 7 2024, 5:27 PM
Unknown Object (File)
Jan 28 2024, 3:42 AM
Unknown Object (File)
Jan 22 2024, 7:36 AM
Unknown Object (File)
Dec 30 2023, 7:53 PM
Subscribers

Details

Summary

adds new conduit methods for countdown.edit and countdown.search

Test Plan

Search:

1[amckinley phabricator]$ echo '{"queryKey": "upcoming"}' | arc call-conduit --conduit-uri http://local.phacility.com/ --conduit-token <snip> countdown.search | json_pp
2{
3 "error" : null,
4 "errorMessage" : null,
5 "response" : {
6 "cursor" : {
7 "order" : null,
8 "before" : null,
9 "limit" : 100,
10 "after" : null
11 },
12 "maps" : [],
13 "query" : {
14 "queryKey" : "upcoming"
15 },
16 "data" : [
17 {
18 "phid" : "PHID-CDWN-nqqj6rv6iyaq5s4nt3z3",
19 "fields" : {
20 "spacePHID" : null,
21 "dateModified" : 1492110524,
22 "title" : "foobar",
23 "epoch" : "1492114080",
24 "policy" : {
25 "view" : "users",
26 "edit" : "users"
27 },
28 "dateCreated" : 1492110524,
29 "description" : "testing 123"
30 },
31 "attachments" : [],
32 "type" : "CDWN",
33 "id" : 7
34 }
35 ]
36 }
37}

Edit:
1[amckinley phabricator]$ echo '{"objectIdentifier": "PHID-CDWN-nqqj6rv6iyaq5s4nt3z3", "transactions": [{"type": "name", "value": "Assemble in the barnyard"}]}' | arc call-conduit --conduit-uri http://local.phacility.com/ --conduit-token <snip> countdown.edit | json_pp
2{
3 "response" : {
4 "object" : {
5 "id" : "7",
6 "phid" : "PHID-CDWN-nqqj6rv6iyaq5s4nt3z3"
7 },
8 "transactions" : []
9 },
10 "errorMessage" : null,
11 "error" : null
12}

Diff Detail

Repository
rP Phabricator
Branch
T12524 (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 16450
Build 21895: Run Core Tests
Build 21894: arc lint + arc unit

Event Timeline

epriestley added inline comments.
src/applications/countdown/storage/PhabricatorCountdown.php
175

Add a specification for epoch here too (for now, this is only used to generate documentation).

181

For remarkup fields like this, I started doing something to try to future-proof them recently in D17603:

  • Annotate the type as remarkup.
  • Return a dictionary with the raw value in 'raw'.

See also discussion in T12461. But the idea is that we might eventually want to be able to return text/html for these fields, or store other flavors of markdown, and we can do that without breaking the API if we emit a dictionary.

So the output is currently:

"description": "asdf"

...but for consistency with the new scheme in D17603, should be:

"description": {
  "raw": "asdf"
}
182

Put an (int) cast on this so it emits into JSON as a number instead of a string (PHP is all loosey-goosey about this stuff and we currently don't try to enforce types when they come out of the database).

That is, the output currently shows:

"epoch": "19831981098"

...but better is:

"epoch": 19831981098

...so that languages which care more will have an easier time interacting with the API.

This revision is now accepted and ready to land.Apr 13 2017, 7:30 PM
amckinley added inline comments.
src/applications/countdown/storage/PhabricatorCountdown.php
175

Should the type be int or integer?

src/applications/countdown/storage/PhabricatorCountdown.php
175

I think I've been using 'epoch' -- it's purely documentation for humans for now so it's kind of made up.

This revision was automatically updated to reflect the committed changes.