Closed Bug 1137519 Opened 10 years ago Closed 10 years ago

Add Pulse Consumer for Treeherder Job Action messages.

Categories

(Webtools :: Pulse, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: bc, Unassigned)

References

Details

Attachments

(1 obsolete file)

Attached patch TreeherderJobActionsConsumer.patch (obsolete) (deleted) — Splinter Review
Bug 1113281 introduced the ability for Treeherder to emit pulse messages when a user initiates a job retrigger or cancel via the Treeherder UI. It would be good to make a standard consumer which people could use to get such messages. Since we may have different exchanges for Treeherder production, staging, dev or local instances, I think adding a parameter to the constructor to specify the exchange to be used is appropriate rather than having multiple constructors for the various cases. This patch by default uses the exchange "exchange/treeherder-stage/v1/job-actions" from mozillapulse.consumers import TreeherderJobActionsConsumer pulse = TreeherderJobActionsConsumer(**pulse_args) or allow the user to override the exchange pulse = TreeherderJobActionsConsumer( exchange='exchange/treeherder-stage/v1/job-actions', **pulse_args) or you could even put the exchange in the pulse_args dict and pass it implicitly. This would support run-time switching of the exchange depending on a configuration option. lightsofapollo: Will the production Treeherder use the value "exchange/treeherder/v1/job-actions" for the exchange?
Attachment #8570209 - Flags: feedback?(mdoglio)
Attachment #8570209 - Flags: feedback?(mcote)
Attachment #8570209 - Flags: feedback?(jlal)
(In reply to Bob Clary [:bc:] from comment #0) Should have said: > > This patch by default uses the exchange > "exchange/treeherder/v1/job-actions"
Comment on attachment 8570209 [details] [diff] [review] TreeherderJobActionsConsumer.patch Review of attachment 8570209 [details] [diff] [review]: ----------------------------------------------------------------- It might be more convenient to just take the exchange-username suffix as a parameter, since the assertion there requires the rest of the exchange name to always be the same, e.g. c = TreeherderJobActionsConsumer('-staging', ...)
Attachment #8570209 - Flags: feedback?(mcote)
If we remove the exchange argument in favor of another which is something like a 'subexchange', we are still left with the possibility that the caller will use the full set of keyword arguments available from GenericConsumer which means we would need to handle the case where there were both an exchange and a subexchange. This makes me think that creating a separate TreeherderJobActionsConsumer class is actually unnecessary and that we should instead just use the GenericConsumer. from mozillapulse.consumers import GenericConsumer from mozillapulse.config import PulseConfiguration pulse_args = {...} pulse = GenericConsumer(PulseConfiguration(**pulse_args), exchange='exchange/treeherder-stage/v1/job-actions', **pulse_args) What would you say if I just WONTFIXed this bug?
Flags: needinfo?(mcote)
That's actually fine by me too, since we'll be (eventually) moving to a new, better Pulse library.
Flags: needinfo?(mcote)
Attachment #8570209 - Attachment is obsolete: true
Attachment #8570209 - Flags: feedback?(mdoglio)
Attachment #8570209 - Flags: feedback?(jlal)
Okie Dokie.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: