Parameter | Required/Optional | Description |
---|---|---|
api_version | Required | A string that matches the API version this document is for. |
source_association_key | Required | A key generated by TeamForge EventQ that links incoming review requests with the appropriate source server. |
Example: "source_association_key": "31e8dd90-164f-0130-c4d0-406c8f04c05d" | ||
request_data | Required | The raw review request data, as provided by the review server. |
Field | Required/Optional | Description |
---|---|---|
remote_id | Required | A string to uniquely identify the review request. |
link | Optional | A URL that points back to this individual review. |
summary | Optional | A string to summarize the review request. |
description | Optional | A longer string that can be used to further describe the review request. It will appear in the UI. |
created_by | Required | A string containing the username of the person who submitted the request (e.g., initiated this request event, NOT necessarily the creator of the review; in some instances, this may consistently be an administrative user). |
status | Required | An object that declares the status of the review request. |
Accepted values
|
||
event_time | Required | A string containing a timestamp in UTC timezone and RFC 3339 format. |
updated_by | Optional | A string containing the username of the person performing the update. |
files | Optional | An array of objects with optional SCM revision information. If included, only the file name is required. |
Accepted values
|
||
reviewers | Optional | A array of user hashes. Optional reviewer information. If included, only the user name is required. For some systems (e.g., Crucible), reviewers are only reported when they have marked the review 'completed' or 'reviewed'; other systems (e.g., Review Board) report reviewers when they add comments or make other changes to a review. |
Accepted values
|
The following code examples are Copyright 2020 CollabNet, Inc., licensed under the Apache License, Version 2.0 (the "License"); you may not use this code except in compliance with the License. You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0]
{ "api_version": "1", "source_association_key" : "31e8dd90-164f-0130-c4d0-406c8f04c05d", "request_data" : { "remote_id": "42", "link": "http://reviewserver/review/42/", "summary": "The summary of the request", "description": "An extended description of what the request covers", "status": { "type": "open", "name": "Review" }, "event_time": "2012-10-02T17:15:32.320Z", "created_by": "username", "updated_by": "username", "files": [ { "revision": "ef9f8fe661992f48c3539c05fc5c69c61918fa17", "file": "commit1_file1.txt", "repository_url": "ssh://gitserver/project" }, { "revision": "ef9f8fe661992f48c3539c05fc5c69c61918fa17", "file": "commit1_file2.txt", "repository_url": "ssh://gitserver/project" }, { "revision": "fb849a2440dda438f4c6ab25f8c3266ed82d8797", "file": "commit2_file1.txt", "repository_url": "ssh://othergitserver/project" } ], "reviewers": [ { "username": "adent", "link": "http://reviewserver/user/adent" }, { "username": "fprefect", "link": "http://reviewserver/user/fprefect" } ] } }
require 'amqp' QUEUE = 'eventq.reviews' REVIEW = '{ "api_version": "1", "source_association_key" : "31e8dd90-164f-0130-c4d0-406c8f04c05d", "request_data" : { "remote_id": "42", "link": "http://reviewserver/review/42/", "summary": "The summary of the request", "description": "An extended description of what the request covers", "status": { "type": "open", "name": "Review" }, "event_time": "2012-10-02T17:15:32.320Z", "created_by": "username", "files": [ { "revision": "ef9f8fe661992f48c3539c05fc5c69c61918fa17", "file": "commit1_file1.txt", "repository_url": "ssh://gitserver/project" }, { "revision": "ef9f8fe661992f48c3539c05fc5c69c61918fa17", "file": "commit1_file2.txt", "repository_url": "ssh://gitserver/project" }, { "revision": "fb849a2440dda438f4c6ab25f8c3266ed82d8797", "file": "commit2_file1.txt", "repository_url": "ssh://othergitserver/project" } ], "reviewers": [ { "username": "adent", "link": "http://reviewserver/user/adent" }, { "username": "fprefect", "link": "http://reviewserver/user/fprefect" } ] } }' # Event loop EventMachine.run do connection = AMQP.connect('amqp://guest:guest@example-mq') # Set up our RabbitMQ information channel = AMQP::Channel.new(connection) queue = channel.queue(QUEUE, :auto_delete => false, durable: true) exchange = channel.direct('') # Publish the activity and exit the loop exchange.publish REVIEW, :routing_key => queue.name do connection.disconnect {EventMachine.stop} end end