summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Use clock_gettime for all performance timestampsperformance-clock-adjustmentsYorick Peterse2016-06-284-19/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Process.clock_gettime allows getting the real time in nanoseconds as well as allowing one to get a monotonic timestamp. This offers greater accuracy without the overhead of having to allocate a Time instance. In general using Time.now/Time.new is about 2x slower than using Process.clock_gettime(). For example: require 'benchmark/ips' Benchmark.ips do |bench| bench.report 'Time.now' do Time.now.to_f end bench.report 'clock_gettime' do Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond) end bench.compare! end Running this benchmark gives: Calculating ------------------------------------- Time.now 108.052k i/100ms clock_gettime 125.984k i/100ms ------------------------------------------------- Time.now 2.343M (± 7.1%) i/s - 11.670M clock_gettime 4.979M (± 0.8%) i/s - 24.945M Comparison: clock_gettime: 4979393.8 i/s Time.now: 2342986.8 i/s - 2.13x slower Another benefit of using Process.clock_gettime() is that we can simplify the code a bit since it can give timestamps in nanoseconds out of the box.
* Unused got variable with very bad performancePaco Guzman2016-06-281-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In any case if just want the value which is always ‘gitlab’ require 'benchmark/ips' Project.first # To load database things GitlabIssueTrackerService.first # To load database things Benchmark.ips do |x| x.config(:time => 5, :warmup => 2) x.report("current") do Project.new.default_issue_tracker.to_param end x.report("") do 'gitlab' end x.compare! end Calculating ------------------------------------- current 4.000 i/100ms 30.938k i/100ms ------------------------------------------------- current 47.298 (±10.6%) i/s - 232.000 4.366M (±20.9%) i/s - 17.202M Comparison: : 4366456.0 i/s current: 47.3 i/s - 92318.26x slower
* support cgi style options, such as erb?parent=jsonhttp://jneen.net/2016-06-271-3/+3
|
* make #custom_language privatehttp://jneen.net/2016-06-271-8/+8
|
* appease rubocophttp://jneen.net/2016-06-271-2/+1
|
* add custom highlighting via .gitattributeshttp://jneen.net/2016-06-272-6/+25
| | | | paired with @stanhu
* Rename Licenses API to License Templates APIDrew Blessing2016-06-272-3/+3
|
* Merge branch 'fix/sidekiq-mem-killer-debug' into 'master' Rémy Coutable2016-06-271-2/+2
|\ | | | | | | | | | | | | | | | | | | | | Better debugging for memory killer middleware This adds more info to the warning messages output by `MemoryKiller`. Previously only the PID was showed, making it difficult to debug issues like https://gitlab.com/gitlab-org/gitlab-ce/issues/19124 This adds the worker class and job ID to the log messages. See merge request !4936
| * Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into ↵James Lopez2016-06-2718-78/+374
| |\ | | | | | | | | | fix/sidekiq-mem-killer-debug
| * | better debugging for memory killer middlewarefix/sidekiq-mem-killer-debugJames Lopez2016-06-271-2/+2
| | |
* | | Wrap images in divs with Banzai and limit max-height.image-sizingConnor Shea2016-06-271-1/+9
| |/ |/| | | | | | | | | Add max-height to prevent images from displaying larger than the provided screen size. Also fix a failing test and add a new one.
* | Merge branch 'refactor/ci-config-add-entry-error' into 'master' Rémy Coutable2016-06-2710-46/+134
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve validations and error handling in new CI config entries ## What does this MR do? This MR improves validation in new CI config. ## Why was this MR needed? With that it will be easier to handle errors during validation and post-processing. ## What are the relevant issue numbers? This is a continuation of #15060 See merge request !4560
| * \ Merge branch 'master' into refactor/ci-config-add-entry-errorrefactor/ci-config-add-entry-errorGrzegorz Bizon2016-06-2043-122/+1503
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (345 commits) use rails root join fixed a couple of errors spotted in production Fix RangeError exceptions when referring to issues or merge requests outside of max database values Fix bug in `WikiLinkFilter`. Small frontend code fixes and restore 8a2d88f commit Warn about admin privilege to disable GitHub Webhooks Listing GH Webhooks doesn't stop import process for non GH admin users fixup! updated docs for api endpoint award emoji Update CHANGELOG Ensure Todos counters doesn't count Todos for projects pending delete Add endpoints for award emoji on notes Sort API endpoints and implement feedback Add endpoints for Award Emoji Fixed issue with assignee dropdown not selecting correctly Removed update method Re-structured controller spec Renamed issuable param to issuable_id Fix clibpoard buttons on "Check out branch" modal. Track method call times/counts as a single metric Cache todo counters (pending/done) Fix a 'wrong number of arguments' error Added missing mount point for Sidekiq Metrics API, after it got lost on rebase. ...
| * | | Extract CI entry config hash validation to validatorGrzegorz Bizon2016-06-172-7/+9
| | | |
| * | | Merge branch 'master' into refactor/ci-config-add-entry-errorGrzegorz Bizon2016-06-1717-66/+155
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (189 commits) Update CHANGELOG for !4659 Center the header logo for all Devise emails Add previews for all customized Devise emails Customize the Devise `unlock_instructions` email Customize the Devise `reset_password_instructions` email Customize the Devise `password_change` emails Use gitlab-git 10.2.0 Use Git cached counters on project show page Fix indentation scss-lint errors Added title attribute to enties in tree view Closes #18353 Banzai::Filter::ExternalLinkFilter use XPath Reduce queries in IssueReferenceFilter Use gitlab_git 10.1.4 Fixed ordering in Project.find_with_namespace Fix images in emails Banzai::Filter::UploadLinkFilter use XPath Turn Group#owners into a has_many association Make project_id nullable ...
| * | | | Add first custom validator for new ci configGrzegorz Bizon2016-06-173-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This follows a standard `ActiveModel` pattern of creating a custom validators. We use `ActiveModel::EachValidator` here that reuses methods provided by `LegacyValidationHelpers`. We will remove `LegacyValidationHelpers` on some point in the future, at the later stages of CI configuration refactoring. It may be possible to rewrite custom validators to use format like: `validates :config, array_of: String`
| * | | | Rename legacy validation helpers for new ci configGrzegorz Bizon2016-06-173-3/+3
| | | | |
| * | | | Improve CI config entries validations prototypeGrzegorz Bizon2016-06-175-14/+17
| | | | |
| * | | | Add prototype of CI config node validatorGrzegorz Bizon2016-06-167-69/+98
| | | | | | | | | | | | | | | | | | | | | | | | | This makes use of `ActiveModel::Validations` encapsulated in a separate class that is accessible from a node object.
| * | | | Add class that encapsulates error in new Ci configGrzegorz Bizon2016-06-156-5/+47
| | | | |
* | | | | Merge branch 'mahcsig/gitlab-ce-17818-group-issues-api'Rémy Coutable2016-06-241-0/+35
|\ \ \ \ \
| * | | | | gitlab-org/gitlab-ce#17818 - add api call for issues by groupMarc Siegfriedt2016-06-231-0/+35
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | rely only on IssuesFinder docs and changelog
* | | | | Merge branch 'fix/gitlab-import-project-file-fix' into 'master' Rémy Coutable2016-06-242-4/+17
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix temp file being deleted after the request while importing a GitLab project Fixes https://gitlab.com/gitlab-com/infrastructure/issues/151 In production, the temporary uploaded file is getting deleted straight after the request so the Sidekiq worker is unable to find it in `/tmp` Also, improved erroring/logging of this situation. See merge request !4894
| * | | | | Fix tmp file being deleted after the request plus some cleanup and improved ↵James Lopez2016-06-242-4/+17
| |/ / / / | | | | | | | | | | | | | | | erroring for this situation
* | | | | Support for rendering/redacting multiple documentsYorick Peterse2016-06-245-28/+188
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the way certain documents are rendered (currently only Notes) and how documents are redacted. Previously both rendering and redacting would run on a per document basis. The result of this was that for every document we'd have to run countless queries just to figure out if we could display a set of links or not. This commit changes things around so that redacting Markdown documents is no longer tied into the html-pipeline Gem. This in turn allows it to redact multiple documents in a single pass, thus reducing the number of queries needed. In turn rendering issue/merge request notes has been adjusted to take advantage of this new setup. Instead of rendering Markdown somewhere deep down in a view the Markdown is rendered and redacted in the controller (taking the current user and all that into account). This has been done in such a way that the "markdown()" helper method can still be used on its own. This particular commit also paves the way for caching rendered HTML on object level. Right now there's an accessor method Note#note_html which is used for setting/getting the rendered HTML. Once we cache HTML on row level we can simply change this field to be a column and call a "save" whenever needed and we're pretty much done.
* | | | Merge branch 'fix/import-export-gitlab-errors' into 'master' Rémy Coutable2016-06-231-1/+3
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix errors found on importing GitLab CE repo Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/18968 See merge request !4855
| * \ \ \ Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into ↵James Lopez2016-06-233-4/+21
| |\ \ \ \ | | | | | | | | | | | | | | | | | | fix/import-export-gitlab-errors
| * | | | | fix utc errorJames Lopez2016-06-221-1/+3
| | | | | |
* | | | | | Add Sidekiq queue duration to transaction metrics.Paco Guzman2016-06-231-0/+2
| |/ / / / |/| | | |
* | | | | Merge branch 'fix_saml_signin' into 'master' Robert Speicher2016-06-221-1/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix subsequent SAML sign ins Fixes a bug when `auto_link_ldap_user` is `true` that causes SAML users to be unable to sign in a second time. Fix the problem for https://gitlab.zendesk.com/agent/tickets/22546 See merge request !4718
| * | | | | Fix subsequent SAML sign insDrew Blessing2016-06-221-1/+1
| | | | | |
* | | | | | Merge branch 'fix-external-issue-links' into 'master' Robert Speicher2016-06-221-3/+7
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handle external issues in IssueReferenceFilter Handling of external issues was broken when I refactored `IssueReferenceFilter` to use fewer SQL queries. Fixes #18827 See merge request !4789
| * | | | | | Handle external issues in IssueReferenceFilterfix-external-issue-linksYorick Peterse2016-06-211-3/+7
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the past this class would use Project#get_issue to retrieve an issue by its ID. This method would automatically determine whether to return an Issue or ExternalIssue. This commit changes IssueReferenceFilter to handle external issues again and in a somewhat more explicit manner than before. Fixes gitlab-org/gitlab-ce#18827
* | | | | | Merge branch 'master' into feature/import-export-docsAchilleas Pipinellis2016-06-223-10/+4
|\ \ \ \ \ \ | | |_|/ / / | |/| | | |
| * | | | | Merge branch ↵Douwe Maan2016-06-221-0/+2
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '18755-fix-destroy-project-causes-post_decline_request-to-be-executed' into 'master' Resolve "Destroying a project causes post_decline_request to be executed" ## What does this MR do? Ensure we don't send "access request declined" to access requesters when a project is deleted. ## Are there points in the code the reviewer needs to double check? I've created a service to decouple the notification sending from the AR model. ## Why was this MR needed? Because there was an issue. ## What are the relevant issue numbers? Fixes #18755, #18750. ## Does this MR meet the acceptance criteria? - [x] No CHANGELOG needed. - [x] 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 !4744
| | * | | | | Raise a new Gitlab::Access::AccessDeniedError when permission is not enough ↵Rémy Coutable2016-06-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to destroy a member This is a try for a new approach to put the access checks at the service level. Signed-off-by: Rémy Coutable <remy@rymai.me>
| * | | | | | Merge branch 'remove-banzai-pre-process' into 'master' Robert Speicher2016-06-212-10/+2
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move pre_process into render_result This MR moves `Banzai::Renderer.pre_process` into `Banzai::Renderer.render_result`. The `pre_process` method was called even when its output would be ignored. See 11a5a4f359ee57029dbfcc9185fc6b47243ea2aa for more details. See merge request !4830
| | * | | | | | Move pre_process into render_resultremove-banzai-pre-processYorick Peterse2016-06-212-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The method Banzai::Renderer.pre_process would always be called, regardless of whether the Markdown to render was already cached or not. In cache the document _was_ cached the output of the pre-processing pipeline was ignored resulting in it doing nothing but wasting CPU cycles. This commit moves Banzai::Renderer.pre_process into Banzai::Renderer.render_result so that it's _only_ used when needed.
* | | | | | | | added nice to have - rake task and some changes to docsJames Lopez2016-06-211-0/+13
|/ / / / / / /
* | | | | | | Merge branch '18590-banzai-filter-relativelinkfilter-is-slow' into 'master' Yorick Peterse2016-06-211-37/+14
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimize Banzai::Filter::RelativeLinkFilter See merge request !4813
| * | | | | | | Optimize Banzai::Filter::RelativeLinkFilterAlejandro Rodríguez2016-06-211-37/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A lot of git operations were being repeated, for example, to build a url you would ask if the path was a Tree, which would call a recursive routine in Gitlab::Git::Tree#where, then ask if the path was a Blob, which would call a recursive routine at Gitlab::Git::Blob#find, making reference to the same git objects several times. Now we call Rugged::Tree#path, which allows us to determine the type of the path in one pass. Some other minor improvement added, like saving commonly used references instead of calculating them each time.
* | | | | | | | Merge branch 'fix/builds-api-nil-commit' into 'master' Rémy Coutable2016-06-211-5/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix builds API response that did not include commit data ## What does this MR do? This is fix for problem with builds API response not including information about commit this build is created for. ## What are the relevant issue numbers? Closes #18476 ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [x] API support added - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !4827
| * | | | | | | | Fix builds API response not including commit dataGrzegorz Bizon2016-06-211-5/+1
| | |/ / / / / / | |/| | | | | |
* | | | | | | | Merge branch 'show-image-id-on-registry-page' into 'master' Rémy Coutable2016-06-211-0/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Show proper image ID on registry page ## What does this MR do? Display the container registry image ID (from the config blob) instead of the first image layer ID ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? To show proper image ID on container_registry page. This only supports manifest V2, since the manifest V1 doesn't expose information about Image ID. ## What are the relevant issue numbers? Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/18159. ## Screenshots (if relevant) ![Screen_Shot_2016-06-21_at_13.16.44](/uploads/db0d3ed8c8b90fafc8dbf1644c2354b0/Screen_Shot_2016-06-21_at_13.16.44.png) - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - Tests - [x] 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) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !4821
| * | | | | | | | Show proper image ID on registry pageKamil Trzcinski2016-06-211-0/+1
| | |_|_|/ / / / | |/| | | | | |
* | | | | | | | Merge branch 'ci-lfs-fetch' into 'master' Rémy Coutable2016-06-213-6/+10
|\ \ \ \ \ \ \ \ | |_|/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow to fetch LFS from CI ## What does this MR do? This adds support for fetching LFS object from CI jobs (mostly it's made for supporting GitLab CI). ## What is left? - [x] Write tests covering a new authorization mechanism cc @grzesiek @marin See merge request !4465
| * | | | | | | Add test coverage to LFS fetchingci-lfs-fetchKamil Trzcinski2016-06-211-0/+2
| | | | | | | |
| * | | | | | | Merge remote-tracking branch 'origin/master' into ci-lfs-fetchKamil Trzcinski2016-06-2172-260/+2136
| |\ \ \ \ \ \ \ | | |/ / / / / /
| * | | | | | | Merge remote-tracking branch 'origin/master' into ci-lfs-fetchKamil Trzcinski2016-06-1063-504/+808
| |\ \ \ \ \ \ \
| * | | | | | | | WIPKamil Trzcinski2016-06-033-6/+8
| | | | | | | | |