Commit Graph

270 Commits

Author SHA1 Message Date
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 c701468390 Improve naming convention in ci configuration module 2016-11-14 10:31:45 +01:00
Kamil Trzcinski ad85928752 Add logical validation to gitlab-ci.yml 2016-10-18 12:22:51 +02: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
Katarzyna Kobierska 7dfb204ef9 Expose jobs to view 2016-09-30 12:22:55 +02:00
Katarzyna Kobierska 375072aa27 Add missing values to linter 2016-09-30 12:22:55 +02:00
Robert Speicher eb4d3eef90 Remove duplicate VersionInfo class
This was brought over during the CI merge and already exists at
`lib/gitlab/version_info.rb`.
2016-09-29 10:48:24 +02:00
Kamil Trzcinski cf6a35f09a Improve JwtController implementation 2016-09-20 19:15:13 +02:00
Kamil Trzcinski 0672c5a92e Post-merge improve of CI permissions 2016-09-20 15:41:41 +02:00
Kamil Trzcinski 967eb8fb55 Merge branch 'master' into per-build-token 2016-09-19 13:31:42 +02:00
Kamil Trzcinski b51ededc5f Don't leak build tokens in build logs 2016-09-19 12:38:10 +02:00
Grzegorz Bizon 2ad7753d34 Fix CI job environment configuration attributes 2016-09-19 10:07:14 +02:00
Kamil Trzcinski 2cc9a785df Properly create deployment using all possible options 2016-09-19 10:07:12 +02:00
Grzegorz Bizon ba5bd3d1d6 Add new CI configuration entry for the environment 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
Yorick Peterse 575a97470e Merge branch 'change-update-interval-of-runners' into 'master'
Change update interval of runners when trying to preserve contacted_at

See merge request !6126
2016-09-08 10:08:50 +00:00
Rémy Coutable 4ce348c7f9 Merge branch 'refactor/ci-config-add-logical-validation' into 'master'
Pass dependencies to CI configuration nodes

## What does this MR do?

This MR makes it possible to pass dependencies to CI configuration nodes.

## What are the relevant issue numbers?

See #15060

## Does this MR meet the acceptance criteria?

- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing

See merge request !6009
2016-09-07 16:14:37 +00:00
Kamil Trzcinski 6a29ac7d1d Change update interval of runners when trying to preserve contacted_at 2016-09-07 13:58:55 +02:00
Katarzyna Kobierska 0d81fd05b9 Code refactor 2016-09-07 12:10:49 +02:00
Katarzyna Kobierska 1a7a900d8e Improve code 2016-09-07 12:10:49 +02:00
Katarzyna Kobierska 2c8b830fdb Code refactoring 2016-09-07 12:10:49 +02:00
Katarzyna Kobierska cc06eab237 Change class method name 2016-09-07 12:10:49 +02:00
Katarzyna Kobierska 9e313c1294 Add class method to encapsulate exception 2016-09-07 12:10:49 +02:00
Katarzyna Kobierska ca1f5ede84 Move lint to api from ci/api 2016-09-07 12:10:49 +02:00
Katarzyna Kobierska 257c2acde7 Add params requires to lint 2016-09-07 12:10:49 +02:00
Katarzyna Kobierska 0e4c0e7818 Fix rubocop tests 2016-09-07 12:10:49 +02:00
Katarzyna Kobierska 895ca3a741 Add tests for API CI Lint 2016-09-07 12:10:49 +02:00
Katarzyna Kobierska fb1c7254d5 API for CI Lint 2016-09-07 12:10:49 +02:00
Jacob Vosmaer c87540ed46 Verify JWT messages from gitlab-workhorse 2016-09-05 15:05:31 +02:00
Grzegorz Bizon 1255205d89 Add method that returns commands for ci job entry 2016-08-29 13:11:35 +02:00
Grzegorz Bizon bd807503d1 Do not override job nodes in legacy ci config code 2016-08-29 13:10:57 +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
Kamil Trzcinski 39203f1adf Pre-create all builds for Pipeline when a trigger is received
This change simplifies a Pipeline processing by introducing a special new status: created.
This status is used for all builds that are created for a pipeline.
We are then processing next stages and queueing some of the builds (created -> pending) or skipping them (created -> skipped).
This makes it possible to simplify and solve a few ordering problems with how previously builds were scheduled.
This also allows us to visualise a full pipeline (with created builds).

This also removes an after_touch used for updating a pipeline state parameters.
Right now in various places we explicitly call a reload_status! on pipeline to force it to be updated and saved.
2016-08-11 15:22:35 +02:00
Grzegorz Bizon 74d12b6b47 Remove legacy Ci::StaticModel we do not use anymore 2016-08-08 14:22:26 +02:00
Douwe Maan 7e04ee9af8 Merge branch 'fix/use-fewer-queries-for-ci-charts' into 'master'
Use fewer queries for CI charts

## What does this MR do?
It reduces number of queries sent for aggregating counts for CI graphs.

## Are there points in the code the reviewer needs to double check?
N/A

## Why was this MR needed?
For this project (gitlab-ce), loading `/graphs/master/ci` is so slow it times out eventually. I did a quick benchmarking on production and found that it can take 72.5 seconds to only load the controller action variables (there are queries done from the view, didn't look into those). This MR reduces the time to about 2.5 seconds.

Extra improvement could be done by introducing an index on `gl_project_id` and `created_at` for `ci_builds` table, but I can't confirm that right  now.

## What are the relevant issue numbers?
#20262 

## Screenshots (if relevant)
N/A

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- ~~[ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- ~~[ ] API support added~~
- ~~Tests~~
  - ~~[ ] Added for this feature/bug~~
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5502
2016-08-01 19:57:27 +00:00
Ahmad Sherif 274769978c Use fewer queries for CI charts 2016-07-27 14:19:15 +02:00
Grzegorz Bizon dff10976da Move job dependencies entry to the new CI config 2016-07-20 14:15:18 +02:00
Grzegorz Bizon f83bccfe4f Add minor readability, style improvements in CI config 2016-07-20 14:02:09 +02:00
Grzegorz Bizon 795c9f2241 Merge branch 'master' into refactor/ci-config-move-job-entries
* master: (321 commits)
  Fix the Sentry spam from CSP violations by disabling it.
  Limit git rev-list output count to one in forced push check
  Ensure Owners are included in the scope for authorized_projects
  Fix alignment of icons on project page
  Fix ci_status_helper_spec to look for new SVGs
  use 2.0.5, actually (2.0.4 was a bad release)
  upgrade rouge to 2.0.4
  Fix help page paths to make sure shortcuts and the UI help page work.
  fixes an issue cause by a bad merge
  Vertically align status icon within table
  Add new icons for every CI status
  Add global style for running icon
  Align running icon in merge request
  Add new running icon; add a bunch of styles to get svg to match existing fa icons
  Improve code design
  Fix broken builds_for_ref
  Move when tests before to make it no conflict with manual-actions
  Use value of `yaml_variables` and `when` from config_processor if undefined
  Add CHANGELOG entry
  CHANGELOG item
  ...

Conflicts:
	lib/ci/gitlab_ci_yaml_processor.rb
	spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
2016-07-20 10:44:01 +02:00
Kamil Trzcinski 6b07a5b26c Improve code design 2016-07-19 14:58:17 +02:00
Kamil Trzcinski 276d28a60f Fix broken builds_for_ref 2016-07-19 14:54:18 +02:00
Kamil Trzcinski 41fa516bb6 Use value of `yaml_variables` and `when` from config_processor if undefined 2016-07-19 14:53:35 +02:00
Grzegorz Bizon bb8bf6427d Move job environment validation to new CI config 2016-07-19 13:08:28 +02:00