Page MenuHomePhabricator

Phame - create conduit API to create posts
ClosedPublic

Authored by btrahan on Mar 10 2014, 9:42 PM.
Tags
None
Referenced Files
F13188471: D8485.diff
Sat, May 11, 5:16 AM
F13181865: D8485.id20152.diff
Thu, May 9, 4:19 PM
F13181863: D8485.id20150.diff
Thu, May 9, 4:19 PM
F13181862: D8485.id20100.diff
Thu, May 9, 4:19 PM
F13181828: D8485.id.diff
Thu, May 9, 4:06 PM
F13181799: D8485.diff
Thu, May 9, 3:53 PM
Unknown Object (File)
Tue, May 7, 7:17 AM
Unknown Object (File)
Fri, May 3, 7:30 AM

Details

Reviewers
epriestley
chad
Maniphest Tasks
Restricted Maniphest Task
Commits
Restricted Diffusion Commit
rPa1faac0a21b8: Phame - create conduit API to create posts
Summary

nothing too crazy here. try to be smart about some defaults (i.e. phame title is optional and can be derived from title; post as not a draft by default; etc). Fixes T3695.

also do a little re-factoring to centralizing initializing new posts and turning posts into dictionaries. also change blogs => posts in another conduit method so it makes sense and stuff.

Test Plan

made some posts via conduit. testing trying to specify blogger, phame title, and isDraft, all worked nicely

Diff Detail

Repository
rP Phabricator
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

epriestley edited edge metadata.
epriestley added inline comments.
src/applications/phame/conduit/ConduitAPI_phame_createpost_Method.php
78

I think I'm just going to define some kind of "404 Not Found" error for Conduit in general, probably >50% of the error codes we emit are just "no such thing exists".

src/applications/phame/conduit/ConduitAPI_phame_queryposts_Method.php
100–102

Looks like this got copy'd instead of cut'd? I think 103...115 have moved elsewhere.

This revision is now accepted and ready to land.Mar 11 2014, 8:10 PM

Got this error trying to update this

>>> [37] <conduit> differential.updaterevision() <bytes = 1298>
>>> [38] <http> https://secure.phabricator.com/api/differential.updaterevision
<<< [38] <http> 102,645 us
<<< [37] <conduit> 102,907 us

[2014-03-11 15:05:38] EXCEPTION: (ConduitClientException) ERR-CONDUIT-CORE: Request attempts to update field "reviewedByPHIDs", but that field can not perform transactional updates. at [/Users/btrahan/Dropbox/code/libphutil/src/conduit/ConduitFuture.php:57]
#0 ConduitFuture::didReceiveResult(Array of size 3 starting with: { 0 => Object HTTPFutureResponseStatusHTTP }) called at [/Users/btrahan/Dropbox/code/libphutil/src/future/FutureProxy.php:61]
#1 FutureProxy::getResult() called at [/Users/btrahan/Dropbox/code/libphutil/src/future/FutureProxy.php:38]
#2 FutureProxy::resolve() called at [/Users/btrahan/Dropbox/code/libphutil/src/conduit/ConduitClient.php:26]
#3 ConduitClient::callMethodSynchronous(differential.updaterevision, Array of size 4 starting with: { fields => Array of size 8 starting with: { title => Phame - create conduit API to create posts } }) called at [/Users/btrahan/Dropbox/code/arcanist/src/workflow/ArcanistDiffWorkflow.php:559]
#4 ArcanistDiffWorkflow::run() called at [/Users/btrahan/Dropbox/code/arcanist/scripts/arcanist.php:321]

...I think the fix is DifferentialReviewedByField->shouldAppearInApplicationTransactions() should return true?

btrahan edited edge metadata.

delete what was meant to be cut but was in fact copied

this update is also a test for D8941

Is it expected that you have to "accept" again?

epriestley edited edge metadata.

Nope, I'll look at that. Those "?" statuses aren't correct either.

This revision is now accepted and ready to land.Mar 11 2014, 10:51 PM
btrahan updated this revision to Diff 20152.

Closed by commit rPa1faac0a21b8 (authored by @btrahan).