Merge lp://staging/~cjohnston/ubuntu-ci-services-itself/ts-ticket-read-api into lp://staging/ubuntu-ci-services-itself

Proposed by Chris Johnston
Status: Merged
Approved by: Chris Johnston
Approved revision: 38
Merged at revision: 41
Proposed branch: lp://staging/~cjohnston/ubuntu-ci-services-itself/ts-ticket-read-api
Merge into: lp://staging/ubuntu-ci-services-itself
Diff against target: 513 lines (+417/-4)
8 files modified
docs/components/ticket-system.rst (+7/-0)
ticket_system/ticket/api.py (+89/-0)
ticket_system/ticket/migrations/0001_initial.py (+2/-2)
ticket_system/ticket/models.py (+2/-2)
ticket_system/ticket/tests/__init__.py (+18/-0)
ticket_system/ticket/tests/test_full_read_api.py (+126/-0)
ticket_system/ticket/tests/test_read_api.py (+163/-0)
ticket_system/ticket_system/urls.py (+10/-0)
To merge this branch: bzr merge lp://staging/~cjohnston/ubuntu-ci-services-itself/ts-ticket-read-api
Reviewer Review Type Date Requested Status
Ursula Junque (community) Approve
Francis Ginther Approve
Review via email: mp+198870@code.staging.launchpad.net

Commit message

Add read API to tickets

To post a comment you must log in.
31. By Andy Doan

[r=Francis Ginther] Disable the requirement for ApiKey authentication for TastyPie componenents.

For the first phase of this project we are going to disable authentication. By doing this, we get the added bonus of not having to lug around the ugly "USE_TZ=True" hack. from Andy Doan

32. By Andy Doan

[r=Evan Dandrea] make the ticket-system deployable via django charm from Andy Doan

33. By Chris Johnston

[r=Francis Ginther, Andy Doan] Add a write API for adding people, update docs with API examples from Chris Johnston

34. By Andy Doan

[r=Francis Ginther] Disable the requirement for ApiKey authentication for TastyPie componenents.

For the first phase of this project we are going to disable authentication. By doing this, we get the added bonus of not having to lug around the ugly "USE_TZ=True" hack. from Andy Doan

35. By Andy Doan

[r=Francis Ginther] this moves some utility code out of the branch-source-builder and into ci-utils for others to use. from Andy Doan

36. By Andy Doan

[r=Vincent Ladeuil] configure a default LP user for the ppa-assigner in the juju deployer

also fixes a typo/bug for the dependencies
  from Andy Doan

37. By Andy Doan

[r=Vincent Ladeuil] add documentation on how to set up an oauth token from Andy Doan

38. By Chris Johnston

Fix conflict

Revision history for this message
Ursula Junque (ursinha) wrote :

Hi Chris,

I have one question:

Other components will need to reach subtickets directly to update their status, for example the Lander needs to reach the subticket to mark it as built. AFAIK all other components will use the Ticket ID to reach it, so we'd need to do something like api/v1/ticket/foobar/123, 'foobar' being the source package name and 123 the ticket ID. Is that possible with tastypie? If not, we could do something like 'foobar-123' and parse it. This way you wouldn't need to expose subticket directly, as it would be only used internally, considering the fullticket displays all subtickets and for WebUI purposes that should be enough.

Of course, this approach works considering there will be only one source package upload in active state per source package in a ticket -- others can correct me if I'm wrong and we should consider several landings of the same SP in a single ticket.

Cheers,

Revision history for this message
Chris Johnston (cjohnston) wrote :

I believe what your referring to here can be accomplished by nested
resources from tastypie, however IMO it is outside the scope of this MP.
This MP is purely for consuming data from the ticket system, mainly for the
web UI. Any other concerns with this MP?

Revision history for this message
Francis Ginther (fginther) wrote :

For the initial phase, the lander and other internal components will not be sending updates via the REST API. The only consumers for the this API should be the front end web ui.

review: Approve
Revision history for this message
Chris Johnston (cjohnston) wrote :

Francis, how will the ticket statuses be kept up to date?

Revision history for this message
Francis Ginther (fginther) wrote :

> Francis, how will the ticket statuses be kept up to date?

The original design had the ticket system polling the lander for progress. This was updated to use a message queue instead. The ticket system provides a message queue handle to the lander as part of the execute_request call. The lander then uses this to provide regular progress updates (every 60 seconds or sooner if status changes). The exact details of what is in the message haven't been designed yet, but it would probably have to provide the status of all lander stages in each message. For example:

{"Package Building": "Completed",
 "Image Building": "In Progress",
 "Image Testing": "Not Started",
 "Package Publishing": "Not Started"}

Revision history for this message
Chris Johnston (cjohnston) wrote :

Ok, so the TS will be polling the message queue looking for status changes?

Revision history for this message
Ursula Junque (ursinha) wrote :

> Ok, so the TS will be polling the message queue looking for status changes?

That's my understanding, confirmed by fginther:
<Ursinha> fginther, let me see if I got the message queue idea: "Lander" updates whatever it is in the message queue, ticket system polls the message queue for updates, therefore there's no need of a write API to update ticket status for phase 0?
<fginther> Ursinha, yes, you're correct

(slightly edited for simplicity :))

Revision history for this message
Andy Doan (doanac) wrote :

On Mon, Dec 16, 2013 at 7:31 PM, Ursula Junque <email address hidden> wrote:

> That's my understanding, confirmed by fginther:
> <Ursinha> fginther, let me see if I got the message queue idea: "Lander"
> updates whatever it is in the message queue, ticket system polls the
> message queue for updates, therefore there's no need of a write API to
> update ticket status for phase 0?
> <fginther> Ursinha, yes, you're correct
>

We have a "rabbit worker" example that you can steal from to get started:

http://bazaar.launchpad.net/~canonical-ci-engineering/ubuntu-ci-services-itself/trunk/view/head:/branch-source-builder/run_worker

Its juju deployable with:

http://bazaar.launchpad.net/~canonical-ci-engineering/ubuntu-ci-services-itself/trunk/view/head:/juju-deployer/branch-source-builder.yaml#L17

I'm guessing your "on_message" calls would basically be updates to the
django model or something

Revision history for this message
Ursula Junque (ursinha) wrote :

For phase 0 I think this is okay, I'll make the necessary changes for subticket when we need it later.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches