Commit Graph

3973 Commits

Author SHA1 Message Date
Sean McGivern 4ae8e20c9c Merge branch 'events-migration-cleanup' into 'master'
Finish migration to the new events setup

Closes #37241

See merge request !13932
2017-09-07 15:33:54 +00:00
Annabel Dunstone Gray 99dcf870dd Use indigo as default theme 2017-09-07 06:43:12 -07:00
Kamil Trzcinski 83c1bb688c Add has_auto_devops_implicitly_disabled 2017-09-07 15:08:51 +02:00
Tiago Botelho cfd475a45e Removes default scope from sortable 2017-09-07 13:01:59 +01:00
Michael Kozono 1feeea9c6a Refer to “Share with group lock” consistently 2017-09-06 12:07:21 -07:00
Michael Kozono a4b564b620 Refactor based on code review 2017-09-06 12:07:21 -07:00
Michael Kozono c2c6c4c69e Specify nested_groups specs 2017-09-06 12:07:20 -07:00
Michael Kozono 1cc7f4a45d Enable share_with_group_lock on subgroup
…when needed
2017-09-06 12:07:20 -07:00
Kamil Trzcinski cd8ea329f0 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into zj/gitlab-ce-zj-auto-devops-table 2017-09-06 21:00:47 +02:00
Kamil Trzcinski 632f6ba267 Add tests to cover all introduced changes 2017-09-06 21:00:34 +02:00
Annabel Dunstone Gray 7b567597ee Fix specs; start on light theme 2017-09-06 12:57:30 -05:00
Rubén Dávila 6c49a62800 Restore some changes from !9199 2017-09-06 12:54:09 -05:00
Kamil Trzcinski 82ed2a0909 Improve config source handling code 2017-09-06 18:57:07 +02:00
Sean McGivern 3441025126 Merge branch '35161_first_time_contributor_badge' into 'master'
First time contributor badge

Closes #35161

See merge request !13902
2017-09-06 16:52:54 +00:00
Yorick Peterse 235b105c91
Finish migration to the new events setup
This finishes the procedure for migrating events from the old format
into the new format. Code no longer uses the old setup and the database
tables used during the migration process are swapped, with the old table
being dropped.

While the database migration can be reversed this will 1) take a lot of
time as data has to be coped around 2) won't restore data in the
"events.data" column as we have no way of restoring this.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/37241
2017-09-06 16:40:31 +02:00
Alexander Keramidas 4df54f2607 Profile updates from providers 2017-09-06 16:38:52 +03:00
Zeger-Jan van de Weg 8189347b49
Merge branch 'master' into zj-auto-devops-table 2017-09-06 15:16:38 +02:00
micael.bergeron 65bcd141c8 add controller spec
also fix some code styling issues
2017-09-06 09:00:57 -04:00
micael.bergeron 4130552b42 remove lint 2017-09-06 09:00:57 -04:00
micael.bergeron b44a1bcd0b rework the contributor badge
- only show in merge-requests
 - show as a little glyph
2017-09-06 09:00:57 -04:00
micael.bergeron 45b83ed99a round of fixes after code review 2017-09-06 09:00:57 -04:00
micael.bergeron 966b1128d8 WIP: refactor the first-contributor to Issuable
this will remove the need make N queries (per-note) at the
cost of having to mark notes with an attribute

this opens up the possibility for other special roles for notes
2017-09-06 09:00:57 -04:00
Sean McGivern b40941db14 Fix note resolution specs 2017-09-06 10:10:16 +01:00
Sean McGivern e8f29569bc Resolve outdated diff discussions on push 2017-09-06 10:08:03 +01:00
Zeger-Jan van de Weg 003bfac293
Incorporate another round of feedback 2017-09-06 09:26:47 +02:00
Rubén Dávila 66cfb901c0 Optimize SQL queries used in Groups::GroupMembersController#create
The following optimizations were performed:

- Add new association to GroupMember and ProjectMember

  This new association will allow us to check if a user is a member of a
  Project or Group through a single query instead of two.

- Optimize retrieving of Members when adding multiple Users
2017-09-05 15:54:07 -05:00
Sean McGivern 9bb056e0f1 Merge branch 'fuzzy-issue-search' into 'master'
Fuzzy search issues / merge requests

Closes #26835, #29994, and #20362

See merge request !13780
2017-09-05 15:48:39 +00:00
Alexis Reigel b62c1620ea drop backwards compatibility for valid_signature 2017-09-05 12:18:33 +02:00
Alexis Reigel 978252a3fa use new #verification_status 2017-09-05 12:18:33 +02:00
Alexis Reigel 98016ef7f3 add User##verified_email? method 2017-09-05 12:18:32 +02:00
Alexis Reigel 64855c8e30 match the committer's email against the gpg key
the updated verification of a gpg signature requires the committer's
email to also match the user's and the key's emails.
2017-09-05 12:18:31 +02:00
Kamil Trzciński 3d61421fb2 Merge branch 'fix/sm/35650-remove-createtriggerrequestservice-and-forbid-to-persist-variables-on-ci-triggerrequest' into 'master'
Removes `CreateTriggerRequestService` and add a blocker to prevent saving variables on `Ci::TriggerRequest`

Closes #35650

See merge request !13792
2017-09-05 09:49:55 +00:00
Shinya Maeda 38d9b4d77d Use script_failure. Add runner_system_failure. Improve spec. 2017-09-05 15:10:34 +09:00
Shinya Maeda e8e8ae4d7d Fix spec 2017-09-05 14:30:28 +09:00
Shinya Maeda 68f6c61cf6 - Allow runner API to pass failure_reason
- Fix spec
2017-09-05 14:30:28 +09:00
Shinya Maeda 1d7c039072 Fix enum lists 2017-09-05 14:30:28 +09:00
Shinya Maeda dcf09d1144 Implement `failure_reason` on `ci_builds` 2017-09-05 14:30:28 +09:00
Zeger-Jan van de Weg bcd70c4c46
Incorporate review 2017-09-04 15:44:46 +02:00
Shinya Maeda 5b88bd81f5 Move trigger_variables to presenter 2017-09-04 22:21:47 +09:00
Shinya Maeda fa6b9acaf9 trigger_variables should consider trigger_request existstance always 2017-09-04 21:55:26 +09:00
Shinya Maeda 3ae2038176 Remove ci_trigger_request_with_variables 2017-09-04 21:55:26 +09:00
Shinya Maeda d614c43105 Fix trigger_request.variables 2017-09-04 21:55:26 +09:00
Shinya Maeda cff104ec4b Fix spec 2017-09-04 21:55:26 +09:00
Shinya Maeda acc7497855 Revert autheticate! in Trigger API 2017-09-04 21:55:26 +09:00
Shinya Maeda 75130a41ba Remove CreateTriggerRequestService and forbit to save variables on Ci::TriggerRequest 2017-09-04 21:55:26 +09:00
Kamil Trzciński a0c13698f9 Merge branch 'feature/gb/kubernetes-only-pipeline-jobs' into 'master'
Check if Kubernetes is required when creating pipeline jobs

Closes #34785

See merge request !13849
2017-09-04 12:30:27 +00:00
Sean McGivern 4efdb451b5 Merge branch 'move-git-operation-service' into 'master'
Move GitOperationService to Gitlab::Git

See merge request !13984
2017-09-04 11:06:12 +00:00
Sean McGivern dabce2c571 Merge branch 'git-operation-service-to-git' into 'master'
Prepare GitOperationService for moving to Gitlab::Git

See merge request !13773
2017-09-04 10:56:26 +00:00
Grzegorz Bizon e23e86953d Merge branch 'master' into feature/gb/kubernetes-only-pipeline-jobs
* master: (469 commits)
2017-09-04 12:13:11 +02:00
Kamil Trzciński d449355f94 Merge branch 'feature/sm/33281-protected-runner-executes-jobs-on-protected-branch' into 'master'
Protected runner executes jobs on protected branch [Solution 1]

Closes #33281

See merge request !13194
2017-09-04 08:23:50 +00:00
Zeger-Jan van de Weg a315e6025c
Merge branch 'master' into zj-auto-devops-table 2017-09-04 09:28:46 +02:00
Jose Ivan Vargas b623807682 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2017-09-03 16:09:59 -05:00
Shinya Maeda 1b481342a0 Fix spec 2017-09-03 23:49:11 +09:00
Shinya Maeda eab938d505 Fix typo 2017-09-03 23:49:11 +09:00
Shinya Maeda ce7c0ac3db Add validation for protected attributes 2017-09-03 23:49:11 +09:00
Shinya Maeda 07f7a01b4d Improve spec. Add validation for accel_level on runner. 2017-09-03 23:49:10 +09:00
Shinya Maeda 2170eec662 Fix spec 2017-09-03 23:49:10 +09:00
Shinya Maeda 1024718e9f Refactor access_level to not_protected and ref_protected 2017-09-03 23:49:10 +09:00
Shinya Maeda 4b0e31ba64 Extend can_pick? 2017-09-03 23:49:10 +09:00
Shinya Maeda 1925bfd2a5 Fix spec 2017-09-03 23:49:10 +09:00
Shinya Maeda bbe967abeb Add the rest of specs 2017-09-03 23:49:10 +09:00
Shinya Maeda eda34b1a18 Add spec. Fix runner setting page. It worked. 2017-09-03 23:49:10 +09:00
Jacob Schatz 8100274518 Merge branch 'issue-discussions-refactor' into 'master'
Issue discussions Vue refactor

See merge request !12069
2017-09-02 11:55:18 +00:00
Robert Speicher 223849fa17 Merge branch '17849-allow-admin-to-restrict-min-key-length-and-techno' into 'master'
Add settings for minimum key strength and allowed key type

Closes #17849

See merge request !13712
2017-09-01 19:23:08 +00:00
Jacob Vosmaer 6cdaa27a53 Move GitOperationService to Gitlab::Git 2017-09-01 14:37:56 +02:00
Grzegorz Bizon fc4fb6e4d2 Change CI/CD kubernetes policy keyword to `active` 2017-09-01 13:04:08 +02:00
Grzegorz Bizon 73d0cafbe4 Check if service active when using CI/CD kubernetes policy 2017-09-01 12:58:22 +02:00
Jacob Vosmaer 129d6bf2de Fix whitespace 2017-09-01 12:49:28 +02:00
Sean McGivern 096850a49a Merge branch 'sm-cherry-pick-list-commits-in-message' into 'master'
Add 'from commit' information to cherry-picked commits

See merge request !13475
2017-09-01 10:24:29 +00:00
Jacob Vosmaer e81229805d Remove empty line 2017-09-01 11:59:27 +02:00
Sean McGivern 15ad0ac1e7 Merge branch '35686-unescape-wiki-title' into 'master'
Unescape HTML characters in Wiki title

Closes #35686

See merge request !13942
2017-09-01 09:53:09 +00:00
Jacob Vosmaer 0aadf36b4a Restore with_branch cache spec 2017-09-01 11:51:55 +02:00
Sean McGivern 2fc500819f Merge branch 'issue_36820' into 'master'
Remove closing external issues by reference error

Closes #36820

See merge request !13910
2017-09-01 09:15:40 +00:00
Marin Jankovski 28060caa0a
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2017-09-01 09:21:18 +02:00
Zeger-Jan van de Weg 35b9213cd7
Add config_source to ci_pipelines
Given the user can soon have multiple config sources for CI, we now store
what type at the time of the pipeline run we chose. This will give us
insight into what triggered the new pipeline so we can display it to the
enduser.
2017-08-31 22:25:26 +02:00
Zeger-Jan van de Weg 6ed490401f
Implement the implied CI/CD config for AutoDevOps
Behind an application setting, which defaults to false, this commit
implements the implied CI/CD config. Which means that in the case we
can't find the `.gitlab-ci.yml` on the commit we want to start a
pipeline for, we fall back to an implied configuration.

For now the Bash template has been copied to
`Auto-Devops.gitlab-ci.yml` so the tests actually work.

Fixes #34777
2017-08-31 22:25:25 +02:00
Felipe Artur 3e4013f217 Remove closing external issues by reference error 2017-08-31 17:15:30 -03:00
Tim Zallmann e584283822 Merge branch '31273-creating-an-project-within-an-internal-sub-group-gives-the-option-to-set-it-a-public' into 'master'
Resolve various visibility level settings issues

Closes #31273

See merge request !13442
2017-08-31 17:17:05 +00:00
Douwe Maan 92edb3edab Merge branch 'master' into issue-discussions-refactor
# Conflicts:
#	app/models/issue.rb
2017-08-31 18:02:19 +02:00
Sean McGivern dd406182cb Merge branch 'sidebar-cache-updates' into 'master'
Only update the sidebar count caches when needed

See merge request !13878
2017-08-31 14:30:03 +00:00
Jacob Vosmaer 8ad690b0d4 Prepare GitOperationService for move to Gitlab::Git 2017-08-31 15:35:59 +02:00
Grzegorz Bizon d5d2497643 Merge branch 'zj-disable-pages-in-subgroups' into 'master'
Don't show references to Pages when not available

Closes #34864

See merge request !13888
2017-08-31 12:59:29 +00:00
Grzegorz Bizon 92673c2c63 Merge branch 'master' into feature/gb/kubernetes-only-pipeline-jobs
* master: (275 commits)
  Decrease Metrics/PerceivedComplexity threshold to 17
  Upgrade mail and nokogiri gems due to security issues
  Link out to stackoverflow answer on setting swappiness
  Document swappiness recomendations in the requirements doc
  Fix invalid attribute used for time-ago-tooltip component
  Update latest artifacts doc
  Add changelog entry for flipping verify_certificates
  Default LDAP config verify_certificates to true
  Update share project with groups docs
  remove accidental console.log from karma tests
  update specs to match reorganized monitoring components
  Remove tooltips from new sidebar
  Use `git update-ref --stdin -z` to delete refs
  Don't use public_send in destroy_conditionally! helper
  Remove unused expressions policy from ci/cd config
  Simplify code for appending strategies in CI/CD config
  Raise exception when simplifiable ci entry incomplete
  Add changelog entry
  Fix MySQL failure for emoji autocomplete
  max-width for lazy-loaded images (this was removed in the original MR through merge resolution most probably)
  ...

Conflicts:
	lib/gitlab/ci/config/entry/policy.rb
2017-08-31 14:02:52 +02:00
Grzegorz Bizon 96a7e1628a Refactor context variables in pipeline model class 2017-08-31 13:24:03 +02:00
Grzegorz Bizon 896e5f5031 Merge branch '26692-predefined-variable-gitlab-user-name' into 'master'
Resolve "Predefined Variable GITLAB_USER_NAME"

Closes #26692

See merge request !13824
2017-08-31 10:03:07 +00:00
Marin Jankovski 7d38df306c
Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq 2017-08-31 10:45:28 +02:00
Zeger-Jan van de Weg 04cd47dd5a
Don't show references to Pages when not available
In this instance its subgroups, and given we can't deploy it, we
shouldn't allow it to be shown.

Fixes gitlab-org/gitlab-ce#34864
2017-08-31 09:27:42 +02:00
Douwe Maan 7c215dd23d Merge branch 'master' into issue-discussions-refactor 2017-08-31 09:13:41 +02:00
Douwe Maan eacda4cc98 Merge branch '36743-existing-repo-master' into 'master'
[master] Prevent project creation (blank, import or fork) when repository already exists on disk

See merge request gitlab/gitlabhq!2169
2017-08-31 07:03:12 +00:00
Nick Thomas 29b40db589 More review comments 2017-08-30 21:20:00 +01:00
Jacopo 378ee1dac2 Unescape HTML characters in Wiki title
The special characters of a wiki title are now escaped correctly.
2017-08-30 21:59:09 +02:00
Nick Thomas eb05bdc6f5 Move the key restriction validation to its own class 2017-08-30 20:50:44 +01:00
Nick Thomas 6847060266 Rework the permissions model for SSH key restrictions
`allowed_key_types` is removed and the `minimum_<type>_bits` fields are
renamed to `<tech>_key_restriction`. A special sentinel value (`-1`) signifies
that the key type is disabled.

This also feeds through to the UI - checkboxes per key type are out, inline
selection of "forbidden" and "allowed" (i.e., no restrictions) are in.

As with the previous model, unknown key types are disallowed, even if the
underlying ssh daemon happens to support them. The defaults have also been
changed from the lowest known bit size to "no restriction". So if someone
does happen to have a 768-bit RSA key, it will continue to work on upgrade, at
least until the administrator restricts them.
2017-08-30 20:50:44 +01:00
Nick Thomas b0f982fbdf Add settings for minimum key strength and allowed key type
This is an amalgamation of:

* Cory Hinshaw: Initial implementation !5552
* Rémy Coutable: Updates !9350
* Nick Thomas: Resolve conflicts and add ED25519 support !13712
2017-08-30 20:50:44 +01:00
Hiroyuki Sato 59e5393827 Fuzzy search issuable title or description 2017-08-31 03:14:58 +09:00
Yorick Peterse c158a22fd3
Only update the sidebar count caches when needed
This ensures the issues/MR cache of the sidebar is only updated when the
state or confidential flags changes, instead of changing this for every
update.
2017-08-30 15:49:40 +02:00
Lin Jen-Shin 86149a8216 Merge remote-tracking branch 'upstream/master' into 36807-gc-unwanted-refs-after-import
* upstream/master: (225 commits)
  Add changelog entry
  Backports EE 2756 logic to CE.
  Make rubocop happy
  Make profile settings dropdown consistent
  Add filter by my reaction
  Update spec initialization with it being a shared component
  Update identicon path and selector
  Renamed to `identicon` and make shared component
  Merge branch 'master-i18n' into 'master'
  Fix broken Frontend JS guide
  Replace 'project/star.feature' spinach test with an rspec analog
  Adds position fixed to right sidebar
  Fixes the margin of the top buttons of the pipeline page
  Remove commented out code
  Better align fallback image emojis
  Decrease Metrics/CyclomaticComplexity threshold to 15
  Add changelog
  Respect the default visibility level when creating a group
  Further break with_repo_branch_commit into parts
  Make sure inspect doesn't generate crazy string
  ...
2017-08-30 21:13:19 +08:00
Sean McGivern fbab532fc1 Merge branch 'perf.slow-issuable' into 'master'
Perf.slow issuable

Closes #32844

See merge request !13685
2017-08-30 12:41:11 +00:00
Yorick Peterse 8274e0fe3c Merge branch 'improve-autocomplete-user-performance' into 'master'
Improve AutocompleteController#users.json performance

Closes #36879

See merge request !13754
2017-08-30 11:17:10 +00:00
Douwe Maan b181d3124e Merge branch 'master' into issue-discussions-refactor
# Conflicts:
#	app/models/issue.rb
2017-08-30 10:14:56 +02:00
Hiroyuki Sato 7187395ef1 Add filter by my reaction 2017-08-30 07:48:55 +00:00
Mark Fletcher 22d5cca8a7 Add a Build Variable to represent the triggering GitLab user's login username
* Predefined variable represents the username of the GitLab user that started a build
2017-08-30 11:25:30 +08:00
Mark Fletcher 91cca6e494 Add a Build Variable to represent the triggering GitLab user's name
* Predefined variable represents the name of the GitLab user that started a build
2017-08-30 11:24:59 +08:00
Robert Speicher 172cb70d4c Merge branch '35793_fix_predicate_names' into 'master'
Remove `is_` prefix from predicate method names

See merge request !13810
2017-08-29 16:23:02 +00:00
Lin Jen-Shin 9d3ee1ff13 Further break with_repo_branch_commit into parts
So it's more clear what could happen. Also add
more tests about the behaviour.
2017-08-29 22:42:34 +08:00
Maxim Rydkin 87467127b6 replace `is_ancestor?` with `ancestor?` 2017-08-29 11:14:41 +03:00
Maxim Rydkin 48d3e5fac6 replace `is_edited?` with `edited?` 2017-08-29 11:14:41 +03:00
Oswaldo Ferreira ffc576d7df Rename MergeRequest#async_merge to merge_async 2017-08-28 15:55:25 -03:00
Oswaldo Ferreira 4f17c6b763 Track enqueued and ongoing MRs 2017-08-28 15:48:09 -03:00
Lin Jen-Shin 3a4da8ce8b Fix tests 2017-08-28 18:51:23 +08:00
Grzegorz Bizon 326dc7da3b Check if kubernetes required before creating a job 2017-08-26 12:45:36 +02:00
Grzegorz Bizon ae99f74b77 Improve kubernetes service specs readability 2017-08-26 11:18:18 +02:00
Grzegorz Bizon cdcc196c1f Make it possible to access deployment details from pipeline 2017-08-26 11:17:47 +02:00
Mike Greiling d6d713f6ba fix failing tests due to new group visibility restrictions 2017-08-26 03:30:01 -05:00
Rubén Dávila b2b9d63f9b Add validation to check visibility level of sub groups. 2017-08-26 03:30:01 -05:00
Rubén Dávila d413f8e4e4 Add validation for visibility level of sub groups
Sub groups should not have a visibility level higher than its parent.
2017-08-26 03:30:01 -05:00
Gabriel Mazetto 8f178c4222 Prevent new / renamed project from using a repository path that already exists on disk
There are some redundancies in the validation steps, and that is to
preserve current error messages behavior

Also few specs have to be changed in order to fix madness in validation
logic.
2017-08-25 20:06:06 +02:00
Kamil Trzciński 04c092b58d Merge branch 'fix/gb/fix-invalid-stage-status-transition' into 'master'
Set a default CI/CD status when it is not known

Closes #36790

See merge request !13737
2017-08-25 09:54:42 +00:00
Hiroyuki Sato 9e203582b3 Improve AutocompleteController#user.json performance 2017-08-25 18:41:43 +09:00
Sean McGivern e46a3d2fda Merge branch 'git-operation-user' into 'master'
Move GitHooksService into Gitlab::Git

See merge request !13739
2017-08-24 14:32:17 +00:00
Kamil Trzciński eae604e6de Merge branch 'backstage/gb/after-save-asynchronous-job-hooks' into 'master'
Do not fire synchronous hooks when creating a job

Closes #35286

See merge request !13734
2017-08-24 12:46:33 +00:00
Lin Jen-Shin 932d32515a Move to Projects::HousecleaningService 2017-08-24 18:58:31 +08:00
Andrew Newdigate fb49c94e49 Delegate Repository::branch_exists? and ref_exists? to Gitlab::Git 2017-08-24 09:20:04 +00:00
Sean McGivern 7ab4efa8f8 Merge branch '36262_merge_request_reference_in_merge_commit_global' into 'master'
fix Merge request reference in merge commit is not global

Closes #36262

See merge request !13518
2017-08-24 09:09:45 +00:00
Grzegorz Bizon 39b5bd69ba Merge branch 'zj-add-pipeline-source-variable' into 'master'
Expose CI_PIPELINE_SOURCE on CI jobs

Closes #34165

See merge request !13759
2017-08-24 08:29:54 +00:00
Douwe Maan 75d1283e59 Merge branch 'cache-issue-and-mr-counts' into 'master'
Cache the number of open issues and merge requests

Closes #36622

See merge request !13639
2017-08-23 14:21:41 +00:00
Lin Jen-Shin 140ac8d2ad Add changelog and tests 2017-08-23 21:51:21 +08:00
Yorick Peterse 6ec53f5d48
Cache the number of open issues and merge requests
Every project page displays a navigation menu that in turn displays the
number of open issues and merge requests. This means that for every
project page we run two COUNT(*) queries, each taking up roughly 30
milliseconds on GitLab.com. By caching these numbers and refreshing them
whenever necessary we can reduce loading times of all these pages by up
to roughly 60 milliseconds.

The number of open issues does not include confidential issues. This is
a trade-off to keep the code simple and to ensure refreshing the data
only needs 2 COUNT(*) queries instead of 3. A downside is that if a
project only has 5 confidential issues the counter will be set to 0.

Because we now have 3 similar counting service classes the code
previously used in Projects::ForksCountService has mostly been moved to
Projects::CountService, which in turn is reused by the various service
classes.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36622
2017-08-23 13:42:29 +02:00
Zeger-Jan van de Weg a99b2d8e12
Expose CI_PIPELINE_SOURCE on CI jobs
It was missing and expected it wouldn't hurt anyone
2017-08-23 13:14:49 +02:00
Grzegorz Bizon 53353c849d Merge branch 'master' into backstage/gb/after-save-asynchronous-job-hooks
* master: (115 commits)
  Use event-based waiting in Gitlab::JobWaiter
  Make sure repository's removal work for legacy and hashed storages
  Use `@hashed` prefix for hashed paths on disk, to avoid collision with existing ones
  Refactor project and storage types
  Prevent using gitlab import task when hashed storage is enabled
  Some codestyle changes and fixes for GitLab pages
  Removed some useless code, codestyle changes and removed an index
  Fix repository reloading in some specs
  Changelog
  Moving away from the "extend" based factory to a more traditional one.
  Enable automatic hashed storage for new projects by application settings
  New storage is now "Hashed" instead of "UUID"
  Add UUID Storage to Project
  Move create_repository back to project model as we can use disk_path and share it
  Codestyle: move hooks to the same place and move dependent methods to private
  Use non-i18n values for setting new group-level issue/MR button text
  indexes external issue tracker
  copyedit
  indexes user/search/ from /user/index
  Correctly encode string params for Gitaly's TreeEntries RPC
  ...
2017-08-23 11:46:23 +02:00
Douwe Maan fbe82e4cd9 Merge branch 'master' into issue-discussions-refactor
# Conflicts:
#	package.json
2017-08-23 11:31:17 +02:00
Sean McGivern 8e27c3db44 Merge branch 'fix-push-events-branch-removals' into 'master'
Fix displaying events of removed events and events without commit messages

Closes #36685 and #36722

See merge request !13721
2017-08-23 09:27:24 +00:00
Jacob Vosmaer dc7c6bede2 Move GitHooksService to Gitlab::Git 2017-08-23 10:45:20 +02:00
Jacob Vosmaer 65f83941c3 Make gl_repository a G::G::Repository attribute 2017-08-23 10:45:20 +02:00
Jacob Vosmaer 9b93093292 Decouple GitOperationService from User 2017-08-23 10:45:20 +02:00
Saverio Miroddi 934eef7290 Improve description of a Commit#cherry_pick_message UT 2017-08-22 22:20:22 +02:00
Yorick Peterse b4aaced71a
Fix display of push events for removed refs
This changes the style of push events that remove tags or branches so
they don't display the commit details. This prevents displaying commit
details such as:

    000000 . --broken encoding

Instead we now simply display the header such as:

    Administrator deleted branch example-branch

This is displayed in the same style as events for newly created
branches/tags.

This commit also ensures that if no commit message is present we simply
don't display anything, instead of "--broken encoding".

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36685
Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36722
2017-08-22 20:15:45 +02:00
Kamil Trzciński 080a359e0c Merge branch 'fix/sm/34762-bad-validation-message' into 'master'
Enforce namespace of Kubernetes to lowercase

Closes #34762

See merge request !13732
2017-08-22 16:38:07 +00:00
Grzegorz Bizon 37881ebb75 Set a default CI/CD status when it is not known 2017-08-22 14:04:34 +02:00
Sean McGivern e6f20e52f6 Merge branch 'fix-broadcast-message-caching' into 'master'
Fix caching of future broadcast messages

Closes #36661

See merge request !13667
2017-08-22 11:45:51 +00:00
Grzegorz Bizon 086f0351df Do not fire synrchonous hooks when creating a job
Fire asynchronous hooks instead.
2017-08-22 10:57:52 +02:00
Shinya Maeda 38cb32933b Update kubernetes_service_spec.rb 2017-08-22 08:01:52 +00:00
Shinya Maeda fe9fc0af75 Enfouce namespace for Kubernetes to lowercase 2017-08-22 15:12:27 +09:00
Gabriel Mazetto fb9e059a41 Make sure repository's removal work for legacy and hashed storages 2017-08-22 06:33:20 +02:00
Gabriel Mazetto 02737b8508 Use `@hashed` prefix for hashed paths on disk, to avoid collision with existing ones 2017-08-22 06:33:20 +02:00
Gabriel Mazetto d17a7be830 Refactor project and storage types 2017-08-22 06:33:20 +02:00
Gabriel Mazetto de89dcc213 Some codestyle changes and fixes for GitLab pages 2017-08-22 06:33:20 +02:00
Gabriel Mazetto fff5ebdcae Removed some useless code, codestyle changes and removed an index 2017-08-22 06:33:20 +02:00
Gabriel Mazetto e7a060321f Moving away from the "extend" based factory to a more traditional one.
Using `extend` dynamically can lead to bad performance as it
invalidates the method's cache.
2017-08-22 06:33:20 +02:00
Gabriel Mazetto 9e6fa996ea New storage is now "Hashed" instead of "UUID" 2017-08-22 06:33:20 +02:00
Robin Bobbitt 62ef67acc3 Hide read_registry scope when registry is disabled on instance 2017-08-21 18:13:32 -04:00
Saverio Miroddi 7a8a8e0764 Fix rubocop errors in spec/models/commit_spec.rb 2017-08-21 22:13:41 +02:00
Saverio Miroddi e6220c018e Add UT for cherry-pick of an existing merge that is not found 2017-08-21 21:05:11 +02:00
Saverio Miroddi 9ec358af7b Reverse order of commits in MR cherry-pick message
Also improved the UT for better documenting this change.
2017-08-21 20:47:18 +02:00
Yorick Peterse e0b589f161
Fix caching of future broadcast messages
This changes the caching mechanism so we cache both current _and_ future
broadcast messages, then manually filter out those we don't want to
display. This ensures we don't need any additional queries while still
being able to display the right messages at the right time.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36661
2017-08-21 17:58:37 +02:00
Kamil Trzciński e00e62c2c8 Merge branch 'backstage/gb/migrate-stages-statuses' into 'master'
Migrate CI/CD stages statuses

Closes #33453

See merge request !12584
2017-08-21 11:47:44 +00:00
Michael Kozono bd578d96b4 Add namespace errors from User#after_update 2017-08-18 10:31:59 -07:00
Saverio Miroddi b4622c772e Remove redundant statement part in a test suite 2017-08-18 08:30:14 +02:00
Saverio Miroddi c0f921606c Correct the cherry-pick message for merge commits
The list of commits must be generated from the merge request,
not from a diff of the branches.
2017-08-17 22:38:47 +02:00
Michael Kozono 82bafd002d Make username update fail if namespace part fails 2017-08-17 13:18:02 -07:00
Douwe Maan 91d3e6d901 Merge branch 'ee-2628-backport-to-ce' into 'master'
Backports EE mirror stuck handling feature…

See merge request !13627
2017-08-17 13:53:39 +00:00
Tiago Botelho f865b1b459 Backports EE mirror stuck handling feature (https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2628) to CE 2017-08-17 13:38:05 +01:00
Douwe Maan 834f1b30d5 Merge branch 'master' into issue-discussions-refactor
# Conflicts:
#	package.json
#	spec/support/features/reportable_note_shared_examples.rb
2017-08-17 14:01:31 +02:00
Nick Thomas c9856e53ea Run remove_pages in a run_after_commit block 2017-08-17 11:44:09 +01:00
Nick Thomas 0de85b5319 Remove a wat in NamespacelessProjectDestroyWorker 2017-08-17 11:30:07 +01:00
Grzegorz Bizon 1066d8ba77 Use usual method to retrieve CI/CD stage statuses 2017-08-16 13:30:49 +02:00
Rémy Coutable fcce6c3168 Merge branch 'rs-more-public-send-whitelists' into 'master'
Whitelist or fix additional `Gitlab/PublicSend` cop violations

See merge request !13467
2017-08-16 11:25:26 +00:00
Saverio Miroddi 919c0c7ba7 Extended UTs for the new cherry-pick message format 2017-08-16 13:18:07 +02:00
Grzegorz Bizon 32d0983a4e Merge branch 'master' into backstage/gb/migrate-stages-statuses
* master: (1000 commits)
  Fix username autocomplete group name with no avatar alignment
  Fix 'Projected tags' typo in protected_tags_spec.rb
  Many Repo Fixes
  Repo Editor Fixes
  Docs: New index for permissions
  link article from CI index
  link tech articles from the landing page
  new articles come first
  fix relative link
  fix date format
  Fixed changed files dropdown not being shown
  Update publication date
  Remove deprecated field from workhorse API responses
  Fix API responses when dealing with txt files
  Make sure MySQL would not use CURRENT_TIMESTAMP
  Add two more project templates
  Allow usage of any_projects? with an Array
  Copyedit Artifactory and GitLab article
  Rename Artifactory and GitLab article file
  Display GPG status loading spinner only when Ajax request is made
  ...
2017-08-16 13:18:03 +02:00
Rémy Coutable 1b46a8360e Merge branch '34643-fix-project-path-slugify' into 'master'
Fix CI_PROJECT_PATH_SLUG slugify

Closes #34643

See merge request !13350
2017-08-16 10:10:24 +00:00
Douwe Maan e645ab2233 Merge branch 'forks-count-cache' into 'master'
Cache the number of forks of a project

See merge request !13535
2017-08-15 08:13:01 +00:00
Douwe Maan ef0e3c8e20 Merge branch '34533-speed-up-group-project-authorizations' into 'master'
Speed up Group#user_ids_for_project_authorizations

Closes #36182

See merge request !13508
2017-08-15 08:06:37 +00:00
vanadium23 e99444bb2d Fix CI_PROJECT_PATH_SLUG slugify 2017-08-15 08:22:56 +03:00
Robert Speicher 260c8da060 Whitelist or fix additional `Gitlab/PublicSend` cop violations
An upcoming update to rubocop-gitlab-security added additional
violations.
2017-08-14 12:14:11 -04:00
Yorick Peterse aef9f1eb94
Cache the number of forks of a project
The number of forks of a project doesn't change very frequently and
running a COUNT(*) every time this information is requested can be quite
expensive. We also end up running such a COUNT(*) query at least twice
on the homepage of a project.

By caching this data and refreshing it when necessary we can reduce
project homepage loading times by around 60 milliseconds (based on the
timings of https://gitlab.com/gitlab-org/gitlab-ce).
2017-08-14 18:00:28 +02:00
Nick Thomas d7b03c37f8 Speed up Group#user_ids_for_project_authorizations 2017-08-14 12:47:15 +01:00
Lin Jen-Shin 349db4802b Merge remote-tracking branch 'upstream/master' into 36089-handle-ref-failure-better
* upstream/master: (47 commits)
  Update CHANGELOG.md for 9.4.5
  Update charlock_holmes
  add a changelog entry
  switch to multi-line before block
  restructure the #new_key notification spec
  don't send devise notifications to the ghost user
  reset_delivered_emails before testing #new_key
  skip the :read_project check for new_project_member
  move the member spec to be with the other ones
  add a spec for new_group_member
  add a spec for never emailing the ghost user
  rubocop fix
  a membership with no user is always notifiable
  check notifiability for more emails
  add Member#notifiable?(type, opts)
  make NotificationRecipient a little more customizable
  Add notes about database performance for MySQL
  fix confidential border issue as well as confidential styles leaking on new MR
  Migrate force push check to Gitaly
  Add option to disable project export on instance
  ...
2017-08-14 19:33:35 +08:00
haseeb f2251d1978 fixes failing tests for full reference change 2017-08-13 18:09:30 +05:30
Filipa Lacerda e93214bce6 Merge branch 'master' into issue-discussions-refactor
* master: (66 commits)
  fix confidential border issue as well as confidential styles leaking on new MR
  Migrate force push check to Gitaly
  Add option to disable project export on instance
  Better categorize test coverage results
  Add option to disable project export on instance - db changes
  Better caching and indexing of broadcast messages
  Include the `is_admin` field in the `GET /users/:id` API when current user is an admin
  Document rspec-retry and rspec-flaky
  Fix cop description
  Retrieve and sync flaky specs report from and to S3
  Use a new RspecFlakyListener to detect flaky specs
  Fix formatting of patch_versions.md [skip ci]
  Enable Timecop safe mode
  Show error message for API 500 error in tests, and
  Fix merge request diff deserialisation when too_large was absent
  Delete correct key from `session` after authenticating using U2F
  Bumps omniauth-ldap gem version to 2.0.4
  Pending delete projects no longer return 500 error in Admins projects view
  Do not run the `ee_compat_check` job for stableish branches
  Update gitlab.po: Missing 'r' in "Fouché" that comes from "Fourcher" verb.
  ...
2017-08-12 00:17:48 +01:00
Robert Speicher 5896d1b1e6 Merge branch '32004-use-timecop-safe-mode' into 'master'
Enable Timecop safe mode

Closes #32004

See merge request !13498
2017-08-11 16:59:37 +00:00
Yorick Peterse a5c8a52782
Better caching and indexing of broadcast messages
Caching of BroadcastMessage instances has been changed so a cache stays
valid as long as the default cache expiration time permits, instead of
the cache being expired after 1 minute. When modifying broadcast
messages the cache is flushed automatically.

To remove the need for performing sequence scans on the
"broadcast_messages" table we also add an index on (starts_at, ends_at,
id), permitting PostgreSQL to use an index scan to get all necessary
data.

Finally this commit adds a few NOT NULL constraints to the table to
match the Rails validations.

Fixes gitlab-org/gitlab-ce#31706
2017-08-11 16:43:30 +02:00
Sean McGivern e80a893ff0 Merge branch 'split-events-into-push-events' into 'master'
Use a separate table for storing push events

See merge request !12463
2017-08-11 14:40:03 +00:00
Sean McGivern 9c11894a65 Merge branch 'appearances-caching-and-schema' into 'master'
Cache Appearance instances in Redis

Closes #36066 and #31698

See merge request !13433
2017-08-11 14:39:26 +00:00
Rémy Coutable 1b413bd62f Enable Timecop safe mode
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-11 14:53:17 +02:00
Lin Jen-Shin 3b0dcbf235 Merge remote-tracking branch 'upstream/master' into 36089-handle-ref-failure-better
* upstream/master:
  Fix merge request diff deserialisation when too_large was absent
  Bumps omniauth-ldap gem version to 2.0.4
  Remove an unnecessary `let` in spec/features/projects/user_edits_files_spec.rb
  Remove documentation about rules that are now enforced by RuboCop
  Enable the RSpec/HookArgument cop and auto-correct offenses
2017-08-11 20:30:14 +08:00
Lin Jen-Shin e04c1ae7c7 Merge remote-tracking branch 'upstream/master' into 36089-handle-ref-failure-better
* upstream/master: (62 commits)
  Update gitlab.po: Missing 'r' in "Fouché" that comes from "Fourcher" verb.
  Docs: update user docs index
  Fix minor typos in views
  Fix Layout/SpaceBeforeBlockBraces violation in bin/changelog_spec
  Merge branch 'rs-alphanumeric-ssh-params' into 'security-9-4'
  Merge branch 'import-symlinks-9-3' into 'security-9-3'
  Fix wrong method call on prometheus histogram
  Document new all-in-one Helm chart - docs
  Fix 404 on link path
  Fix line numbers not matching up to code in code viewer.
  Hide overflow-x on collapsed sidebar
  removed global use of breakpoint checker
  Increase performance of the breakpoint size checker
  Filter sensitive query string parameters from NGINX access logs
  Added a template for database changes
  Render new issue link in failed job as a regular link instead of a UJS one
  Include RE2 in the upgrade docs
  Remove affix plugin from issuable sidebar with new navigation
  Fix linter error
  alternative route for download archive
  ...
2017-08-11 19:15:35 +08:00
Robert Speicher c8b802471b Enable the RSpec/HookArgument cop and auto-correct offenses 2017-08-10 19:29:42 -04:00
Yorick Peterse aac1de46c9
Use a specialized class for querying events
This changes various controllers to use the new EventCollection class
for retrieving events. This class uses a JOIN LATERAL query on
PostgreSQL to retrieve queries in a more efficient way, while falling
back to a simpler / less efficient query for MySQL.

The EventCollection class also includes a limit on the number of events
to display to prevent malicious users from cycling through all events,
as doing so could put a lot of pressure on the database.

JOIN LATERAL is only supported on PostgreSQL starting with version 9.3.0
and as such this optimisation is only used when using PostgreSQL 9.3 or
newer.
2017-08-10 17:45:49 +02:00
Yorick Peterse 0395c47193
Migrate events into a new format
This commit migrates events data in such a way that push events are
stored much more efficiently. This is done by creating a shadow table
called "events_for_migration", and a table called "push_event_payloads"
which is used for storing push data of push events. The background
migration in this commit will copy events from the "events" table into
the "events_for_migration" table, push events in will also have a row
created in "push_event_payloads".

This approach allows us to reclaim space in the next release by simply
swapping the "events" and "events_for_migration" tables, then dropping
the old events (now "events_for_migration") table.

The new table structure is also optimised for storage space, and does
not include the unused "title" column nor the "data" column (since this
data is moved to "push_event_payloads").

== Newly Created Events

Newly created events are inserted into both "events" and
"events_for_migration", both using the exact same primary key value. The
table "push_event_payloads" in turn has a foreign key to the _shadow_
table. This removes the need for recreating and validating the foreign
key after swapping the tables. Since the shadow table also has a foreign
key to "projects.id" we also don't have to worry about orphaned rows.

This approach however does require some additional storage as we're
duplicating a portion of the events data for at least 1 release. The
exact amount is hard to estimate, but for GitLab.com this is expected to
be between 10 and 20 GB at most. The background migration in this commit
deliberately does _not_ update the "events" table as doing so would put
a lot of pressure on PostgreSQL's auto vacuuming system.

== Supporting Both Old And New Events

Application code has also been adjusted to support push events using
both the old and new data formats. This is done by creating a PushEvent
class which extends the regular Event class. Using Rails' Single Table
Inheritance system we can ensure the right class is used for the right
data, which in this case is based on the value of `events.action`. To
support displaying old and new data at the same time the PushEvent class
re-defines a few methods of the Event class, falling back to their
original implementations for push events in the old format.

Once all existing events have been migrated the various push event
related methods can be removed from the Event model, and the calls to
`super` can be removed from the methods in the PushEvent model.

The UI and event atom feed have also been slightly changed to better
handle this new setup, fortunately only a few changes were necessary to
make this work.

== API Changes

The API only displays push data of events in the new format. Supporting
both formats in the API is a bit more difficult compared to the UI.
Since the old push data was not really well documented (apart from one
example that used an incorrect "action" nmae) I decided that supporting
both was not worth the effort, especially since events will be migrated
in a few days _and_ new events are created in the correct format.
2017-08-10 17:45:44 +02:00
Sean McGivern 4c7ada21c0 Merge branch 'mk-fix-case-insensitive-redirect-matching' into 'master'
Fix conflicting redirect search

See merge request !13357
2017-08-10 11:09:08 +00:00
Yorick Peterse 26bb50412c
Cache Appearance instances in Redis
This caches the result of Appearance.first in a similar fashion to how
ApplicationSetting instances are cached. We also add some NOT NULL
constraints to the table and correct the timestamp types.

Fixes gitlab-org/gitlab-ce#36066, fixes gitlab-org/gitlab-ce#31698
2017-08-10 12:45:49 +02:00
Filipa Lacerda fbf241e8ae Merge branch 'master' into issue-discussions-refactor
* master: (42 commits)
  alternative route for download archive
  Add missing command to compile GetText files
  Prevent user from changing username with container registry tags
  Rename RPC 'Exists' to 'RepositoryExists'
  Fix the sticky changes bar on commits page
  Fix ee_compat_check when EE branch uses a prefix
  Removed display styles when hiding the fly out navigation
  Explain why we use select all for project_url_constrainer.rb
  Fix pikaday being undefined
  Add a helper to stub storage settings with defaults
  Enable the Layout/SpaceBeforeBlockBraces cop
  update Install from Source instructions
  Translations can be picked without asking for exceptions
  Ask for exceptions in advance
  Don't require stackprof in Gemfile
  Synchronous Korean translation in zanata
  Use full path of user's avatar in webhooks
  Update icon color on hover
  Align all nav items in sidebar
  Fix height of collapsed sidebar items
  ...
2017-08-10 11:12:22 +01:00
Michael Kozono 255be6c5ca Prevent user from changing username with container registry tags 2017-08-09 16:24:49 +00:00
Michael Kozono 3d58e30b6b Fix style 2017-08-09 08:11:08 -07:00
Lin Jen-Shin 029fb98b02 Detect if we didn't create the ref sooner 2017-08-09 18:41:20 +08:00
Rémy Coutable c946ee1282
Enable the Layout/SpaceBeforeBlockBraces cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-09 11:52:22 +02:00
Michael Kozono fccd64bb6a Fix conflicting redirect search 2017-08-08 10:30:07 -07:00
Rémy Coutable 143b5293b0 Merge branch '36010-api-v4-allows-setting-a-branch-that-doesn-t-exist-as-the-default-one' into 'master'
Resolve "API v4 allows setting a branch that doesn't exist as the default one"

Closes #36010

See merge request !13359
2017-08-08 15:16:54 +00:00
Filipa Lacerda 23334ac0a1 Merge branch 'master' into issue-discussions-refactor
* master: (481 commits)
  Make sure that we have author and committer
  disable file upload button while uploading
  Fix bar chart does not display label at hour 0
  Fixed activity not loading on project homepage
  Expose noteable_iid in Note
  Fix fly-out width when it has long items
  Add a test to show that threshold 40 would corrupt
  Add changelog entry
  Raise encoding confidence threshold to 50
  Fix the /projects/:id/repository/commits endpoint to handle dots in the ref name when the project full path contains a `/`
  Fix the /projects/:id/repository/tags endpoint to handle dots in the tag name when the project full path contains a `/`
  Add Italian translations of Pipeline Schedules
  Restrict InlineJavaScript for haml_lint to dev and test environment
  Incorporate Gitaly's CommitService.FindCommit RPC
  Move `deltas` and `diff_from_parents` logic to Gitlab::Git::Commit
  fix repo_edit_button_spec.js
  fix test failures in repo_preview_spec.js
  fix repo_loading_file_spec tests
  Refactor Gitlab::Git::Commit to include a repository
  use 100vh instead of flip flopping between the two - works on all suported browsers
  ...
2017-08-08 16:15:16 +01:00
Dmitriy Zaporozhets 1439115183 Merge branch 'gitaly-find-commit' into 'master'
Incorporate Gitaly's CommitService.FindCommit RPC

Closes gitaly#402

See merge request !13094
2017-08-08 14:27:22 +00:00
Alejandro Rodríguez 3ce6f03f14 Incorporate Gitaly's CommitService.FindCommit RPC 2017-08-07 23:33:43 -04:00
Alejandro Rodríguez c21ae07e33 Refactor Gitlab::Git::Commit to include a repository 2017-08-07 22:34:34 -04:00
Stan Hu fd40bce9cc Merge branch '31207-clean-locked-merge-requests' into 'master'
Resolve "Store MergeWorker JID on merge request, and clean up stuck merges"

Closes #31207

See merge request !13207
2017-08-08 01:47:48 +00:00
blackst0ne 98535fc12c Add checks for branch existence before changing HEAD 2017-08-08 12:10:55 +11:00
Robert Speicher 475f41acd4 Merge branch 'feature/migrate-find-commits-by-message-to-gitaly' into 'master'
Migrate Repository#find_commits_by_message to Gitaly

Closes gitaly#443

See merge request !13268
2017-08-07 21:33:45 +00:00
Sean McGivern c94990820a Merge branch '32844-issuables-performance' into 'master'
Issuables: Move some code from create services to Sidekiq workers

See merge request !13326
2017-08-07 21:21:29 +00:00
Sean McGivern 5f30350c5b Merge branch '35761-convdev-perc' into 'master'
Store & use ConvDev percentages returned by Version app

Closes #35761

See merge request !13217
2017-08-07 20:25:32 +00:00
Sean McGivern f9c6ff7508 Merge branch 'backport-ee-2251' into 'master'
Backport changes in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2551 to CE

Closes #21391

See merge request !13275
2017-08-07 20:04:21 +00:00
Robert Speicher 4e2b630df7 Merge branch 'group-milestone-references-system-notes' into 'master'
Support group milestone references

Closes #34778

See merge request !13289
2017-08-07 19:22:41 +00:00
Jarka Kadlecova 0f9bde41fc Store & use ConvDev percentages returned by Version app 2017-08-07 20:52:08 +02:00
Oswaldo Ferreira 0640b3d1d8 Store MergeWorker JID on merge request, and clean up stuck merges 2017-08-07 15:23:37 -03:00
Nick Thomas da5262f4e6 Backport changes in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2551 to CE 2017-08-07 19:17:11 +01:00
Ahmad Sherif c0b41064ff Migrate Repository#find_commits_by_message to Gitaly
Closes gitaly#443
2017-08-07 18:57:06 +02:00
Robert Speicher f8d34ab5ab Merge branch 'wiki_title' into 'master'
add feature rename wiki title

Closes #27800

See merge request !10069
2017-08-07 16:37:44 +00:00
Sean McGivern 8c4d590973 Merge branch 'dashboard-projects-controller-query-performance' into 'master'
Improve various parts of Dashboard::ProjectsController

See merge request !13319
2017-08-07 15:06:12 +00:00
Jarka Kadlecova 9ef3c431e4 Move some after_create parts to worker to improve performance 2017-08-07 15:57:56 +02:00
Bob Van Landuyt faabcbd3ae GRPC::Unavailable (< GRPC::BadStatus) is wrapped in a CommandError 2017-08-07 14:37:01 +02:00
Sean McGivern 149528f472 Support references to group milestones
Group milestones can only be referred to by name, not IID. They also do not
support cross-project references.
2017-08-07 11:55:00 +01:00
Yorick Peterse ab738645a7
Memoize a user's personal projects count
The method User#projects_limit_left would run "personal_projects.count"
but such a query is not memoized. As a result multiple calls to
User#projects_limit_left would result in multiple COUNT(*) queries being
executed.

To work around this this commit adds User#personal_projects_count which
simply memoizes the result of the COUNT(*) in an instance variable.
2017-08-07 12:38:32 +02:00
Douwe Maan 727b6d16e5 Merge branch 'master' into 'bvl-nfs-circuitbreaker'
# Conflicts:
#   app/models/repository.rb
#   spec/models/repository_spec.rb
2017-08-07 09:13:10 +00:00
Filipa Lacerda e4f8aa719b Merge branch 'master' into issue-discussions-refactor
* master: (162 commits)
  Since mysql is not a priority anymore, test it less
  Add container registry and spam logs icons
  Fix different Markdown styles
  Backport to CE for:
  Make new dropdown dividers full width
  Bump GITLAB_SHELL_VERSION and GITALY_VERSION to support unhiding refs
  Install yarn via apt in update guides
  Use long curl options
  Remove monkey-patched Array.prototype.first() and last() methods
  Openshift Getting Started
  35659 Rename Pipelines tab to CI / CD in new navigation
  Don't bother going through an entire Banzai pipeline for empty text
  Add active state for pipelines settings on old nav
  Bump rspec to 3.6.0
  Resolve "Specific Async Script Loading by using a Page Variable"
  Revert "Merge branch 'rs-warm-capybara-only-in-ci' into 'master'"
  another rubocop style fix
  Use mixin for new dropdown style
  Migrate Repository#last_commit_for_path to Gitaly
  Migrate blame loading to Gitaly
  ...
2017-08-04 19:38:37 +01:00
Robert Speicher e299d595c7 Merge branch 'feature/migrate-last-commit-for-path-to-gitaly' into 'master'
Migrate Repository#last_commit_for_path to Gitaly

Closes gitaly#433

See merge request !13200
2017-08-04 15:46:36 +00:00
Bob Van Landuyt 3598e60bf2 Add a Circuitbreaker for storage paths 2017-08-04 15:38:48 +02:00
Rémy Coutable 40bdbfb096 Merge branch 'fix-jira-integration' into 'master'
Ensure `JIRA::Resource::Issue` responds to `resolution` before calling it

See merge request !13240
2017-08-04 09:41:50 +00:00
Ahmad Sherif f81c07eacc Migrate Repository#last_commit_for_path to Gitaly
Closes gitaly#433
2017-08-03 19:26:46 +02:00
Rémy Coutable 29f1fa8250 Merge branch 'use-rspec-support-helper' into 'master'
Don't include EmailHelpers manually, pick with rspec

See merge request !13257
2017-08-03 16:42:02 +00:00
haseeb ae99f05b05 fix #35133 strip new lines from ssh keys 2017-08-03 16:39:10 +00:00
Lin Jen-Shin bb5f79d43e Don't include EmailHelpers manually, pick with rspec
`:mailer` is needed to pick it easily, while
`type: :mailer` is needed for picking it automatically for
tests located in spec/mailers/*_spec.rb

It's a bit complicated in spec/services/notification_service_spec.rb
but we'll leave it alone for now.
2017-08-03 21:55:48 +08:00
Mehdi Lahmam 03d199fb10 Ensure `JIRA::Resource::Issue` responds to `resolution` before calling it 2017-08-03 15:25:47 +02:00
wendy0402 29be4e0f58 Allow wiki pages to be renamed in the UI 2017-08-03 07:38:11 +07:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Robert Speicher 9513bd18c4 Ensure all project factories use `:repository` trait or `:empty_project` 2017-08-01 14:51:52 -04:00
Filipa Lacerda 335d4a535f Merge branch 'master' into issue-discussions-refactor
* master: (76 commits)
  Add code review guidelines related to Build [CI skip].
  Make time span dropdown style on cycle analytics page consistent
  Add 204. Remove duplicated method.
  Make sure we didn't commit conflicts
  Fix bug in blob test
  Always fetch branches before finding the merge base, otherwise we could find an outdated merge base
  Fixes dropdown margin in sidebar
  Docs add blog articles
  Inline script cleanup globals and easy
  Add option to use CommitLanguages RPC
  CI fixes for gitaly-ruby
  fix
  Allow logged in users to read user list under public restriction
  Small refactor in LegacyNamespace and moved back send_update_instructions
  Rename ensure_dir_exist -> ensure_storage_path_exist
  Added some extra TODOs for the Legacy Storage refactor
  Make disk_path keyword argument and optional
  Rename more path_with_namespace -> full_path or disk_path
  Rename path_with_namespace -> disk_path when dealing with the filesystem
  Rename many path_with_namespace -> full_path
  ...
2017-08-01 17:45:20 +01:00
Douwe Maan 4c77c30fbf Merge branch '33620-remove-events-from-notification_settings' into 'master'
Resolve "Remove `events` from `notification_settings`"

Closes #33620

See merge request !13152
2017-08-01 14:54:56 +00:00
Sean McGivern 90cb2aab38 Merge branch '28283-legacy-storage-format' into 'master'
[CE] Added Legacy Storage format

See merge request !13149
2017-08-01 12:24:24 +00:00
Gabriel Mazetto fb06a4d8fe Rename more path_with_namespace -> full_path or disk_path 2017-08-01 07:28:13 +02:00
Gabriel Mazetto c6dee99803 Rename path_with_namespace -> disk_path when dealing with the filesystem 2017-08-01 07:26:58 +02:00
Gabriel Mazetto abb878326c Rename many path_with_namespace -> full_path 2017-08-01 07:26:58 +02:00
Sean McGivern 57a5544f88 Remove events column from notification settings
This was migrated to separate columns in 9.4, and now just needs to be removed
for real.
2017-07-31 11:18:55 +01:00
Grzegorz Bizon 8f1274ae03 Merge commit '9a3b283402b8cc1c86802c526f19a459ce09c2e3' into backstage/gb/migrate-stages-statuses
* commit '9a3b283402b8cc1c86802c526f19a459ce09c2e3': (270 commits)
  Add a note about EFS and GitLab log files
  Projects logo are not centered vertically on projects page
  Fix spec/features/projects/branches_spec
  Fixup POST /v3/:id/hooks and PUT /v3/:id/hooks/:hook_id
  Fix a spec that was assuming to be on the wrong page
  Add copy about search terms to ux guide
  Update documentation of user creation by replacing the 'confirm' param with 'skip_confirmation'
  Fix replying to commit comments on MRs from forks
  Fix 500 error when rendering avatar for deleted project creator
  Load and process at most 100 commits when pushing into default branch
  Ensure Gitlab::Application.routes.default_url_options are set correctly in Capybara + :js specs
  Add log messages to clarify log messages about API CSRF token verification failure
  Update gitlab_flow.md, Teatro seems to be completely dead, see also https://forum.gitlab.com/t/gitlab-flow-documentation-teatro/7774
  Fix diff commenting results just after changing view
  Update CHANGELOG.md for 9.4.2
  none is not a CSS Value for sizes ;-)
  Merge issuable "reopened" state into "opened"
  Make access level more compatible with EE
  Add link to JIRA article in docs
  Expand pipeline_trigger_service_spec by godfat request
  ...
2017-07-31 10:50:10 +02:00
Douwe Maan 95f9d6d83b Merge branch 'master' into issue-discussions-refactor
# Conflicts:
#	app/controllers/concerns/notes_actions.rb
#	spec/features/task_lists_spec.rb
#	spec/support/features/issuable_slash_commands_shared_examples.rb
2017-07-31 10:23:50 +02:00
Michael Kozono f5fc912b33 Exclude keys linked to other projects 2017-07-28 14:48:39 -07:00
Rémy Coutable 60797a42b4 Ensure Gitlab::Application.routes.default_url_options are set correctly in Capybara + :js specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-28 16:33:30 +02:00
Shinya Maeda 1ad4efe64e fix merge miss 2017-07-28 18:13:29 +09:00
Shinya Maeda 56418e85ac init 2017-07-28 18:13:29 +09:00
Sean McGivern fa4d08ed81 Merge branch '32483-jira-error' into 'master'
Display specific error message when JIRA test fails

Closes #32483

See merge request !13100
2017-07-28 07:21:04 +00:00
Robert Speicher 64131f04e1 Merge branch '1827-prevent-concurrent-editing-wiki' into 'master'
Prevent concurrent editing wiki

Closes #1827

See merge request !9707
2017-07-27 19:29:25 +00:00
Dmitriy Zaporozhets ac0cbe6970 Merge branch 'feature/gpg-signed-commits' into 'master'
GPG signed commits

Closes #20268

See merge request !9546
2017-07-27 15:29:39 +00:00
Alexis Reigel f1ccecc997 improve gpg key validation
when omitting the end part of the key ('-----END PGP PUBLIC KEY
BLOCK-----') the error message was not about the key anymore, but about
the missing fingerprint and primary_keyid, which was confusing for the
user.
the new validation checks that the end also matches the expected format.
2017-07-27 15:46:04 +02:00
Alexis Reigel fef030c23d validate the foreign_key instead of the relation 2017-07-27 15:46:04 +02:00