Open PatMyron opened 5 years ago
I think these endpoints would need to be un-hardcoded in config.json:
https://github.com/scribu/travis-stats/blob/56a3ad94c03381370b3c664bc104f449a61aa742/script.js#L2-L3
You can already set them using your own config:
https://github.com/scribu/travis-stats/blob/master/README.md#private-repositories
Though we should probably explicitly write travis-ci.com
in the readme.
@scribu Do API requests for public .com
projects need an API token?
I tried switching the endpoint: https://github.com/PatMyron/travis-stats/commit/ca9e88efe5803778ee7352b035b315122e93384d and hosting it: http://patmyron.com/travis-stats/#PatMyron/advent-of-code/master
but I get GET https://api.travis-ci.com/repos/PatMyron/advent-of-code/builds?event_type=push 401 (Unauthorized)
which is weird because it looks publicly accessible: https://api.travis-ci.com/repos/PatMyron/advent-of-code/builds?event_type=push
I guess so...
Pats-MacBook-Pro ~/Documents/GitHub/travis-stats $ curl https://api.travis-ci.com/repos/PatMyron/advent-of-code/builds?event_type=push
Pats-MacBook-Pro ~/Documents/GitHub/travis-stats $ curl https://api.travis-ci.org/repos/PatMyron/advent-of-code/builds?event_type=push
[{"id":478085788,"repository_id":22732954,"number":"2","state":"finished","result":0,"started_at":"2019-01-10T23:37:03Z","finished_at":"2019-01-10T23:58:26Z","duration":1283,"commit":"cce28c03fb95f235e5afd58e07ea0e4de9878061","branch":"master","message":"commenting out incomplete 2017 day 23 part 2","event_type":"push"},{"id":477661874,"repository_id":22732954,"number":"1","state":"finished","result":1,"started_at":"2019-01-10T04:25:16Z","finished_at":"2019-01-10T04:26:00Z","duration":44,"commit":"d7d3e849f3044bd4aae9f5d303bea7f8051608c9","branch":"master","message":"stripping new line at the end of the input","event_type":"push"}]
Pats-MacBook-Pro ~/Documents/GitHub/travis-stats $ wget https://api.travis-ci.com/repos/PatMyron/advent-of-code/builds?event_type=push
--2019-03-04 00:45:47-- https://api.travis-ci.com/repos/PatMyron/advent-of-code/builds?event_type=push Resolving api.travis-ci.com (api.travis-ci.com)... 54.221.210.75, 54.204.23.31, 54.225.193.6 Connecting to api.travis-ci.com (api.travis-ci.com)|54.221.210.75|:443... connected. HTTP request sent, awaiting response... 401 Unauthorized Username/Password Authentication Failed.
Also, config.json
gets blocked locally:
Access to XMLHttpRequest at 'file:///Users/patmy/Documents/GitHub/travis-stats/config.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
so changing defaultConfig
seems more portable:
https://github.com/scribu/travis-stats/blob/56a3ad94c03381370b3c664bc104f449a61aa742/script.js#L1-L4
It looks like this shows stats from
travis-ci.org
and nottravis-ci.com
: http://scribu.net/travis-stats/#PatMyron/advent-of-code/master https://travis-ci.com/PatMyron/advent-of-code/builds https://travis-ci.org/PatMyron/advent-of-code/buildsIt looks like
.org
is being deprecated in favor of.com
soon: https://blog.travis-ci.com/2018-05-02-open-source-projects-on-travis-ci-com-with-github-appsOver the next several months, we’ll be migrating all travis-ci.org repositories and customers to travis-ci.com