toolchainlabs / issues

Public repo just for filing bugs and feature requests
0 stars 0 forks source link

APIs to enable for downloading trace data #13

Open ryanking opened 2 years ago

ryanking commented 2 years ago

We would like to be able to download trace data from all (or some subset) or our pants runs.

I would like to build a small tool that runs this algorithm, likely on cron-like schedule every few minutes:

builds = list_recent_builds()
for build in build:
  trace_data = get_trace_data(build)
  upload_trace(trace_data)

I would be happy to have to keep track of which builds we have seen, but efficient pagination (show me builds since id x or since time t) would be useful.

I can see all the data we want in the web app already and even tried to do this in a hacky way–

$ export TOOLCHAIN=`cat .pants.d/toolchain_auth/auth_token.json  | jq  -r .access_token`
$ curl -i -H "Authorization: bearer $TOOLCHAIN"  https://app.toolchain.com/api/v1/repos/color/color/builds/
HTTP/2 403 
...