Build Artifact API returns incorrect path

The Build-Artifact endpoint has recently been broken
https://circleci.com/docs/api/v1-reference/#build-artifacts

The leading slash has been removed from path returned by the build artifact API endpoint.

eg. path is now :
path: “home/ubuntu/circleci-testing/baking/cherry-pie.png”,

was previously
path: “/home/ubuntu/circleci-testing/baking/cherry-pie.png”

It should be the later as per the example response.

    [
    {
        node_index: 0,
        path: "/home/ubuntu/circleci-testing/baking/cherry-pie.png",
        pretty_path: "/home/ubuntu/circleci-testing/baking/cherry-pie.png",
        url: "https://circleci.com/gh/circleci/testing/22/artifacts/0/home/ubuntu/circleci-testing/baking/cherry-pie.png"
    },
    {
        node_index: 0,
        path: "/home/ubuntu/circleci-testing/baking/rhubarb-pie.png",
        pretty_path: "/home/ubuntu/circleci-testing/baking/rhubarb-pie.png",
        url: "https://circleci.com/gh/circleci/testing/22/artifacts/0/home/ubuntu/circleci-testing/bakingrhubarb-pie.png"
    }
]

Although this problem hasn’t been happening for months and has only just appeared in the last few days, you can still list artifacts from about 3 months ago and still see the correct path returned from the API, although projects built since then will not contain the correct path.

Thank you for reporting this issue.

We are currently investigating.

Thanks, Is there any ETA on when this would be fixed. It’s just we use this API as part of our build process to pull in artifacts from seperate builds.

Wondering if I should create a work around.

Thanks for reporting this and forgive the delay getting back to you with a response.

I can confirm that the current response is correct and we don’t plan to change it.

The leading slash has been dropped to accommodate paths on CircleCI 2.0 builds. path is now relative to the project’s root or working_directory.

pretty_path now has the same value as path, so the information in this value is redundant. We are leaving it in the response for backwards compatibility.

I’m updating the docs now to reflect this.

Here’s an example request and response for public build:

curl https://circleci.com/api/v1.1/project/github/CircleCI-Public/circleci-demo-go/24/artifacts\?circle-token\=$CIRCLE_TOKEN

[ {
  "path" : "raw-test-output/go-test-report.xml",
  "pretty_path" : "raw-test-output/go-test-report.xml",
  "node_index" : 0,
  "url" : "https://24-88881093-gh.circle-artifacts.com/0/raw-test-output/go-test-report.xml"
}, {
  "path" : "raw-test-output/go-test.out",
  "pretty_path" : "raw-test-output/go-test.out",
  "node_index" : 0,
  "url" : "https://24-88881093-gh.circle-artifacts.com/0/raw-test-output/go-test.out"
} ]%