summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' into feature/svg-badge-templateGrzegorz Bizon2016-08-0914-114/+83
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (52 commits) remove offending empty line Namespace EnableDeployKeyService under Projects Update version_sorter and use new interface for faster tag sorting Avoid to show the original password field when password is automatically seted Support pending invitation project members importing projects Added concern for a faster "cache_key" method Update templates "This file is managed by gitlab-ctl. Manual changes will be erased!" Remove legacy Ci::StaticModel we do not use anymore Revert "Defend against 'Host' header injection" Simplify feature introduction note Add migration-related tips to the "Merge Request Guidelines" doc Enable Style/SpaceAroundEqualsInParameterDefault cop Enable Style/EmptyLinesAroundClassBody cop Enable Style/EmptyLinesAroundModuleBody cop Ensure we are looking for the right dropdown inside the form wrapper Set for for labels and ID for dropdowns on create form Fix .panel-title style Refine selector for form submit button Fix spelling. `braches` to `branches` ...
| * Merge branch 'fix/remove-legacy-ci-static-model' into 'master' Robert Speicher2016-08-081-49/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove legacy Ci::StaticModel we do not use anymore ## What does this MR do? This removes class that according to our code coverage report and `grep` is a legacy and unused class. See merge request !5710
| | * Remove legacy Ci::StaticModel we do not use anymorefix/remove-legacy-ci-static-modelGrzegorz Bizon2016-08-081-49/+0
| | |
| * | Merge branch 'zj-enable-deploy-keys-api' into 'master' Douwe Maan2016-08-081-38/+66
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable/Disable Deploy keys for a project Closes #20123 ## Does this MR meet the acceptance criteria? - [X] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [X] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [X] API support added - Tests - [X] Added for this feature/bug - [X] All builds are passing See merge request !5647
| | * | Namespace EnableDeployKeyService under ProjectsZ.J. van de Weg2016-08-081-1/+2
| | | |
| | * | Create service for enabling deploy keysZ.J. van de Weg2016-08-051-3/+3
| | | |
| | * | Move deploy_key tests to deploy_key_spec.rbZ.J. van de Weg2016-08-041-5/+6
| | | | | | | | | | | | | | | | Also, fix the failing test in the process
| | * | Use Grape DSL for deploy keys endpointsZ.J. van de Weg2016-08-031-39/+34
| | | | | | | | | | | | | | | | Also a minor clean up of the post endpoint
| | * | Endpoints to enable and disable deploy keysZ.J. van de Weg2016-08-031-0/+31
| | | | | | | | | | | | | | | | Resolves #20123
| * | | Merge branch 'git-http-push-check' into 'master' Robert Speicher2016-08-081-1/+1
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stop 'git push' over HTTP early Before this change we always let users push Git data over HTTP before deciding whether to accept to push. This was different from pushing over SSH where we terminate a 'git push' early if we already know the user is not allowed to push. This change let Git over HTTP follow the same behavior as Git over SSH. We also distinguish between HTTP 404 and 403 responses when denying Git requests, depending on whether the user is allowed to know the project exists. See merge request !5639
| | * | | Stop 'git push' over HTTP earlyJacob Vosmaer2016-08-031-1/+1
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change we always let users push Git data over HTTP before deciding whether to accept to push. This was different from pushing over SSH where we terminate a 'git push' early if we already know the user is not allowed to push. This change let Git over HTTP follow the same behavior as Git over SSH. We also distinguish between HTTP 404 and 403 responses when denying Git requests, depending on whether the user is allowed to know the project exists.
| * | | Merge branch 'rubocop/EmptyLinesAroundModuleBody' into 'master' Douwe Maan2016-08-082-4/+0
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable Style/EmptyLinesAround Module/Class Body cop ## What does this MR do? Enable a new rubocop cops as discussed here: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/1877/diffs#note_13021078 ## Are there points in the code the reviewer needs to double check? May be a good idea to send a message to people to prevent `master` red because of the new cop. ## Why was this MR needed? We want to improve code style and not waste endbosses time checking style manually ## What are the relevant issue numbers? ## 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 [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) See merge request !5692
| | * | | Enable Style/EmptyLinesAroundClassBody coprubocop/EmptyLinesAroundModuleBodyGabriel Mazetto2016-08-062-2/+0
| | | | |
| | * | | Enable Style/EmptyLinesAroundModuleBody copGabriel Mazetto2016-08-061-2/+0
| | | |/ | | |/|
| * | | Merge branch 'revert-host-header-overwrite' into 'master' Douwe Maan2016-08-082-12/+2
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert "Defend against 'Host' header injection" We reverted this in omnibus but forgot to do it in the source NGINX template. See merge request !5706
| | * | | Revert "Defend against 'Host' header injection"Jacob Vosmaer2016-08-082-12/+2
| | |/ / | | | | | | | | | | | | | | | | | | | | This reverts commit 47b5b441395921e9f8e9982bb3f560e5db5a67bc. See https://gitlab.com/gitlab-org/gitlab-ce/issues/17877#note_13488047
| * | | Merge branch 'rubocop/SpaceAroundEqualsInParameterDefault' into 'master' Douwe Maan2016-08-084-4/+4
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable Style/SpaceAroundEqualsInParameterDefault cop ## What does this MR do? Enable a new rubocop cops as discussed here: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/1877#note_13529646 ## Are there points in the code the reviewer needs to double check? May be a good idea to send a message to people to prevent master red because of the new cop. ## Why was this MR needed? We want to improve code style and not waste endbosses time checking style manually ## What are the relevant issue numbers? ## 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 [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) See merge request !5693
| | * | | Enable Style/SpaceAroundEqualsInParameterDefault coprubocop/SpaceAroundEqualsInParameterDefaultGabriel Mazetto2016-08-064-4/+4
| | |/ /
| * | | Merge branch 'decode-log-postreceive-args' into 'master' Douwe Maan2016-08-081-1/+0
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Log base64-decoded PostReceive arguments The change to base64-encoding the third argument to PostReceive in gitlab-shell made our Sidekiq ArgumentsLogger a little less useful. This change adds decoded data to the log statement. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/20381 See merge request !5547
| | * | | Log base64-decoded PostReceive argumentsJacob Vosmaer2016-08-051-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change to base64-encoding the third argument to PostReceive in gitlab-shell made our Sidekiq ArgumentsLogger a little less useful. This change adds a log statement for the decoded data. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/20381
| * | | | Merge branch 'fix/import-pending-user' into 'master' Rémy Coutable2016-08-081-5/+8
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support pending invitation project members importing projects Adds support for pending invitation project members on Import/Export - previously the import would fail. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/19973 - [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 - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5683
| | * | | | Support pending invitation project members importing projectsJames Lopez2016-08-081-5/+8
| | | |/ / | | |/| |
| * | | | Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ceDmitriy Zaporozhets2016-08-081-1/+2
| |\ \ \ \ | | |/ / /
| * | | | Merge branch ↵Douwe Maan2016-08-051-0/+2
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '14898-protected-branches-developer-can-not-push-without-permission' into 'master' Developer cannot push to protected branch when project is empty or he has not been granted permission to do so This MR was created following !1979 and !1978 Closes #14898 See merge request !1980
| | * | | | changes default_branch_protection to allow devs_can_merge protection option ↵tiagonbotelho2016-08-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | aswell
* | | | | | Improve indentation in svg badge templateGrzegorz Bizon2016-08-081-1/+1
| | | | | |
* | | | | | Improve builds badge specs, remove legacy methodsGrzegorz Bizon2016-08-081-15/+6
| | | | | |
* | | | | | Merge branch 'master' into feature/svg-badge-templateGrzegorz Bizon2016-08-0876-664/+1516
|\ \ \ \ \ \ | | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (363 commits) Added changelog item for issuable form dropdowns Add 'run tests' docs from GDK Bump gitlab_git to lazy load compare commits Add examples to repository files API (!5465) Ignore URLs starting with // (!5677) Add failing test for #7032 Update timeago to shorter representation Add missing DOWNTIME constant to the AddTimestampsToMembersAgain migration Added guide about migrations and downtime Update CHANGELOG for 8.10.4 Add a data migration to fix some missing timestamps in the members table (again) Move abilities by subject class to a dedicated method Remove unnecessary empty line after css var Set consistency in list text height css Add description to text/plain emails Fix Rename `add_users_into_project` and `projects_ids` fix spec Underscore variable to camelCase using shared path for project import uploads and refactored gitlab remove export worker Structure the development documentation ...
| * | | | | Ignore URLs starting with // (!5677)winniehell2016-08-051-1/+2
| |/ / / /
| * | | | Merge branch 'master' of https://dev.gitlab.org/gitlab/gitlabhqRémy Coutable2016-08-041-1/+3
| |\ \ \ \
| | * \ \ \ Merge branch '20527-fork-commits-have-impact-on-original-project' into 'master' Rémy Coutable2016-08-041-1/+3
| | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don’t close issues on original project Closes #20527 -> https://gitlab.com/gitlab-org/gitlab-ce/issues/20527 See merge request !1981
| | | * | | | Don’t close issues on original project from a forkPaco Guzman2016-08-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Paco Guzman <pacoguzmanp@gmail.com>
| * | | | | | Merge branch ↵Rémy Coutable2016-08-042-8/+8
| |\ \ \ \ \ \ | | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '20512-fix-rename-add-users-into-project-to-add-users-to-project-and-projects-ids-to-project-ids' into 'master' Fix Rename `add_users_into_project` and `projects_ids` ## What does this MR do? Only modifies the name of a method that leaves more semantic and expressive and the name of the keywords arguments to the rails convention. ## Are there points in the code the reviewer needs to double check? Only if it has been changed at every point that is calling this method and that passing arguments. ## Why was this MR needed? To make the code more expressive. ## What are the relevant issue numbers? Closes #20512. - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - Tests - [x] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5659
| | * | | | | Fix Rename `add_users_into_project` and `projects_ids`Herminio Torres2016-08-042-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We never add things `into` projects, we just add them `to` projects. So how about we rename this to `add_users_to_project`. Rename `projects_ids` to `project_ids` by following the convention of rails.
| * | | | | | Merge branch 'fix/ha-mode-import-issue' into 'master' Rémy Coutable2016-08-041-0/+4
| |\ \ \ \ \ \ | | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix Import/Export not working in HA mode Use a shared path instead of `Tempfile` default `/tmp` so the import file is accessible by any GitLab instance. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/20506 - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - Tests - [x] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5618
| | * | | | | using shared path for project import uploads and refactored gitlab remove ↵James Lopez2016-08-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | export worker
| * | | | | | Merge branch 'syntax-highlight-filter-performance' into 'master' Rémy Coutable2016-08-041-8/+18
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve performance of SyntaxHighlightFilter ## What does this MR do? This MR improves the performance of `Banzai::Filter::SyntaxHighlightFilter`. See e9bacc6575d0002c6cab620075dea3dc7f93f100 for more information. ## Are there points in the code the reviewer needs to double check? Styling mostly. ## Why was this MR needed? Syntax highlighting is rather slow. ## What are the relevant issue numbers? #18592 ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~ - [x] ~~API support added~~ - Tests - [x] ~~Added for this feature/bug~~ - [ ] All builds are passing - [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) See merge request !5643
| | * | | | | | Improve performance of SyntaxHighlightFiltersyntax-highlight-filter-performanceYorick Peterse2016-08-031-8/+18
| | | |_|_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By using Rouge::Lexer.find instead of find_fancy() and memoizing the HTML formatter we can speed up the highlighting process by between 1.7 and 1.8 times (at least when measured using synthetic benchmarks). To measure this I used the following benchmark: require 'benchmark/ips' input = '' Dir['./app/controllers/**/*.rb'].each do |controller| input << <<-EOF <pre><code class="ruby">#{File.read(controller).strip}</code></pre> EOF end document = Nokogiri::HTML.fragment(input) filter = Banzai::Filter::SyntaxHighlightFilter.new(document) puts "Input size: #{(input.bytesize.to_f / 1024).round(2)} KB" Benchmark.ips do |bench| bench.report 'call' do filter.call end end This benchmark produces 250 KB of input. Before these changes the timing output would be as follows: Calculating ------------------------------------- call 1.000 i/100ms ------------------------------------------------- call 22.439 (±35.7%) i/s - 93.000 After these changes the output instead is as follows: Calculating ------------------------------------- call 1.000 i/100ms ------------------------------------------------- call 41.283 (±38.8%) i/s - 148.000 Note that due to the fairly high standard deviation and this being a synthetic benchmark it's entirely possible the real-world improvements are smaller.
| * | | | | | Merge branch 'fix/import-error' into 'master' Rémy Coutable2016-08-041-1/+1
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix Import/Export error checking versions Fixes small bug preventing the correct error message about Import/Export version being displayed. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/20536 - [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 - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5638
| | * | | | | | Fix Import/Export error checking versionsfix/import-errorJames Lopez2016-08-031-1/+1
| | |/ / / / /
| * | | | | | Merge branch 'autolink-filter-text-parse' into 'master' Rémy Coutable2016-08-041-6/+9
| |\ \ \ \ \ \ | | |_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve AutolinkFilter#text_parse performance ## What does this MR do? This MR improves the performance of `AutolinkFilter#text_parse` by using XPath queries for filtering out most text nodes. ## Are there points in the code the reviewer needs to double check? Mostly the styling of things. ## Why was this MR needed? Parsing text nodes is slow, mostly because most of this happens in Ruby. ## What are the relevant issue numbers? https://gitlab.com/gitlab-org/gitlab-ce/issues/18593 ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~ - [x] ~~API support added~~ - Tests - [x] ~~Added for this feature/bug~~ - [ ] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5629
| | * | | | | Improve AutolinkFilter#text_parse performanceautolink-filter-text-parseYorick Peterse2016-08-031-6/+9
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By using clever XPath queries we can quite significantly improve the performance of this method. The actual improvement depends a bit on the amount of links used but in my tests the new implementation is usually around 8 times faster than the old one. This was measured using the following benchmark: require 'benchmark/ips' text = '<p>' + Note.select("string_agg(note, '') AS note").limit(50).take[:note] + '</p>' document = Nokogiri::HTML.fragment(text) filter = Banzai::Filter::AutolinkFilter.new(document, autolink: true) puts "Input size: #{(text.bytesize.to_f / 1024 / 1024).round(2)} MB" filter.rinku_parse Benchmark.ips(time: 15) do |bench| bench.report 'text_parse' do filter.text_parse end bench.report 'text_parse_fast' do filter.text_parse_fast end bench.compare! end Here the "text_parse_fast" method is the new implementation and "text_parse" the old one. The input size was around 180 MB. Running this benchmark outputs the following: Input size: 181.16 MB Calculating ------------------------------------- text_parse 1.000 i/100ms text_parse_fast 9.000 i/100ms ------------------------------------------------- text_parse 13.021 (±15.4%) i/s - 188.000 text_parse_fast 112.741 (± 3.5%) i/s - 1.692k Comparison: text_parse_fast: 112.7 i/s text_parse: 13.0 i/s - 8.66x slower Again the production timings may (and most likely will) vary depending on the input being processed.
| * | | | | Merge branch 'update-gitlab-shell-in-tests' into 'master' Robert Speicher2016-08-031-2/+8
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the gitlab-shell version in the tmp/tests directory to the right version Previously the gitlab-shell version would never be updated if the directory existed via the `gitlab:shell:install` Rake task. This could lead to incompatibility issues or random errors. See merge request !5646
| | * | | | | Update the gitlab-shell version in the tmp/tests directory to the right versionupdate-gitlab-shell-in-testsStan Hu2016-08-031-2/+8
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the gitlab-shell version would never be updated if the directory existed via the `gitlab:shell:install` Rake task. This could lead to incompatibility issues or random errors.
| * | | | | Make Compare#diffs diff_options a regular argumentDouwe Maan2016-08-031-1/+1
| | | | | |
| * | | | | switch from diff_file_collection to diffs20034-safe-diffsPaco Guzman2016-08-038-44/+24
| | | | | | | | | | | | | | | | | | | | | | | | So we have raw_diffs too
| * | | | | Introduce Compare model in the codebase.Paco Guzman2016-08-035-17/+19
| | | | | | | | | | | | | | | | | | This object will manage Gitlab::Git::Compare instances
| * | | | | Move to Gitlab::Diff::FileCollectionPaco Guzman2016-08-037-5/+162
| | | | | | | | | | | | | | | | | | Instead calling diff_collection.count use diff_collection.size which is cache on the diff_collection
| * | | | | Cache highlighted diff lines for merge requestsPaco Guzman2016-08-034-5/+23
| |/ / / / | | | | | | | | | | | | | | | Introducing the concept of SafeDiffs which relates diffs with UI highlighting.
| * | | | Merge branch 'fix-downtime-check-compare-with-branch' into 'master' Yorick Peterse2016-08-021-20/+6
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Always compare with FETCH_HEAD in downtime_check See merge request !5619