Commit Graph

1274 Commits

Author SHA1 Message Date
Sean McGivern 11e93ad59d Merge branch 'feature/issues-board' into 'master'
Refactoring Issues Board

## What does this MR do?

This MR aims to minimize conflicts between the CE issues board feature with EE multiple boards feature.

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

## Why was this MR needed?

To avoid a lot of conflicts with EE multiple boards feature.

## Screenshots (if relevant)

## Does this MR meet the acceptance criteria?

- [ ] ~~[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)~~
- [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)
- [ ] 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?

https://gitlab.com/gitlab-org/gitlab-ee/issues/929

https://gitlab.com/gitlab-org/gitlab-ee/issues/1084

See merge request !6727
2016-10-13 14:21:14 +00:00
tiagonbotelho c90483406e refactors tests because of gitlab-test repository changes 2016-10-11 16:33:06 +01:00
Douglas Barbosa Alexandre 81c253ded1 Add Project#boards to import/export configuration file 2016-10-11 11:39:05 -03:00
Lin Jen-Shin 94611607e5 Merge remote-tracking branch 'upstream/master' into pipeline-emails
* upstream/master: (292 commits)
  Deletes extra empty line breaking the build
  Optimize the `award_user_list` helper spec
  Fix typo and add he MWBS accronym for "Merge When Build Succeeds"
  Added missing content and improved layout
  ExpireBuildArtifactsWorker query builds table without ordering enqueuing one job per build to cleanup
  Improve the contribution and MR review guide
  Updates test in order to look for link
  Make projects API docs match parameter style
  Fix Event#reset_project_activity updates
  Update user whitelist reject message
  Call ensure_secret_token! in secret token test's before block since it would be called in an initializer.
  Add a CHANGELOG for CacheMarkdownField
  Enable CacheMarkdownField for the remaining models
  Make search results use the markdown cache columns, treating them consistently
  Use CacheMarkdownField for notes
  Add markdown cache columns to the database, but don't use them yet
  Update issue board spec
  Link to Registry docs from project settings
  Truncate long labels with ellipsis in labels page
  Improve issue load time performance by avoiding ORDER BY in find_by call
  ...
2016-10-08 07:51:07 +00:00
Rémy Coutable 0876b46024 Merge branch 'memoize_shell_secret_token' into 'master'
Memoize Github::Shell's secret token

## What does this MR do?

`API::Helpers#secret_token` was reading the secret file on every invocation. This MR reads the file in the `gitlab_shell_secret_token.rb` initializer and saves it as a class variable at `Gitlab::Shell.secret_token`

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

 - I'm not sure if the use of `cattr_accessor` is the best approach, or if should be moved into the `class << self` block?
 - Should `API::Helpers#secret_token` be removed in favor of using `Gitlab::Shell.secret_token`?

## Why was this MR needed?

Performance optimization.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/22510

See merge request !6599
2016-10-07 10:35:03 +00:00
Justin DiPierro 1c462cf7d6 Call ensure_secret_token! in secret token test's before block since it would be called in an initializer. 2016-10-06 22:40:04 -04:00
Nick Thomas e94cd6fdfe Add markdown cache columns to the database, but don't use them yet
This commit adds a number of _html columns and, with the exception of Note,
starts updating them whenever the content of their partner fields changes.

Note has a collision with the note_html attr_accessor; that will be fixed later

A background worker for clearing these cache columns is also introduced - use
`rake cache:clear` to set it off. You can clear the database or Redis caches
separately by running `rake cache:clear:db` or `rake cache:clear:redis`,
respectively.
2016-10-07 02:54:25 +01:00
Justin DiPierro fe46e4eb35 Load Github::Shell's secret token from file on initialization instead of every request. 2016-10-06 11:22:37 -04:00
Paco Guzman 640a4c8834 Use higher size on Gitlab::Redis connection pool on Sidekiq servers 2016-10-06 10:50:03 +02:00
Kamil Trzciński 0bbeff3d5e Merge branch 'feature/improve-async-pipeline-processing' into 'master'
Improve asynchronous pipeline processing

## What does this MR do?

This MR improves asynchronous processing of pipeline.

## Why was this MR needed?

It eliminates some race conditions and improves performance.

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing

## What are the relevant issue / merge request numbers?

Related merge request:  !6410  
Extracted from !6411

See merge request !6650
2016-10-06 08:42:35 +00:00
Rémy Coutable 67aabcc764 Merge remote-tracking branch 'dev/master' 2016-10-06 08:34:39 +02:00
Rémy Coutable c9396bc7c5 Merge branch 'test-improve-gitlab-identifier' into 'master'
Refactor Gitlab::Identifier

## What does this MR do?

This refactors `Gitlab::Identifier` so that it:

1. Has tests
2. Caches output in an instance variable to reduce queries
3. Uses only a single query to find a user by an SSH key, instead of 2

## Why was this MR needed?

This code was untested and would execute more SQL queries than needed.

See merge request !6680
2016-10-05 11:38:58 +00:00
Yorick Peterse 16ed9b6129
Refactor Gitlab::Identifier
This refactors Gitlab::Identifier so it uses fewer queries and is
actually tested. Queries are reduced by caching the output as well as
using 1 query (instead of 2) to find a user using an SSH key.
2016-10-05 12:40:17 +02:00
Douglas Barbosa Alexandre b5f9541778 Skip wiki creation when GitHub project has wiki enabled
If the GitHub project repository has wiki, we should not create
the default wiki. Otherwise the GitHub importer will fail because
the wiki repository already exist.

This bug was introduced here
https://gitlab.com/gitlab-org/gitlab-ce/commit/892dea67717c0efbd6a28f763
9f34535ec0a8747
2016-10-04 13:06:45 -03:00
Grzegorz Bizon ebeee31100 Fix pipeline fixtures and calls to removed method 2016-10-04 14:43:24 +02:00
Lin Jen-Shin 0cc3fc5627 Add pipeline_email_service. Fixes:
https://gitlab.com/gitlab-org/gitlab-ce/builds/4710913
2016-10-04 04:16:14 +08:00
Lin Jen-Shin f39ba1bb5e Merge remote-tracking branch 'upstream/master' into pipeline-emails
* upstream/master: (372 commits)
  Enable Lint/StringConversionInInterpolation cop and autocorrect offenses
  resolve duplicated changelog entry
  credit myself 😄
  change determine conditions
  override subject method in devise mailer
  follow the styleguide: Don't use parentheses around a literal
  wrap subject with method subject
  move spec back into shared example `an email sent from GitLab`
  stub config settings in spec
  remove empty line at block body end
  remove extra entry
  create new test in `spec/mailers/notify_spec.rb`
  move changelog to 8.13
  add configurable email subject suffix
  Fixes sidebar navigation.
  Convert "SSH Keys" Spinach features to RSpec
  Enable import/export back for non-admins
  Update gitlab-shell to 3.6.3
  Updated artwork of empty group state.
  Better empty state for Groups view.
  ...
2016-10-04 02:38:25 +08:00
Robert Speicher 4a191c83d1 Enable Lint/StringConversionInInterpolation cop and autocorrect offenses 2016-10-03 16:09:57 +02:00
Robert Speicher e64594ac44 Merge branch '21983-member-add_user-doesn-t-detect-existing-members-that-have-requested-access' into 'master'
Resolve "`Member.add_user`doesn't detect existing members that have requested access"

## What does this MR do?

This merge request handle the case when an access requester is added to a group or project (via the members page or the API).

In `Member.add_user`, if an access requester already exists, we simply accept their request (and set the `created_by`, `access_level` and `expires_at` attributes if given).

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

I've taken the opportunity to cleanup the whole `{Group,Project}Member.add_user*` methods since it was quite a mess.

## What are the relevant issue numbers?

Closes #21983

See merge request !6393
2016-10-02 11:42:57 +00:00
Douwe Maan 8a866bfce3 Merge branch 'fix/id-claim-import-issue' into 'master'
Prevent claiming associated model IDs via import

On the import side, we should be careful not to use any IDs as part of the JSON file that could have been manipulated.

Part of https://gitlab.com/gitlab-org/gitlab-ce/issues/20821


Things we already do (__before__ this fix):

1. Remove all primary keys
1. **Always** reassign some of the foreign keys, such as ALL project IDs and user IDs (so it would be difficult to impersonate or try to gain access to another project)
1. Ignore/reject attributes that do not exist in the model
1. If someone reassigns a foreign key `submodel_id`, and that object has another json as the submodel, the new submodel will reassign the `submodel_id` to the newly created submodel ID.

Things we should do:

1. Remove/nullify any other foreign keys that we don't reassign (checked this, and there aren't many, fortunately. In fact, I don't think much harm can be done at all - at the moment).

See merge request !1985
2016-09-30 07:31:02 +00:00
Douwe Maan 029c0d79af Merge branch 'lfs-ssh-authorization-fix' into 'master'
Do not regenerate the `lfs_token` every time `git-lfs-authenticate` is called

## What does this MR do?

 Do not regenerate the `lfs_token` every time `git-lfs-authenticate` is called, instead return the saved token if one is present.

This was causing a lot of 401s, leading to 403s, as state in #22527

As it turns out, when pushing a lot of LFS objects, the LFS client was calling `git-lfs-authenticate` in the middle of the request again. This caused the `lfs_token` to be regenerated. The problem lies in that the LFS client was not aware of this change, and was still using the old token. This caused all subsequent requests to fail with a 401 error.

Since HTTP Auth is protected by Rack Attack, this 401s where immediately flagged and resulted in the IP of the user being banned. 

With this change, GitLab returns the value stored in Redis, if one is present, thus if the LFS client calls `git-lfs-authenticate` again during the request, the auth header will remain unchanged, allowing all subsequent requests to continue without issues.

## What are the relevant issue numbers?

Fixes #22527

cc @SeanPackham @jacobvosmaer-gitlab

See merge request !6551
2016-09-28 18:13:34 +00:00
Patricio Cano 2772109ac1 Handle LFS token creation and retrieval in the same method, and in the same Redis connection.
Reset expiry time of token, if token is retrieved again before it expires.
2016-09-28 12:13:48 -05:00
Rémy Coutable ec0061a95c Allow Member.add_user to handle access requesters
Changes include:

- Ensure Member.add_user is not called directly when not necessary
- New GroupMember.add_users_to_group to have the same abstraction level as for Project
- Refactor Member.add_user to take a source instead of an array of members
- Fix Rubocop offenses
- Always use Project#add_user instead of project.team.add_user
- Factorize users addition as members in Member.add_users_to_source
- Make access_level a keyword argument in GroupMember.add_users_to_group and ProjectMember.add_users_to_projects
- Destroy any requester before adding them as a member
- Improve the way we handle access requesters in Member.add_user
  Instead of removing the requester and creating a new member,
  we now simply accepts their access request. This way, they will
  receive a "access request granted" email.
- Fix error that was previously silently ignored
- Stop raising when access level is invalid in Member, let Rails validation do their work

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-28 09:43:00 +02:00
Markus Koller 68364fe2f0
Log LDAP lookup errors and don't swallow unrelated exceptions
Signed-off-by: Roger Meier <r.meier@siemens.com>
2016-09-28 07:44:58 +02:00
Ahmad Sherif e30bfb809a Import all GitHub comments after importing issues and PRs 2016-09-27 20:45:07 +02:00
Ahmad Sherif dbcbbf262b Speed up label-applying process for GitHub importing
* No need to re-fetch issues from GH to read their labels, the labels
  are already there from the index request.
* No need to look up labels on the database for every application, so we
  cache them.
2016-09-27 20:45:07 +02:00
Ahmad Sherif 395a9301b2 Process each page of GitHub resources instead of concating them then processing
This should avoid having large memory growth when importing GitHub repos
with lots of resources.
2016-09-27 20:45:07 +02:00
James Lopez 4c480be39b Prevent claiming associated model IDs via import and added relevant specs 2016-09-27 15:48:10 +02:00
James Lopez fc548207d5 fix model order in import/export config and 1to1 relation issue. Added relevant specs. 2016-09-27 14:56:33 +02:00
James Lopez a5b9e1c260 added more specs 2016-09-26 09:49:05 +02:00
James Lopez a9f1e972ec Fixes issue with rails reserved keyword type exporting/importing services. Also fixed CustomIssueTrackerService title setter and added relevant specs. 2016-09-26 09:49:05 +02:00
Robert Speicher 0a9f9c10e4 Merge branch '22229-use-base-sha-when-downloading-merge-requests' into 'master'
Use base SHA for patches and diffs

## What does this MR do?

Switch from using 'start SHA' to 'base SHA' for patches and diffs

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

## Why was this MR needed?

Makes the downloaded patches and diffs on the merge request page match the frontend-rendered "changes" in these scenarios:

* Unpatched gitlab-workhorse, downloading patchsets of open MRs (https://gitlab.com/gitlab-org/gitlab-workhorse/merge_requests/68)
* Unpatched gitlab-workhorse, downloading diffs of open and merged MRs
* Patched gitlab-workhorse, downloading patchsets of merged merge requests

## What are the relevant issue numbers?

Closes #22229

See merge request !6435
2016-09-25 10:30:37 +00:00
Nick Thomas a8829f25d3 Use base SHA for patches and diffs
This commit changes the revisions used for diffs. The current behaviour is
to show all changes between current tip of master and tip of the MR, rather
than matching the output of the web frontend (which just shows the changes
in the MR). Switching from start_sha to base_sha fixes this.
2016-09-22 18:49:31 +01:00
Jacob Vosmaer b228b86b3e Make Gitlab::Redis.params safe for mutation 2016-09-22 15:58:40 +02:00
James Lopez ad62a25e0f fix import/export security specs after merge 2016-09-21 15:47:11 -05:00
James Lopez ce48a595b0 fixing security specs after merge 2016-09-21 14:36:28 +02:00
Rémy Coutable a25ac8a89b Merge branch 'add_spec_for_committer_hash' into 'master'
Add spec covering 'committer_hash'

Adds a missing spec from changes added in !5822

See merge request !6433
2016-09-21 10:15:00 +00:00
Dmitriy Zaporozhets c2a7e7b8ac Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2016-09-21 12:22:02 +03:00
Lin Jen-Shin 637a41400c Merge remote-tracking branch 'upstream/master' into pipeline-emails
* upstream/master: (206 commits)
  Implement fourth round of comments from @DouweM.
  Fix `CreateDeploymentService` spec.
  Reload issues in spec to ensure label<->issue mapping properly loaded
  Fix build.
  Remove unnecessary #{} in cycle analytics template.
  Update cycle analytics icon and fix color of the dismiss button.
  Use triple dashes for the empty value in cycle analytics.
  Fix typo on cycle analytics copy.
  Add page title and fix sub menu width in Cycle Analytics page.
  Update Cycle Analytics Read more link URL.
  Display the cycle analytics navbar based on the `:read_cycle_analytics` ability.
  Improve indentation in `Gitlab::Database::Median`
  Add a spec for merge request metric caching while refreshing a merge request from a forked project.
  Use the `IssuableBaseService` lifecycle hooks to cache `MergeRequestsClosingIssues`
  Implement a second round of review comments from @DouweM.
  Add docs on Cycle Analytics
  Test if issue authors can access private projects
  Update .pkgr.yml with Ubuntu 16.04 dependencies
  fix issues mr counter
  Move JSON generation (cycle analytics) into a controller method.
  ...
2016-09-21 16:19:07 +08:00
Lin Jen-Shin 63e03dada7 Make various trace methods take last_lines argument:
So that we could read last few lines rather than read
the entire file which could be huge.
2016-09-21 16:12:32 +08:00
Dan Dunckel 02d69091bc Add spec covering 'committer_hash' 2016-09-20 10:15:43 -07:00
Kamil Trzcinski 0672c5a92e Post-merge improve of CI permissions 2016-09-20 15:41:41 +02:00
Rémy Coutable fb4d2f9e5a Merge branch 'feature/github-edit-path' into 'master'
Lets the user choose a namespace and name on Github imports

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/14971

See merge request !5728
2016-09-20 12:23:14 +00:00
Douwe Maan 667d235091 Merge branch 'lfs-support-for-ssh-enabled' into 'master'
LFS support for ssh enabled

## What does this MR do?
This is follow-up after https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6043 which is falsely shown as merged due to: https://gitlab.com/gitlab-org/gitlab-ce/issues/22334

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

## Why was this MR needed?

## Screenshots (if relevant)

## Does this MR meet the acceptance criteria?

- [ ] [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
  - [ ] All builds are passing
- [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] 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?

See merge request !6413
2016-09-20 10:10:45 +00:00
James Lopez 0c65112da7 modify github import JS and controller so we can now specify a namespace and/or name for a project.
- Fixed and added specs.
- Added different namespace options depending on user privilages
- Updated docs.
2016-09-20 10:14:39 +02:00
Robert Speicher 4722c45ea2 Merge branch 'strip-key-comments-for-gitlab-shell' into 'master'
Strip comments before sending keys to gitlab-shell

## Why was this MR needed?

https://gitlab.com/gitlab-org/gitlab-ce/issues/22167 encoding issues in comment text.

## What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ce/issues/22167

See merge request !6381
2016-09-20 05:42:03 +00:00
Douwe Maan 8799103037 Merge branch 'feature/import-export-security-specs' into 'master'
Import/Export security specs

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/20857

Related: https://gitlab.com/gitlab-org/gitlab-ce/issues/20821/

See merge request !1987
2016-09-20 04:44:54 +00:00
Kamil Trzcinski dba227da88 Fix test failure 2016-09-19 20:22:10 +02:00
Kamil Trzcinski 3c1bb3432b Revert "Revert all changes introduced by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6043"
This reverts commit 6d43c95b70.
2016-09-19 16:34:32 +02:00
Rémy Coutable fe084819b4 Merge branch 'per-build-token-without-lfs' into 'master'
Make CI to use the permission of the user who is trigger the build

This is continuation of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5735, but with removed all LFS code that is added by: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6043.

This also incorporates most of LFS code added in !6043 to simplify further merge.

See merge request !6409
2016-09-19 13:36:54 +00:00
Rémy Coutable 1e72de6690 Merge branch 'fix/import-export-db-errors' into 'master'
Fix import/export database errors

Fixes protected branches errors when importing a project including them

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/21295

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/21799

See merge request !6099
2016-09-19 13:02:49 +00:00
Kamil Trzcinski 6d43c95b70 Revert all changes introduced by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6043 2016-09-19 13:45:28 +02:00
Kamil Trzcinski 967eb8fb55 Merge branch 'master' into per-build-token 2016-09-19 13:31:42 +02:00
Kamil Trzcinski 748dd35c65 Fix spec failures 2016-09-19 13:29:48 +02:00
Kamil Trzcinski 08272ec151 Add validation of URL and validation of name 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
James Lopez e74b7d665b squashed - Fix DB exceptions raised importing some specific projects.
Better import of labels, milestones and protected branches. Updated relevant specs.
Loose pipeline validation on importing, so it does not fail when there are missing fields, which are not validated at DB level. Also, updated spec with relevant test.
2016-09-19 09:18:37 +02:00
Kamil Trzcinski b0195d5c55 Fix specs for available statuses 2016-09-16 13:47:54 +02:00
Jacob Vosmaer 67ec96e3e0 Strip comments before sending keys to gitlab-shell
Avoid issues with text encoding by not sending out non-7-bit ASCII
text.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/22167
2016-09-16 11:49:11 +02:00
Kamil Trzcinski a387ff7ba8 Fix specs after renaming authentication_capabilities 2016-09-16 11:12:22 +02:00
Kamil Trzcinski e941365f3b Rename capabilities to authentication_abilities 2016-09-16 11:12:21 +02:00
Drew Blessing 1f399fe437 fix 2016-09-15 21:59:59 -05:00
Drew Blessing e000f02bd3 Add support for column limits in add_column_with_default 2016-09-15 21:59:58 -05:00
Kamil Trzcinski 5f45ddc545 Fix specs after merging LFS changes 2016-09-15 22:23:43 +02:00
Kamil Trzcinski 83b643a014 Merge remote-tracking branch 'origin/lfs-support-for-ssh' into per-build-token
# Conflicts:
#	app/controllers/projects/git_http_client_controller.rb
#	app/helpers/lfs_helper.rb
#	lib/gitlab/auth.rb
#	spec/requests/lfs_http_spec.rb
2016-09-15 21:16:38 +02:00
Patricio Cano be09bcf074 Refactored authentication code to make it a bit clearer, added test for wrong SSH key. 2016-09-15 12:21:00 -05:00
Patricio Cano 71aff7f6a3 Use special characters for `lfs+deploy-key` to prevent a someone from creating a user with this username, and method name refactoring. 2016-09-15 12:21:00 -05:00
Patricio Cano c25630ee2c Refactored handling of the `LfsToken` and added functionality to it to simplify external code. 2016-09-15 12:21:00 -05:00
Patricio Cano 48f1a61fd5 Refactored LFS auth logic when using SSH to use its own API endpoint `/lfs_authenticate` and added tests. 2016-09-15 12:21:00 -05:00
Patricio Cano cb85cf1f0a Refactor LFS token logic to use a Redis key instead of a DB field, making it a 1 use only token. 2016-09-15 12:21:00 -05:00
Patricio Cano e40e3fdc82 Added LFS support to SSH
- Required on the GitLab Rails side is mostly authentication and API related.
2016-09-15 12:21:00 -05:00
Kamil Trzcinski 548169cfb5 Fix most of specs 2016-09-15 15:40:53 +02:00
Kamil Trzcinski 9d1ccd2ad3 Fix existing authorization specs 2016-09-15 13:49:11 +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
Kamil Trzcinski 11f87700e8 Add access specs 2016-09-15 11:57:09 +02:00
Jacob Vosmaer 11f54caada Allow trailing newline in secret base64 data 2016-09-13 19:45:02 +02:00
Andrew Smith 05b52e0f5e
Import GitHub release notes
# Conflicts:
#	lib/gitlab/github_import/importer.rb
2016-09-13 14:01:22 +10:00
Robert Speicher c87235a24d Merge branch '21569-dont-add-created-by-for-matched-users' into 'master'
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
2016-09-12 20:08:33 +00:00
Robert Speicher 0b2a34108d Merge branch 'restrict_ldap_return_attributes' into 'master'
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
2016-09-09 18:59:33 +00:00
Drew Blessing bf8a48e179 Request only the LDAP attributes we need 2016-09-09 13:14:57 -05:00
Douglas Barbosa Alexandre 02761638f1 Avoid conflict with admin labels when importing GitHub labels 2016-09-09 11:22:38 -03:00
James Lopez 37fbb15a29 refactored some stuff and added new models / attributes after rebase 2016-09-09 14:56:10 +02:00
James Lopez 0f15e971fc more spec refactoring based on feedback 2016-09-09 14:56:10 +02:00
James Lopez 1631ceff19 fix attributes missing in spec after rebase with master 2016-09-09 14:56:10 +02:00
James Lopez e2827250c3 remove extra line 2016-09-09 14:56:10 +02:00
James Lopez 668ebfcaae fix wording 2016-09-09 14:56:10 +02:00
James Lopez 621b4eaf22 fixing a couple of bugs and lots of refactoring of the export file spec 2016-09-09 14:56:10 +02:00
James Lopez 13a977475a add model configuration spec to check for new models. Also refactored attribute_configuration spec 2016-09-09 14:56:10 +02:00
James Lopez 8ca963bd96 more refactoring of the specs 2016-09-09 14:56:10 +02:00
James Lopez 7323d30f44 refactored specs based on feedback 2016-09-09 14:56:10 +02:00
James Lopez c71ed62910 fixed failing spec 2016-09-09 14:56:10 +02:00
James Lopez ad14944be7 fix specs so they work in EE straight away 2016-09-09 14:56:10 +02:00
James Lopez ff1d6477da Export integration test and attribute change spec - squashed
Export file integration test that checks for sensitive info.
Also added spec to check new added attributes to models that
can be exported.
2016-09-09 14:56:10 +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
Rémy Coutable eb2d20665f Merge branch 'smart-pipeline-duration' into 'master'
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
2016-09-08 17:38:20 +00:00
Dmitriy Zaporozhets 535ce11829 Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq 2016-09-08 16:59:06 +03:00
Andrew Smith 4a788f8a0c
Only add the original author if there isn't a linked GitLab account 2016-09-08 20:48:35 +10: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
Sean McGivern 24424d932f Fix merge conflict size limit 2016-09-07 16:00:26 +01:00
Jacob Vosmaer 8e97323d49 Constants in specs 2016-09-06 17:26:16 +02:00