TeamForge EventQ Builds API

Submission parameters

Submission queue
  • queue_name: eventq.builds
  • auto_delete: false
  • durable: true
Top-level
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 builds with the appropriate source server.
Example: "source_association_key": "6t5qM5AuLLWLkmqFJeKp"
build_data Required The raw build data, as provided by the build system.
Objects
build_data - The following fields should be in this build object.
Field Required/Optional Description
remote_id Required A string to uniquely identify the build. It will appear in the UI.
duration Required A string containing time (in seconds) it took for a build agent to build.
event_time Required A string containing a timestamp in UTC timezone and RFC 3339 format.
build_url Required A string with the URL to the build summary. Please note that the fully qualified URL with the URL scheme is required.
created_by Optional A string containing the username of the person who triggered the build.
status Required An object that declares the status of the build object.

Accepted values

  • type (Required) - A string representing the type of the status. Please note that any type other than the listed below will be used as UNKNOWN inside TeamForge EventQ.
    • SUCCESS
    • FAILURE
    • UNSTABLE
    • ABORTED
  • name (Required) - A user-friendly display name for the status.
test_results Optional An object containing the test results summary.

Accepted values

  • passed_count - A string containing the number of passed tests.
  • failed_count - A string containing the number of failed tests.
  • ignored_count - A string containing the number of ignored tests.
  • url - A string containing the URL to the test results. Please note that the fully qualified URL with the URL scheme is required.
revisions Optional An array of objects containing the SCM revisions related to this build.

Accepted values

  • revision (Required) - A string containing the commit revision id.
  • repository_url (Required) - A string containing the repository url.
event_time Required A string containing a timestamp in UTC timezone and RFC 3339 format.
created_by Required The user name of the person who took the action.

Examples

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]

Sample Submission JSON
{
    "api_version": "1",
    "source_association_key": "29bf0c90-3b40-0130-ae2d-dddd5893",
    "build_data": {
    "remote_id": "700",
        "event_time": "2012-10-02T17:15:32.320Z",
        "duration": "200",
        "build_url": "http://example.com/builds/600",
        "created_by": "admin",
        "status": {
            "type": "SUCCESS",
            "name": "SUCCESSFUL"
        },
        "test_results": {
            "passed_count": "10",
            "failed_count": "0",
            "ignored_count": "0",
            "url": "http://example.com/builds/600/tests"
        },
        "revisions":
            [{ "revision": "fb849a2440dda438f4c6ab25f8c3266ed82d8797",
             "repository_url": "ssh://gitserver/project"
            }]
        }
  }
Ruby Submission Example
You will need to change the following example before you can run it. Set the Rabbit MQ hostname and the association key, and paste a JSON block following the build format specified on this page.
 require 'amqp'

      QUEUE = 'eventq.builds'
      BUILD = '{
        "api_version": "1",
        "source_association_key": "29bf0c90-3b40-0130-ae2d-dddd5893",
        "build_data": {
            "remote_id": "700",
            "event_time": "2012-10-02T17:15:32.320Z",
            "duration": "200",
            "build_url": "http://example.com/builds/600",
            "created_by": "admin",
            "status": {
                "type": "SUCCESS",
                "name": "SUCCESSFUL"
            },
            "test_results": {
                "passed_count": "10",
                "failed_count": "0",
                "ignored_count": "0",
                "url": "http://example.com/builds/600/tests"
             },
            "revisions":
             [{ "revision": "fb849a2440dda438f4c6ab25f8c3266ed82d8797",
             "repository_url": "ssh://gitserver/project"
              }]
        }
      }'
      # 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 build and exit the loop
        exchange.publish BUILD, :routing_key => queue.name do
          connection.disconnect {EventMachine.stop}
        end
      end