Opened on 04/18/2014 at 09:46:58 PM

Closed on 05/06/2014 at 08:52:55 AM

Last modified on 10/22/2014 at 11:32:51 AM

#356 closed change (fixed)

Implement Chrome Web Store API in order to update the devbuild

Reported by: sebastian Assignee: sebastian
Priority: P1 Milestone:
Module: Automation Keywords:
Cc: fhd, trev, smultron45@gmail.com Blocked By:
Blocking: #364 Platform:
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):

http://codereview.adblockplus.org/5092904657747968/
http://codereview.adblockplus.org/5673709830406144/
http://codereview.adblockplus.org/6043052758007808/
http://codereview.adblockplus.org/6282207912001536/

Description (last modified by sebastian)

Background

We have to publish our devbuild in the Chrome Web Store (see #364), but want keep the devbuild automatically in sync with the content of the repository.

What to change

Use the Chrome Webstore API to automatically update the devbuild in the Web Store whenever a new devbuild is available.

Attachments (0)

Change History (23)

comment:1 Changed on 04/18/2014 at 09:48:47 PM by sebastian

  • Summary changed from Get devbuilds in to the Chrome Web Store to Publish the devbuild on the Chrome Web Store

comment:2 Changed on 04/19/2014 at 06:31:38 AM by mapx

  • Cc smultron45@gmail.com added

comment:3 Changed on 04/19/2014 at 04:16:06 PM by sebastian

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:4 Changed on 04/21/2014 at 02:41:48 PM by sebastian

  • Blocking 364 added

comment:5 Changed on 04/21/2014 at 02:42:37 PM by sebastian

  • Description modified (diff)
  • Summary changed from Publish the devbuild on the Chrome Web Store to Implement Chrome Web Store API in order to update the devbuild

comment:6 Changed on 04/22/2014 at 06:38:29 AM by sebastian

  • Owner set to sebastian
  • Status changed from reviewing to assigned

comment:7 Changed on 04/22/2014 at 06:38:35 AM by sebastian

  • Resolution set to fixed
  • Status changed from assigned to closed
Last edited on 04/22/2014 at 08:05:23 AM by sebastian

comment:8 Changed on 04/22/2014 at 08:04:09 AM by trev

This broke development build generation:

AttributeError: 'NightlyBuild' object has no attribute 'type'

Fixed it in https://hg.adblockplus.org/sitescripts/rev/75f3cfd0eb82

comment:9 Changed on 05/05/2014 at 01:19:12 PM by trev

  • Ready set
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening: we need to specify a separate gallery ID for the devbuild upload (usual gallery ID is the stable version). Also, we need to make sure that the build isn't just uploaded but also published - currently it stays there as a draft.

comment:10 Changed on 05/05/2014 at 02:14:27 PM by sebastian

  • Review URL(s) modified (diff)
  • Status changed from reopened to reviewing

comment:11 Changed on 05/05/2014 at 03:38:12 PM by sebastian

  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:12 Changed on 05/05/2014 at 03:52:40 PM by trev

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening once again - while the draft upload succeeds now, publishing doesn't. The processing of the upload request overwrites the response variable, consequently the publish request fails when it tries to use response['token_type'].

comment:13 Changed on 05/05/2014 at 03:57:38 PM by sebastian

  • Review URL(s) modified (diff)
  • Status changed from reopened to reviewing

comment:14 Changed on 05/05/2014 at 04:07:12 PM by sebastian

  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:15 Changed on 05/05/2014 at 04:16:54 PM by trev

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening once more - this time I got "400 Bad Request" from the publish request. Feel free to test your changes before uploading a review ;)

comment:16 Changed on 05/05/2014 at 04:27:07 PM by sebastian

That is not that easy, since I don't have access to our CWS account. I would have to publish a clone of Adblock Plus or at least a dummy extension with my personal CWS account, which would not only take a while to get published, but might also be against the CWS policy.

So could you please wrap the urlopen() call like following and post the error here? Thanks.

try:
   response = json.load(urllib2.urlopen(...))
except urllib2.HTTPError as e:
   print e.read()

comment:17 Changed on 05/06/2014 at 06:48:14 AM by sebastian

  • Review URL(s) modified (diff)
  • Status changed from reopened to reviewing

Apparently the publish URL was wrong. Should be fixed with the new patch. If you still get an error, please provide the error response body, since I can only hardly reproduce it myself.

comment:18 Changed on 05/06/2014 at 06:49:27 AM by trev

The error was: "reason":"badContent","message":"Unsupported content with type: application/octet-stream". Turned out the endpoint URL is wrong, it's https://www.googleapis.com/chromewebstore/v1.1/items/%s/publish - without upload.

After fixing this the upload succeeded but produced an exception with the status message OK - it seems that the documentation doesn't list all the possible statuses. So please extend the exception code there to report the actual status as well, next time we'll know what the Web Store returns on success.

Finally, please make sure to always report response body here to make debugging easier. Most clean solution should be implementing an own HTTPErrorProcessor class.

comment:19 Changed on 05/06/2014 at 07:09:32 AM by philll

  • Cc philll removed

comment:20 Changed on 05/06/2014 at 08:39:01 AM by sebastian

  • Status changed from reviewing to reopened

I leave the ticket open, since we still have to figure out and add the status, that is returned when the item were successfuly published.

https://hg.adblockplus.org/sitescripts/rev/d57a01bb362f
https://hg.adblockplus.org/sitescripts/rev/3a02793b406a
https://hg.adblockplus.org/sitescripts/rev/f02c4c3c2ad5

Last edited on 05/06/2014 at 08:39:38 AM by sebastian

comment:21 Changed on 05/06/2014 at 08:47:08 AM by trev

There was a typo in one of the changes, the class is referred to as HTTPErrorHandler rather than HTTPErrorBodyHandler.

After fixing it, the exception is {'status': [u'OK'], 'statusDetail': [u'OK.']} - so the status is apparently indeed OK.

comment:22 Changed on 05/06/2014 at 08:52:55 AM by sebastian

  • Resolution set to fixed
  • Status changed from reopened to closed

comment:23 Changed on 10/22/2014 at 11:32:51 AM by sebastian

  • Cc sebastian removed

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from sebastian.
 
Note: See TracTickets for help on using tickets.