Skip to content
FeedbackDashboard

Creates two comparable builds

$client->builds->compare(Base base, Head head, string project, ?list<Target> targets): BuildCompareResponse
POST/v0/builds/compare

Create two builds whose outputs can be directly compared with each other.

Created builds modify their project branches so that their latest sets of config files point to the ones specified by the input revision.

This endpoint is useful because a build has more inputs than the set of config files it uses, so comparing two builds directly may return spurious differences. Builds made via this endpoint are guaranteed to have differences arising from the set of config files, and any custom code.

ParametersExpand Collapse
base: Base

Parameters for the base build

head: Head

Parameters for the head build

project: string

Project name

targets?:optional list<Target>

Optional list of SDK targets to build. If not specified, all configured targets will be built.

ReturnsExpand Collapse

Creates two comparable builds

<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client(apiKey: 'My API Key', environment: 'staging');

$response = $client->builds->compare(
  base: [
    'branch' => 'branch',
    'revision' => 'string',
    'commitMessage' => 'commit_message',
  ],
  head: [
    'branch' => 'branch',
    'revision' => 'string',
    'commitMessage' => 'commit_message',
  ],
  project: 'project',
  targets: [Target::NODE],
);

var_dump($response);
{
  "base": {
    "id": "id",
    "config_commit": "config_commit",
    "created_at": "2019-12-27T18:11:19.117Z",
    "documented_spec": {
      "content": "content",
      "type": "content"
    },
    "object": "build",
    "org": "org",
    "project": "project",
    "targets": {
      "cli": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "csharp": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "go": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "java": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "kotlin": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "node": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "openapi": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "php": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "python": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "ruby": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "sql": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "terraform": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "typescript": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      }
    },
    "updated_at": "2019-12-27T18:11:19.117Z"
  },
  "head": {
    "id": "id",
    "config_commit": "config_commit",
    "created_at": "2019-12-27T18:11:19.117Z",
    "documented_spec": {
      "content": "content",
      "type": "content"
    },
    "object": "build",
    "org": "org",
    "project": "project",
    "targets": {
      "cli": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "csharp": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "go": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "java": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "kotlin": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "node": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "openapi": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "php": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "python": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "ruby": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "sql": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "terraform": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "typescript": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      }
    },
    "updated_at": "2019-12-27T18:11:19.117Z"
  }
}
Returns Examples
{
  "base": {
    "id": "id",
    "config_commit": "config_commit",
    "created_at": "2019-12-27T18:11:19.117Z",
    "documented_spec": {
      "content": "content",
      "type": "content"
    },
    "object": "build",
    "org": "org",
    "project": "project",
    "targets": {
      "cli": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "csharp": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "go": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "java": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "kotlin": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "node": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "openapi": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "php": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "python": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "ruby": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "sql": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "terraform": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "typescript": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      }
    },
    "updated_at": "2019-12-27T18:11:19.117Z"
  },
  "head": {
    "id": "id",
    "config_commit": "config_commit",
    "created_at": "2019-12-27T18:11:19.117Z",
    "documented_spec": {
      "content": "content",
      "type": "content"
    },
    "object": "build",
    "org": "org",
    "project": "project",
    "targets": {
      "cli": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "csharp": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "go": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "java": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "kotlin": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "node": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "openapi": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "php": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "python": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "ruby": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "sql": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "terraform": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      },
      "typescript": {
        "commit": {
          "status": "not_started"
        },
        "install_url": "install_url",
        "object": "build_target",
        "status": "not_started",
        "build": {
          "status": "not_started"
        },
        "lint": {
          "status": "not_started"
        },
        "test": {
          "status": "not_started"
        }
      }
    },
    "updated_at": "2019-12-27T18:11:19.117Z"
  }
}