Commit Graph

119 Commits

Author SHA1 Message Date
Kamil Trzciński 828d81ee1f Optimise trace handling code to use streaming instead of full read 2017-04-06 16:20:27 +00:00
Yorick Peterse d2283f4f0e
Backport API changes needed to fix sticking in EE
These changes are ported over from
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1502 to reduce
the number of merge conflicts that may occur.
2017-03-31 13:56:53 +02:00
Tomasz Maczukin 2e1b2233ce
Fix regression in runners registration v1 api 2017-03-13 16:35:10 +01:00
Tomasz Maczukin 3eafffcef0
Refactor JobRequest response structure 2017-03-02 17:45:45 +01:00
Robert Schilling 7d60876bc9 Backport new behavior to CI API 2017-02-28 08:32:39 +01:00
Lin Jen-Shin 83418ad846 Merge remote-tracking branch 'upstream/master' into 27762-add-default-artifacts-expiration
* upstream/master: (247 commits)
  Switched CONTRIBUTING.md style guide recommendation for method chaining
  Fix new offenses
  Stylistic tweaks
  Fix OAuth/SAML user blocking behavior
  Revert "Enable Style/DotPosition"
  Revert "Prefer leading style for Style/DotPosition"
  Revert "Enable Style/BarePercentLiterals"
  Manually correct autocorrect
  Move up delegate calls
  Exclude migrations from Style/MutableConstant
  ActiveSupport delegation is preferred over Forwardable
  Update haml_lint to work with newest rubocop
  Add explanations to cops
  Update rubocop and rubocop-rspec and regenerate .rubocop_todo.yml
  Update rubocop and rubocop-rspec and regenerate .rubocop_todo.yml
  Order cops alphabetically
  Don’t exclude some file in lib from rubocop
  Fix new offenses
  Enable Rails/Delegate
  Enable Style/WordArray
  ...
2017-02-24 17:14:35 +08:00
Douwe Maan 7d4b52b27d Enable Style/WordArray 2017-02-23 09:32:41 -06:00
Douwe Maan ccbebbdfeb Enable Performance/RedundantMatch 2017-02-23 09:31:57 -06:00
Douwe Maan b7d8df503c Enable Style/MutableConstant 2017-02-23 09:31:56 -06:00
Rémy Coutable 319dfd68a8 Merge branch 'grapify-ci-runners-api' into 'master'
Grapify the CI::Runners API

See merge request !9440
2017-02-22 15:11:49 +00:00
Robert Schilling 3d013487ce Grapify the CI::Runners API 2017-02-22 14:11:39 +01:00
Robert Schilling b8c88a839d Grapfiy the CI::Triggers API 2017-02-22 10:47:48 +01:00
Lin Jen-Shin a1b06a82ea rubocop: Align the operands of an expression
C: Style/MultilineOperationIndentation:
Align the operands of an expression in an assignment
spanning multiple lines.
2017-02-15 15:31:51 +08:00
Lin Jen-Shin 53c94f9ea2 Use the same syntax for default expiration
Feedback:

* https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9219#note_23343951
* https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9219#note_23344036
* https://gitlab.com/gitlab-org/gitlab-ce/issues/27762#note_23344797
2017-02-15 15:31:51 +08:00
Lin Jen-Shin d2d30cff55 Initial implementation for default artifacts expiration
TODO: Add tests and screenshots
2017-02-15 15:31:51 +08:00
Kamil Trzcinski 31be74c74b
Return struct instead of multiple values 2017-01-25 14:23:47 +01:00
Kamil Trzcinski c46445af92
Fix specs 2017-01-25 10:49:36 +01:00
Kamil Trzcinski 3441b4f93b
Fix picking CI builds
The conflict happens when we try to update a build,
but fail to do so due to fact that we update the same build concurrently for two different runners.
2017-01-25 10:49:35 +01:00
Kamil Trzcinski b368447cf7
Remove unneeded code and fix offenses 2017-01-25 10:47:58 +01:00
Kamil Trzcinski b7f4553e3e
Backport changes introduced by https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1083 2017-01-20 12:25:53 +01:00
Kamil Trzcinski 8171a1932b
Merge remote-tracking branch 'origin/master' into 21698-redis-runner-last-build 2017-01-19 15:31:04 +01:00
Rémy Coutable c28b0a539d Don't instrument 405 Grape calls
Fixes #26051.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-09 10:02:52 +01:00
Lin Jen-Shin 8c9a4ed373 WIP: Add tests and make sure that headers are set
* We realized that headers were not set whenever we give 204
  because `render_api_error!` doesn't preserve the headers.

* We also realized that `update_runner_info` would be called in
  POST /builds/register every time therefore runner is updated
  every time, ticking the queue, making this last_update didn't
  work very well, and the test would be failing due to that.
2017-01-04 17:46:56 +08:00
Rémy Coutable 359718603e Ensure nil User-Agent doesn't break the CI API
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-21 11:46:16 +01:00
Lin Jen-Shin 18c9fc4224 Use a block to insert extra check for authenticate_build!
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8091#note_20253762
2016-12-20 03:24:38 +08:00
Lin Jen-Shin ec003d9eb3 Prefer unless over if not
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/builds/7606797
2016-12-19 19:14:21 +08:00
Lin Jen-Shin 64d7772b6f Use a separate method to skip validation
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8091#note_20222666
2016-12-19 18:43:06 +08:00
Kim "BKC" Carlbäcker 24f0a45b0f Do things in the correct order 2016-12-16 16:32:16 +01:00
Kim "BKC" Carlbäcker 811addf2d1 #NamingThings 2016-12-16 01:04:18 +01:00
Kim "BKC" Carlbäcker e179544342 Move redis-logic into Ci::Runner 2016-12-15 22:30:31 +01:00
Kim "BKC" Carlbäcker 771dd68cdf linting 2016-12-15 22:29:47 +01:00
Lin Jen-Shin e485b3f6ad Give forbidden if project for the build was deleted
Closes #25309
2016-12-15 00:28:55 +08:00
Kim "BKC" Carlbäcker aa224c13fc typo-o 2016-12-14 16:39:40 +01:00
Kim "BKC" Carlbäcker a6ab8a3409 Add BuildQueueWorker for injecting redis-keys 2016-12-14 16:06:50 +01:00
Kim "BKC" Carlbäcker afea2df151 First attempt 2016-12-14 14:35:43 +01:00
Tomasz Maczukin e3fb074022
Send credentials array with build data 2016-11-21 15:01:06 +01:00
Tomasz Maczukin 596bbf670c
Send registry_url with build data to GitLab Runner 2016-11-16 13:31:02 +01:00
Grzegorz Bizon 9a8e486307 Extract method that checks if ci runner needs update 2016-10-03 12:07:47 +02:00
Kamil Trzcinski 08e31875c2 Update runner version only when updating contacted_at 2016-10-03 12:07:47 +02:00
Kamil Trzcinski 967eb8fb55 Merge branch 'master' into per-build-token 2016-09-19 13:31:42 +02:00
Kamil Trzcinski 2cc9a785df Properly create deployment using all possible options 2016-09-19 10:07:12 +02:00
Kamil Trzcinski 548169cfb5 Fix most of specs 2016-09-15 15:40:53 +02:00
Kamil Trzcinski 50076ab974 Merge remote-tracking branch 'origin/master' into per-build-token
# Conflicts:
#	db/schema.rb
2016-09-15 13:19:53 +02:00
Tomasz Maczukin 940f900f1c
Change response for /ci/api/v1/builds/register.json from 404 to 204 2016-09-13 17:44:18 +02:00
Kamil Trzcinski 505dc808b3 Use a permissions of user to access all dependent projects from CI jobs (this also includes a container images, and in future LFS files) 2016-09-13 13:30:26 +02:00
Jacob Vosmaer (GitLab) b7e6da5a4b Merge branch 'gitlab-workhorse-safeties' into 'master'
Security and safety improvements for gitlab-workhorse integration

Companion to https://gitlab.com/gitlab-org/gitlab-workhorse/merge_requests/60

- Use a custom content type when sending data to gitlab-workhorse
- Verify (using JWT and a shared secret on disk) that internal API requests came from gitlab-workhorse

This will allow us to build features in gitlab-workhorse that require
more trust, and protect us against programming mistakes in the future.

This is designed so that no action is required for installations from
source. For omnibus-gitlab we need to add code that manages the shared
secret.

See merge request !5907
2016-09-09 11:33:08 +00:00
Kamil Trzcinski 6a29ac7d1d Change update interval of runners when trying to preserve contacted_at 2016-09-07 13:58:55 +02:00
Jacob Vosmaer c87540ed46 Verify JWT messages from gitlab-workhorse 2016-09-05 15:05:31 +02:00
Stan Hu 170885edd6 Add Sentry logging to API calls
Closes #21043
2016-08-24 12:09:51 -07:00
Yorick Peterse d345591fc8
Tracking of custom events
GitLab Performance Monitoring is now able to track custom events not
directly related to application performance. These events include the
number of tags pushed, repositories created, builds registered, etc.

The use of these events is to get a better overview of how a GitLab
instance is used and how that may affect performance. For example, a
large number of Git pushes may have a negative impact on the underlying
storage engine.

Events are stored in the "events" measurement and are not prefixed with
"rails_" or "sidekiq_", this makes it easier to query events with the
same name triggered from different parts of the application. All events
being stored in the same measurement also makes it easier to downsample
data.

Currently the following events are tracked:

* Creating repositories
* Removing repositories
* Changing the default branch of a repository
* Pushing a new tag
* Removing an existing tag
* Pushing a commit (along with the branch being pushed to)
* Pushing a new branch
* Removing an existing branch
* Importing a repository (along with the URL we're importing)
* Forking a repository (along with the source/target path)
* CI builds registered (and when no build could be found)
* CI builds being updated
* Rails and Sidekiq exceptions

Fixes gitlab-org/gitlab-ce#13720
2016-08-17 10:04:04 +02:00