Skip to content

[MRG] Better handling of Circle CI artifact URLs #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 24, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Better handling of Circle CI artifact URLs
* Fix bug where /circle accepted digits anywhere in query
* Allow relative path to follow build number:

   e.g. http://scikit-learn.org/circle?7310/modules/svm.html
  • Loading branch information
jnothman committed Nov 23, 2016
commit e9bcfbe821ecbfd42d53f6be2d1dbdde18d8e6c2
11 changes: 7 additions & 4 deletions circle/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
<!--
(function() {
var query = window.___location.search.substring(1);
if (query.match(/[0-9]+/)) {
window.___location.href = 'https://' + query + '-843222-gh.circle-artifacts.com/0/home/ubuntu/scikit-learn/doc/_build/html/stable/index.html';
var matches = query.match(/^([0-9]+)(\/.*)?$/)
if (matches) {
var ci_id = matches[1];
var path = matches[2] || '';
window.___location.href = 'https://' + ci_id + '-843222-gh.circle-artifacts.com/0/home/ubuntu/scikit-learn/doc/_build/html/stable' + path;
} else {
var href_sans_query = window.___location.href.substring(0, window.___location.href.length - window.___location.search.length)
document.write('<p>Expected numeric query string to redirect to scikit-learn documentation build on CircleCI, e.g. ' + href_sans_query
+ '?12345.</p>')
document.write('<p>Expected numeric query string and optional path to redirect to scikit-learn documentation build on CircleCI, e.g. ' + href_sans_query
+ '?12345/modules/classes.html.</p>')
}
})();
-->
Expand Down