summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Clean environment variables when running git hooksfix_custom_hook_envsValery Sizov2016-09-151-5/+7
|
* Merge branch 'houqp-master' into 'master' Robert Speicher2016-09-141-0/+1
|\ | | | | | | | | | | | | Fix wiki headeline linking Fixes #21817 See merge request !6300
| * Fix URLs with anchors in wikiQingping Hou2016-09-131-0/+1
| |
* | Merge branch 'fix/gitlab-popen-thread-safety' into 'master' Stan Hu2016-09-141-6/+6
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix Gitlab::Popen.popen thread-safety issue ## What does this MR do? It changes the instance variables of `Gitlab::Popen.popen` to a local ones. ## Are there points in the code the reviewer needs to double check? N/A ## Why was this MR needed? It fixes a bug! ## 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 [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [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) ## What are the relevant issue numbers? #21842 See merge request !6194
| * | Fix Gitlab::Popen.popen thread-safety issuefix/gitlab-popen-thread-safetyAhmad Sherif2016-09-131-6/+6
| | | | | | | | | | | | Fixes #21842
* | | Merge branch 'workhorse-secret-trailing-newline' into 'master' Stan Hu2016-09-131-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Allow trailing newline in secret base64 data Fixes https://gitlab.com/gitlab-org/omnibus-gitlab/issues/1575 See merge request !6327
| * | | Allow trailing newline in secret base64 dataJacob Vosmaer2016-09-131-1/+1
| | |/ | |/|
* | | Merge branch 'rc-use-haml_lint' into 'master' Robert Speicher2016-09-131-0/+5
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use `haml_lint` for views linting ## What does this MR do? Add HAML-linting to the GitLab codebase. ## What are the relevant issue numbers? Closes #19984. See merge request !6307
| * | Improve .haml-lint.yml, simplify the haml_lint task and remove CHANGELOG entryrc-use-haml_lintRémy Coutable2016-09-131-4/+1
| | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
| * | Add haml_lint rake taskRémy Coutable2016-09-131-0/+8
| | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | Merge branch 'feature/builds-register-change-404-to-204' into 'master' Rémy Coutable2016-09-133-1/+13
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change response for /ci/api/v1/builds/register.json from 404 to 204 ## What does this MR do? To check if there are new builds scheduled for a runner, runner is sending `POST /ci/api/v1/builds/register.json` requests. If there is a build then a `200` response with build data is returned. However if there is no builds scheduled for this runner it receives a `404 Not Found` response. This may end with a lot of `404 Not Found` lines in logs that are an expected behavior (please read #14445 for a reference). Since `v1.0.1` version GitLab Runner is ready to receive a `204 No Content` response in case of no builds. This MR adds a support for this status code for each Runner's version that can be determined while handling `POST /ci/api/v1/builds/register.json` request. ## Are there points in the code the reviewer needs to double check? Specs in `spec/requests/ci/api/builds_spec.rb` ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] ~~API support added~~ - Tests - [x] Added for this feature/bug - [x] All builds are passing - [ ] ~~Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)~~ - [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) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Fixes #14445 See merge request !6225
| * | Change response for /ci/api/v1/builds/register.json from 404 to 204Tomasz Maczukin2016-09-133-1/+13
| | |
* | | Merge branch 'patch-4' into 'master' Robert Speicher2016-09-131-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update gitlab shell secret file also when it is empty Use `File.size?` instead of `File.exist?` so that secret token is generated when the file is empty. See merge request !3774
| * | | update gitlab shell secret file also when it is emptyElan Ruusamäe2016-09-131-1/+1
| | |/ | |/|
* | | Merge branch '20780-import-github-release-notes' into 'master' Robert Speicher2016-09-132-0/+36
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | Import GitHub release notes ## Why was this MR needed? Release notes aren't currently migrated over when importing from GitHub ## What are the relevant issue numbers? #20780 See merge request !5981
| * | Import GitHub release notesAndrew Smith2016-09-132-0/+36
| |/ | | | | | | | | # Conflicts: # lib/gitlab/github_import/importer.rb
* | Avoid protected branches checks when verifying access without branch namePaco Guzman2016-09-131-0/+1
| | | | | | | | | | | | GitlabShell verify access sending ‘_any’ as the changes made on the git command, in those cases Gitlab::Checks::ChangeAccess won’t receive a branch_name so we don’t need to check for access to the protected branches on that repository. So we avoid some git operations in case the are not cached (empty_repo?) and some database lookups to get protected branches. These request is happening in every push.
* | Merge branch 'fix-commit-status' into 'master' Rémy Coutable2016-09-131-26/+28
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | Fix an error where we were unable to create a CommitStatus for running state Due to severe refactoring of Pipeline we introduced regression in how CommitStatus is handled. We received an report that it's impossible to create a CommitStatus with state `running` when there were not previous status. The support for Commit Statuses should be simplified. Right now I'm doing minimal change to move forward and fix a bug, but I'll create a new MR that will move all logic that is now part of `lib/api/commit_statuses.rb` to separate service to simplify the implementation. This error happens due to the fact that we introduced additional status of builds: `created`. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/21345 See merge request !6107
| * Fix an error where we were unable to create a CommitStatus for running statefix-commit-statusKamil Trzcinski2016-09-121-26/+28
| |
* | Merge branch '21569-dont-add-created-by-for-matched-users' into 'master' Robert Speicher2016-09-124-6/+23
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | Only add original author tag line when importing from GitHub if there isn't a linked GitLab account ## What does this MR do? If there we've found a linked GitLab user for a creator of an issue or comment don't add the 'Created By:' line. ## What are the relevant issue numbers? Closes #21569 See merge request !6081
| * Only add the original author if there isn't a linked GitLab accountAndrew Smith2016-09-084-6/+23
| |
* | Merge branch 'rc-api-use-search-globalservice-in-projects-search-api' into ↵Rémy Coutable2016-09-121-12/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | 'master' API: Use Search::GlobalService in projects search API See merge request !6280
| * | Use Search::GlobalService.new in the `GET /projects/search/:query` endpointrc-api-use-search-globalservice-in-projects-search-apiRémy Coutable2016-09-121-12/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also streamline the sorting part while we're at it. That being done, there's currently a duplication between `GET /projects/search/:query` and `GET /projects?search=:search` so we might want to keep only the latter for 9.0... Signed-off-by: Rémy Coutable <remy@rymai.me>
| * | Search should compare only the lowercase versions of the project namesRazzeee2016-09-091-1/+1
| | |
* | | Merge branch 'fix-api-sorting' into 'master' Douwe Maan2016-09-121-3/+9
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix API issues sorting ## What does this MR do? Fix the sorting of issues in the API. ## Are there points in the code the reviewer needs to double check? Instead of removing the '_at' suffix manually, we could add those versions to the `Sortable` concern instead. ## Why was this MR needed? There were a couple of bugs: * The global and project-specific issues endpoints wouldn't sort at all. * Group sorting would work, but only if you applied two undocumented workarounds: * Always pass both `order_by` and `sort` (both are optional, so only one should be needed to change ordering). * Instead of passing `created_at` or `updated_at`, you needed to pass `created` or `updated`. This makes the API implementation match the docs. ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] API support added - Tests - [x] Added for this feature/bug - [ ] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [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) ## What are the relevant issue numbers? Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/983. See merge request !6281
| * | | Fix API issues sortingfix-api-sortingSean McGivern2016-09-091-3/+9
| |/ /
* | | Merge branch '19359-api-for-notification-settings' into 'master' Rémy Coutable2016-09-123-1/+114
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add notification_settings API calls ## What does this MR do? It adds API calls to get/update notification settings, globally and at the group/project level. ## Are there points in the code the reviewer needs to double check? None ## Why was this MR needed? Notification settings were updated, but related API calls were never created. ## What are the relevant issue numbers? gitlab-org/gitlab-ce#19359 ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [x] API support added - Tests - [x] 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) Closes #19359 See merge request !5632
| * | | Add notification_settings API callsMarc Siegfriedt2016-09-093-1/+114
| | | | | | | | | | | | | | | | Use NotificationSetting::EMAIL_EVENTS for params
* | | | Merge branch 'restrict_ldap_return_attributes' into 'master' Robert Speicher2016-09-091-25/+33
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restrict ldap return attributes ## What does this MR do? Fixes the CE part of #13821. We really only ever need uid, dn, cn, and mail attributes, and in some cases, even less. This merge request strips the request down to those four attributes by default, and allows the caller to specify others, if needed. ## Why was this MR needed? This will improve performance especially in cases where the connection is slow between GitLab and LDAP, or when the LDAP object has lots of attributes we don't care about. See merge request !6187
| * | | Request only the LDAP attributes we needDrew Blessing2016-09-091-25/+33
| | | |
* | | | Avoid conflict with admin labels when importing GitHub labelsDouglas Barbosa Alexandre2016-09-092-2/+7
| |/ / |/| |
* | | Merge branch 'gitlab-workhorse-safeties' into 'master' Jacob Vosmaer (GitLab)2016-09-092-3/+53
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Verify JWT messages from gitlab-workhorseJacob Vosmaer2016-09-052-3/+53
| | |
* | | Merge branch 'smart-pipeline-duration' into 'master' Rémy Coutable2016-09-081-0/+141
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Smartly calculate real running time and pending time ## What does this MR do? Try to smartly calculate the running time and pending time for pipelines, instead of just use wall clock time from start to end. The algorithm is based on: > Suppose we have A, B, and C jobs: > * A: from 1 to 3 > * B: from 2 to 4 > * C: from 6 to 7 > The processing time should be accumulated from 1 to 4, and 6 to 7, totally 4, excluding retires, and calculate on `%w[success failed running canceled]` jobs (if a job is not finished yet, assume it's `Time.now`) ## Are there points in the code the reviewer needs to double check? I would actually like to test `Gitlab::Ci::PipelineDuration#process_segments`, but it's a private method right now and it's not very convenient to test it. Is there a way to test it without changing the original code too much? Note that I would like to avoid saving merged segments because it's not used and should be garbage collected. ## Screenshots: ![Screen_Shot_2016-09-05_at_6.45.32_PM](/uploads/a82bfaf316661091e383b743a2f11334/Screen_Shot_2016-09-05_at_6.45.32_PM.png) ## 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) - Tests - [x] Added for this feature/bug ## What are the relevant issue numbers? Closes #18260, #19804 See merge request !6084
| * | | Struct.new could take a block for defining methods, feedback:smart-pipeline-durationLin Jen-Shin2016-09-081-2/+1
| | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_15091858
| * | | Split try_merge_period into overlap? and merge:Lin Jen-Shin2016-09-081-7/+9
| | | | | | | | | | | | | | | | | | | | Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_15083507
| * | | Be more specific since it's not needed to be generic now,Lin Jen-Shin2016-09-061-3/+5
| | | | | | | | | | | | | | | | | | | | feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14995016
| * | | Sort by database, feedback:Lin Jen-Shin2016-09-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14991226 and https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14994233
| * | | Just use module because there's nothing to save, feedback:Lin Jen-Shin2016-09-061-14/+10
| | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14992064
| * | | Use sum, feedback:Lin Jen-Shin2016-09-061-3/+1
| | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14991392
| * | | Forget about pending duration for now, need more discussionLin Jen-Shin2016-09-051-39/+10
| | | |
| * | | Just sum all the queuing time, indication for needing more runnersLin Jen-Shin2016-09-021-6/+7
| | | |
| * | | Actually we still need to use total - running to get:Lin Jen-Shin2016-09-021-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | real pending time, because that's actually by definition, (the time that it's not running!) or we could end up with awfully complicated algorithm :(
| * | | Merge remote-tracking branch 'upstream/master' into smart-pipeline-durationLin Jen-Shin2016-09-0228-124/+229
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * upstream/master: (289 commits) Fix a typo Change minimum Unicorns required to two Update memory requirements Change the inline code to codeblocks for the new features doc guideline Update CHANGELOG with 8.11.4 entries. removed null return - renamed 'placeTop' to 'placeProfileAvatarsToTop' Change widths of content in MR pipeline tab Add curve to generic commit status pipeline Rubocop syntax 2.3 Some minor updates for upgrade guides for 8.12. Remove inconsistent font weight for sidebar's labels Replace play icon font with svg Project tools visibility level Added todo filter tests Fixed project filtering Review changes, simplified dropdown init Removed select2 from todos feature spec Removed inline JS and improved dropdown labels Added type and action dropdowns, need to finalize by removing all inline and polishing off the selected dropdown states Completed project filter dropdown, still need to move it from inline to ProjectSelect.js (or different) ...
| * | | | Calculate real queueing time to exclude gaps from:Lin Jen-Shin2016-09-021-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | retries and probably also manual actions! Feedback: * https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14735478 * https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14737804
| * | | | Use guard clause, feedback:Lin Jen-Shin2016-08-311-11/+9
| | | | | | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14754681
| * | | | Introduction to PipelineDurationLin Jen-Shin2016-08-311-0/+98
| | | | |
| * | | | Fix renamingLin Jen-Shin2016-08-301-1/+1
| | | | |
| * | | | Avoid shadowing method name. Just use existing methodLin Jen-Shin2016-08-301-2/+2
| | | | |
| * | | | Rename to periods since it's easier to understandLin Jen-Shin2016-08-301-22/+22
| | | | |