Compare Builds

Xray REST APIs

Products
JFrog Xray
Content Type
REST API
ft:sourceType
Paligo

Description: Compares two builds and produces the difference between them

Security: Requires a valid user with the "Read" permission

Usage: POST /dependencyGraph/buildDelta

Consumes: application/json

Artifactory ID

The artifactory_id parameter is no longer required in Xray version 3.x, this parameter (also within a path) will be ignored.

{
 "source_artifactory_id":"<First instance name>",
 "source_build_name":"<First build name>",
 "source_build_number":"<First build number>",
 "target_artifactory_id":"<Second instance name>",
 "target_build_name":"<Second build name>",
 "target_build_number":"<Second build number>"
}

Produces: application/json

{
  "source_build":{
    "name": "<The name of the source build we are comparing>",
    "path": "<artifactory-name/repo-name/path>",
    "pkg_type": "<Package type>",
    "sha256": "<Build's SHA256 checksum>",
    "component_id": "<Build's component ID>",
  },
  "target_build":{
    "name": "<The name of the target build we are comparing>",
    "path": "<artifactory-name/repo-name/path>",
    "pkg_type": "<Package type>",
    "sha256": "<Build's SHA256 checksum>",
    "component_id": "<Build's component ID>",
  },
  "removed":[
    {
      "component_name":"<Component name only found in source build>",
      "component_id":"<Dependency Component ID only found in source build>",
      "package_type":"<Dependency component package type>",
      "version":"<Dependency component version>",
      "created":"<ISO8601 (yyyy-MM-dd'T'HH:mm:ss.SSSZ)>",
      "modified":"<ISO8601 (yyyy-MM-dd'T'HH:mm:ss.SSSZ)>"
    }
  ],
  "added":[
    {
      "component_name":"<Component name only found in target build>",
      "component_id":"<Dependency Component ID only found in target build>",
      "package_type":"<Dependency component package type>",
      "version":"<Dependency component version>",
      "created":"<ISO8601 (yyyy-MM-dd'T'HH:mm:ss.SSSZ)>",
      "modified":"<ISO8601 (yyyy-MM-dd'T'HH:mm:ss.SSSZ)>",
    }
  ],
 "unchanged":[
    {
      "component_name":"<Component name only found in both builds>",
      "component_id":"<Dependency Component ID only found in both builds>",
      "package_type":"<Dependency component package type>",
      "version":"<Dependency component version>",
      "created":"<ISO8601 (yyyy-MM-dd'T'HH:mm:ss.SSSZ)>",
      "modified":"<ISO8601 (yyyy-MM-dd'T'HH:mm:ss.SSSZ)>",
    }
  ]
}

Sample Usage:

POST /dependencyGraph/buildDelta
{
 "origin_build_artifactory_instance":"my-instance",
 "origin_build_name":"someOriginBuild",
 "origin_build_number":"111",
 "target_build_artifactory_instance":"my-instance",
 "target_build_name":"someTargetBuild",
 "target_build_number":"222",
}
 
{
  "source_build":{
    "name": "my-build",
      "path": "art2/ext-release-local/",
      "pkg_type": "Generic",
      "sha256": "d160c68ed8879ae42756e159daec1dd7ecfd53b6192321656b72715e20d46dd2",
      "component_id": "gav://org.artifactory.pro:artifactory-pro-war:4.14.0"
  },
  "target_build":{
    "name": "my-build",
      "path": "art2/ext-release-local/",
      "pkg_type": "Generic",
      "sha256": "d160c68ed8879ae42756e159daec1dd7ecfd53b6192321656b72715e20d46dd2",
      "component_id": "gav://org.artifactory.pro:artifactory-pro-war:4.14.0"
  },
  " removed":[
    {
      "component_name":"some-component-1.1",
      "component_id":"pip://some-component:1.1",
      "package_type":"pip",
      "version":"1.1",
      "created":"2008-06-09T16:50:19Z",
      "modified":"2015-07-26T17:49:47Z"
    }
  ],
  "added":[
    {
      "component_name":"Jinja2.7.2",
      "component_id":"pip://Jinja2:2.7.2",
      "package_type":"pip",
      "version":"2.7.2",
      "created":"2008-06-09T16:50:19Z",
      "modified":"2015-07-26T17:49:47Z"
    }
  ],
 "unchanged":[
    {
      "component_name":"Apache1.4",
      "component_id":"gav://apache:1.4",
      "package_type":"maven",
      "version":"1.4",
      "created":"2008-06-09T16:50:19Z",
      "modified":"2015-07-26T17:49:47Z"
    }
  ]
}

Response Codes:200: Success

400: The build with the provided identifier doesn't exist or isn't indexed in Xray

401: Bad credentials

415: Failed to parse request