Commit Graph

119 Commits

Author SHA1 Message Date
Hiro Asari
a622de2a9f Merge branch 'master' into hh-add-metadata-endpoint
Update Gemfile.lock to point to the updated travis-core PR

Conflicts:
	Gemfile.lock
	lib/travis/api/app/endpoint/jobs.rb
	spec/integration/v2/jobs_spec.rb
2014-01-17 09:16:41 -05:00
Piotr Sarnacki
e11dfa35cf Fix PATCH repos/:id/settings 2013-12-02 15:36:58 +01:00
Piotr Sarnacki
62a5e602c5 Implement simple repository settings API 2013-12-02 15:36:25 +01:00
Hiro Asari
d31a29e54d Fix grammar in spec description 2013-12-01 20:42:46 -05:00
Piotr Sarnacki
39260c3918 Fix specs after travis-core update 2013-11-28 18:08:39 +01:00
Hiro Asari
362b5d30bf Respond to /repos.xml with CC XML
See #47
2013-11-18 16:55:11 -05:00
Piotr Sarnacki
e61a723d06 Fix scoping spec
After bundle update 403 error was returned after unsuccessful scopes
check. This is actually a proper behaviour, so I'm changing test to
reflect this test.
2013-11-12 22:16:47 +01:00
Hiro Asari
3b20120c72 Accept .atom extension
And return Atom feed for builds.
Specs look different, because it needs to explicitly handle the common
case where the client sends `Accept: */*`.
2013-11-11 15:21:14 -05:00
Hiro Asari
8171d3915e Add integration specs for Atom feed
These rudimentary specs do not test the correctness of
the Atom feed format.
2013-11-11 11:40:37 -05:00
Josh Kalderimis
f7450cdb6b removed the branches endpoint
we already have branch info accessible via the repos endpoints, having this at the root level doesn't make sense.
2013-11-06 01:40:42 +01:00
Josh Kalderimis
342df12b14 remove old workers endpoints 2013-11-04 19:24:17 +01:00
Mathias Meyer
9d26844eaa Add tests for /uptime. 2013-08-26 17:29:10 +02:00
Piotr Sarnacki
f19de9d134 Implement jobs/:id/cancel and builds/:id/cancel endpoints 2013-08-08 14:25:20 +02:00
Henrik Hodne
be2c538d9e Rename metadata => annotations 2013-07-10 16:55:03 -07:00
Henrik Hodne
16a73d9e0b Add PUT /jobs/:id/metadata endpoint 2013-07-09 18:41:47 -07:00
Henrik Hodne
b103a7ccb1 Add GET /jobs/:job_id/metadata endpoint 2013-07-09 18:15:32 -07:00
Piotr Sarnacki
b6a351c766 Convert params['ids'] to array
Services like find_builds can accept :ids as a param, but it needs to be
an array, string will be passed to find and converted into integer.
2013-07-09 15:18:31 +02:00
Piotr Sarnacki
29fb7292cb Fix tests 2013-06-13 15:54:19 +02:00
Henrik Hodne
5f1f189c74 Remove references to "result" in specs
This column has now been removed in favor of the state columns.
2013-05-23 15:48:41 +02:00
Piotr Sarnacki
cdabec540d Fix scopes and access token specs 2013-05-08 14:11:03 +02:00
Piotr Sarnacki
3b299cfec7 Allow to pass required_params to token
required_params will be matched with actual params to check if the token
may be used for authorization. For example if { job_id: 44 } is passed
as a required param, the token will be rejected for GET /jobs/33
2013-05-08 14:11:03 +02:00
Piotr Sarnacki
ee64af14d5 Allow to specify more than one scope for an endpoint 2013-05-08 14:11:02 +02:00
Piotr Sarnacki
1340fdb316 Allow to pass additional responders to respond_with 2013-05-08 14:11:02 +02:00
Piotr Sarnacki
be22ff6eda Ensure that we properly handle 404 formats 2013-04-11 14:47:00 +02:00
Andre Arko
6940532994 Ensure proper content type for cc.xml 2013-03-25 16:09:15 +01:00
Konstantin Haase
92be2a3fcd fix test for new autosync 2013-03-20 19:53:38 +01:00
Piotr Sarnacki
705927ff74 Don't error out if xml is requested with something else than repo 2013-03-12 12:08:43 +01:00
Piotr Sarnacki
c0b9a468d6 Forgot to delete one of the tests 2013-03-11 23:58:58 +01:00
Piotr Sarnacki
54a6926aaf Properly handle non existent resources
This commit changes travis-api to always return 404 response if resource
is not available. Previously we were returning image/png with "unknown"
status instead if user used "*/*" Accept header, which was confusing.
2013-03-11 23:52:57 +01:00
Piotr Sarnacki
04bb751b02 When serving image, return proper Last-Modified header 2013-03-11 20:54:24 +01:00
Piotr Sarnacki
5345ef818e Use version from each of the accept headers, not only first one 2013-02-25 17:28:24 +01:00
Piotr Sarnacki
36783e6359 Handle chunked=true param in Accept header 2013-02-25 17:28:24 +01:00
Piotr Sarnacki
65b1e6b988 Respond with 406 if we can't return requested formats 2013-02-25 17:27:56 +01:00
Piotr Sarnacki
212eb6d9d3 Allow passing more than one mime type in Accept 2013-02-25 17:27:56 +01:00
Piotr Sarnacki
260c46181d Add hack to allow handling redirect to logs on the client properly.
This hack is temporary and should be removed when we find better
solution.

TL;DR: we can't handle redirects to S3 using CORS, so in case we want to
get logs from S3 without additional requests to API, we need to return
status that will not be automatically redirected (in this case 204 seems
like the best answer).

Longer rationale:

Old logs are hosted on S3 now and in case log is not available in the
database, we would like to redirect to the archived log. Although S3
support CORS, our use case breaks on some browsers:

  * when request is triggered to /jobs/:id/log and log is archived, api
    returns 302 redirect, Location header points to the log on S3
  * browser transparently redirects to given url, but it sets Origin to
    null, for security reasons
  * "Origin: null" is ok, because we allow every origin by setting
    AllowedOrigin to "*"
  * S3 returns "Access-Control-Allow-Origin: null" header, which breaks
    some browsers (I confirmed it for webkit based browsers)

In order to fix this, S3 would need to return * in
Access-Control-Allow-Origin header or we would need to tell the browser
to not follow redirect. Both solutions are not achiveable.

Another option would be to return log information in job payload - we
could send log_url field which should be either log url on amazon or
null, but in such case we would need to query artifacts table in each
job request. This is something that should be avoided as archived logs
are not frequently requested - slowing down every request to get info
for it would be a waste.
2013-01-29 03:51:22 +01:00
Piotr Sarnacki
a565522f41 Redirect to full amazon url
Amazon can't work properly with SSL and CNAME for subdomains. For now we
can use full amazon url.
2013-01-28 03:43:28 +01:00
Piotr Sarnacki
31371686c9 Redirect to archive logs 2013-01-28 03:04:36 +01:00
Sven Fuchs
7b4712c32c fix after rebase 2013-01-26 20:54:58 +01:00
Sven Fuchs
d441336573 expose logs on /job/:id/log.txt 2013-01-26 20:43:54 +01:00
Piotr Sarnacki
f2d768080f Return last builds on each branch for /builds?branches=true
This is a hack to fix travis-ci/travis-web#123 easier. A proper solution
would be to refactor how /branches work.
2013-01-26 01:12:47 +01:00
Piotr Sarnacki
c6e3c29a57 Load the data for integration tests upfront
We can do it, because we use :transaction strategy with DatabaseCleaner,
which starts transaction before each test and rollbacks after it. That
way data before each test is consistent.

The big advantage of such approach is that tests are fast now - we need
to only load Scenario data once.

One of the drawbacks, on the other hand, is that we need to always load
this data, even if no integration tests need running.

We can try to be smart about it and check if any integration tests are
loaded.
2013-01-26 00:00:42 +01:00
Piotr Sarnacki
36c40da55d Fix workers tests 2013-01-24 14:37:05 +01:00
Sven Fuchs
d113833e9a fix xml responder and result image specs 2012-12-09 16:02:00 +01:00
Sven Fuchs
751e88411b adapt most specs for new states api, some stuff still failing 2012-12-09 15:16:50 +01:00
Piotr Sarnacki
440dacece3 Add endpoints for key regeneration
Enpoints are:

    POST /repos/:id/key

and

    POST /repos/:owner/:name/key

Both versions will replace current ssl key for given repo with the new
one.
2012-12-03 02:54:01 +01:00
Piotr Sarnacki
65637c5731 Add endpoint for getting repo public key 2012-11-26 02:26:34 +01:00
Sven Fuchs
353b5fa502 use registered services 2012-11-23 21:16:10 +01:00
Sven Fuchs
5d257b69be fix service hook spec 2012-11-11 02:47:35 +01:00
Sven Fuchs
ab841a0a23 fix tests for cc.xml 2012-11-08 14:47:50 +01:00
Konstantin Haase
f7fdfaa96a enable test 2012-11-08 14:37:32 +01:00
Piotr Sarnacki
1097eaec7e Update travis-core, which fixes PUT /hooks/:id 2012-11-08 03:13:48 +01:00
Sven Fuchs
7695788aae rename EVENTS back after reverting stuff in core 2012-11-05 16:17:47 +01:00
Sven Fuchs
889f042cd7 bump travis-core 2012-11-05 02:45:22 +01:00
Sven Fuchs
28b3099bd0 add specs for build status image urls that filter by multiple branches 2012-10-21 16:21:13 +02:00
Sven Fuchs
1b9bc9b039 fix specs for cors 2012-10-11 14:07:51 +02:00
Piotr Sarnacki
b53286fe52 Fix syncing and add integration test for it 2012-10-11 13:27:44 +02:00
Piotr Sarnacki
02c503ae19 Make sure that PUT /users/:id returns user hash 2012-10-11 01:30:57 +02:00
Piotr Sarnacki
4f33a93769 Fix PUT /users/:id and add integration test for it 2012-10-11 01:00:53 +02:00
Sven Fuchs
8abd6fa150 manual redirects and rewrite rules for supporting v1 style resources 2012-10-10 01:48:22 +02:00
Sven Fuchs
f8bd49e88b on 404 redirect for /owner/name paths on v1 2012-10-10 01:47:12 +02:00
Sven Fuchs
903f249cfb moar refactoring on responders, fix specs 2012-10-09 18:28:46 +02:00
Sven Fuchs
4328ba8649 adapt services changes from travis-core 2012-10-05 13:06:50 +02:00
Sven Fuchs
c9c9dc61d8 add notes about travis-ci routes 2012-10-03 15:05:17 +02:00
Sven Fuchs
44c9b35421 backup routing specs from travis-ci 2012-10-03 14:57:58 +02:00
Sven Fuchs
6bda358786 cleanup and some notes 2012-10-03 13:14:01 +02:00
Sven Fuchs
f6957636fb refactor to responders, add the cc.xml stuff 2012-10-03 02:19:16 +02:00
Sven Fuchs
5a6f34005c comment out result images for now since i cant get this to work 2012-10-02 21:12:41 +02:00
Sven Fuchs
7eceeb2842 moar work on acceptance tests 2012-10-02 19:10:29 +02:00
Sven Fuchs
289f7c1486 start porting api integration tests 2012-10-02 16:39:38 +02:00