Commit Graph

739 Commits

Author SHA1 Message Date
Stan Hu 10096256f1 Improve performance of filtering notes in NotesController
Reduces the number of queries needed to redact notes to which
the user does not have access. Also includes an N+1 query test
as a guard against future issues.

This is a follow-up from https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14327#note_40976854.
2017-10-02 21:48:34 -07:00
Grzegorz Bizon 10aeb81e8f Merge branch 'zj-update-project-settings' into 'master'
Allow updating of project auto devops settings

Closes #37893

See merge request gitlab-org/gitlab-ce!14291
2017-09-19 06:58:51 +00:00
Stan Hu 8690ca5c28 Eliminate N+1 queries in loading discussions.json endpoint
In #37955,we see that the profile had a number of N+1 queries from repeated
access to `cross_reference_not_visible_for?`. This was optimized in previous
versions of GitLab by rendering all notes at once, counting the number of
visible references, and then using that number to check whether a system note
should be fully redacted.

There was also another N+1 query calling `ProjectTeam#member?`, which did not
take advantage of an optimization in prepare_notes_for_rendering that would
preload the maximum access level per project.

Closes #37955
2017-09-18 06:53:33 -07:00
Zeger-Jan van de Weg cf851ce559
Fix instance default option being true as value
When a user selected 'Instance default' as value for the auto devops
settings, this was interpreted as a true value. Now we post an empty
string in this case, meaning we want to set `NULL` in the database.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/37893#note_40541294
2017-09-18 12:02:47 +02:00
Zeger-Jan van de Weg fb84bec542
Allow updating of project auto devops settings
Updating didn't work, as the project_id was missing to be set for the
project_auto_devops model.

Fixes gitlab-org/gitlab-ce#37893
2017-09-15 09:53:31 +02:00
Micael Bergeron a31e0aff22 Resolve "Error 500 in non-UTF8 branch names" 2017-09-12 14:07:31 +00:00
Sean McGivern b4778a5866 Merge branch 'ee_issue_928_backport' into 'master'
Group boards CE backport

See merge request !13883
2017-09-07 13:42:23 +00: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
micael.bergeron 65bcd141c8 add controller spec
also fix some code styling issues
2017-09-06 09:00:57 -04:00
Grzegorz Bizon deaa7f54e0 Fix artifacts controller specs 2017-09-06 14:27:42 +02:00
Simon Knox b9aa55e1ea Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into ee_issue_928_backport 2017-09-06 14:35:58 +10:00
Eric Eastwood 90c60138db Move "Move to different project" to sidebar
Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/34261
2017-09-03 22:03:17 -05:00
Felipe Artur 8077b728bc Continue BE backport 2017-08-31 14:48:57 -03:00
Douwe Maan 92edb3edab Merge branch 'master' into issue-discussions-refactor
# Conflicts:
#	app/models/issue.rb
2017-08-31 18:02:19 +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
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 a540f55c6e Fix specs 2017-08-30 10:43:10 +02:00
Douwe Maan b181d3124e Merge branch 'master' into issue-discussions-refactor
# Conflicts:
#	app/models/issue.rb
2017-08-30 10:14:56 +02:00
Maxim Rydkin fa030cbc85 replace `is_spam?` with `spam?` 2017-08-29 11:14:42 +03:00
Robert Speicher df677647b8 Merge branch 'sh-add-spec-to-protected-tags-deletion' into 'master'
Add spec for deleting protected tags

See merge request !13693
2017-08-28 17:18:30 +00:00
Douwe Maan fbe82e4cd9 Merge branch 'master' into issue-discussions-refactor
# Conflicts:
#	package.json
2017-08-23 11:31:17 +02:00
Rubén Dávila e6880ebc7d Fix inability to test some project integrations 2017-08-22 11:05:02 -05:00
Stan Hu 2ec7cfc91d Add spec for deleting protected tags 2017-08-20 04:35:06 -07: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
Jarka Kadlecova b67e333ce8 fix static_analysis (rubocop) 2017-08-14 07:15:52 +02:00
Jarka Kadlecova d78037c246 Use UserNoteEntity instead of UserEntity for notes 2017-08-11 18:48:06 +02:00
Lin Jen-Shin 501be36c2e Just use the repo. Not sure why master could pass
It keeps giving me no repo error from setting up autocrlf,
which shouldn't have anything to do with this merge request.
2017-08-11 20:10:43 +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
Lin Jen-Shin ae7c52a060 Fix more tests 2017-08-11 17:54:34 +08:00
Lin Jen-Shin 41a5adca75 Don't try to create diffs if one of the branch is missing
Also fix a few tests
2017-08-10 23:53:55 +08:00
Lin Jen-Shin 412db1874f Fix some tests and report the error message 2017-08-09 21:41:45 +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
Mike Greiling 7767ceef47 Merge branch 'master' into ide
* master: (177 commits)
  Add changelog
  Bump gitlab-shell version to 5.8.0 to fix Git for Windows 2.14
  Make contextual sidebar collapsible
  Fixed sidebar context header hover colors
  Use correct `Environment`-class within `Gitlab` namespace
  Remove gl.Activities from Commits page
  Move `let` calls inside the `describe` block using them
  Add `/assign me` alias support for assigning issuables to oneself
  GRPC::Unavailable (< GRPC::BadStatus) is wrapped in a CommandError
  Use `broken_storage` in the fs_shards_spec.
  Eager load project creators for project dashboards
  Memoize a user's personal projects count
  Remove redundant query from User#recent_push
  Improve checking if projects would be returned
  Change spelling of gitlab-shell
  Remove unused #tree-holder
  Add custom linter for inline JavaScript to haml_lint
  Rename user_can_admin? because it's more accurate
  Synchronous zanata community contribution translation
  Add Korean translation to i18n
  ...
2017-08-07 15:20:09 -05:00
Luke "Jared" Bennett 91a6074348
Fix blob_controller_spec plain to raw_path 2017-08-04 13:45:44 +01:00
haseeb 4974f1ef86 fix #3686 make tarball download url to end with extension 2017-08-03 16:44:48 +00:00
Douwe Maan 2197ee02e9 Merge branch 'master' into ide 2017-08-03 13:13:06 +02:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Rémy Coutable db17b3c7cd Merge branch 'rs-issuables-list-metadata-shared-examples' into 'master'
Make the 'issuables list meta-data' shared example less dangerous

See merge request !13236
2017-08-02 09:46:11 +00:00
Robert Speicher 9513bd18c4 Ensure all project factories use `:repository` trait or `:empty_project` 2017-08-01 14:51:52 -04:00
Robert Speicher 939e9bdde1 Make the 'issuables list meta-data' shared example less dangerous
This shared example would take an object's database ID and create a
number of objects based on it. If for some reason the ID were a high
number, like 20, this would create `20 + 21 + 22` objects.

Not only was this dangerous from a performance perspective, it was
entirely unnecessary, as the behavior it was testing is already
well-tested in the unit test for the underlying object. For a controller
test, which is what's including this shared example, all we need to do
is verify that the assigned object contains the correct `id => object`
Hash, which is what we now test for.
2017-08-01 12:55:57 -04: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
Jacob Vosmaer 67de82cf5f Add option to use CommitLanguages RPC 2017-08-01 10:48:46 +02:00
Gabriel Mazetto abb878326c Rename many path_with_namespace -> full_path 2017-08-01 07:26:58 +02:00
Luke "Jared" Bennett 0ac012f0ad
Merge remote-tracking branch 'origin/master' into ide 2017-07-31 17:24:13 +01:00
Sean McGivern 75d04f6a29 Fix replying to commit comments on MRs from forks
A commit comment shows in the MR, but if the MR is from a fork, it will have a
different project ID to the MR's target project. In that case, add an
note_project_id param so that we can pick the correct project for the note.
2017-07-28 16:25:13 +01:00
Luke "Jared" Bennett dc04fdc1a3
Merge remote-tracking branch 'origin/master' into ide 2017-07-28 15:26:00 +01:00
Kamil Trzciński ac948684fc Merge branch '30634-protected-pipeline' into 'master'
Implement "Block pipelines on protected branches"

Closes #30634, #34616, and #33130

See merge request !11910
2017-07-25 15:04:23 +00:00
Rémy Coutable e43bda0ebb Merge branch 'dz-update-shoulda' into 'master'
Update shoulda-matchers gem to 3.1.2

See merge request !13040
2017-07-25 08:08:26 +00:00
Dmitriy Zaporozhets eafb03cfd5
Remove unnecessary set_flash.now from controller specs
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-07-24 15:21:16 +03:00
Jarka Kadlecova 2fa22a0729 Associate Issues tab only with internal issues tracker 2017-07-24 08:10:14 +02:00