summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix header link rendering when containing numbersfix-markdown-renderingYorick Peterse2016-04-061-1/+1
| | | | | | | | | | | This fixes the problem where Markdown such as: ### 31st Would get rendered as a link tag pointing to issue number 31 inside a header tag. See gitlab-org/gitlab-ce#14936 for more information.
* Wrap images in discussions and wikis with a link to the image source using ↵connorshea2016-04-042-0/+28
| | | | | | | | ImageLinkFilter. Resolves #14411. See merge request !3464
* Cleaned up caching in AbstractReferenceFilterYorick Peterse2016-04-041-15/+11
| | | | | Cleaning this up any further is a bit tricky as the caches in question should only be evaluated if RequestStore is actually enabled.
* Cache default_issues_tracker? in BanzaiYorick Peterse2016-04-041-1/+16
| | | | | | | | | | | | | | | Every object processed by ExternalIssueReferenceFilter can return a different Project instance when calling "project". For example, every note processed will have it's own associated Project. If we were to cache Project#default_issues_tracker? on Project level this would have no impact on Markdown rendering timings as the cache would have to be built for every Project instance without it ever being re-used. To work around this we cache Project#default_issues_tracker? in Banzai::Filter::ExternalIssueReferenceFilter using the project's _id_ instead of the whole object. This setup allows re-using of the cached data even when the Project instances used are different, as long as the actual project IDs are the same.
* Memoize object class titlesYorick Peterse2016-04-041-1/+9
| | | | | For an issue with around 200 notes this cuts down timings by around 150 milliseconds.
* Cache Banzai class methods returning static dataYorick Peterse2016-04-041-3/+3
| | | | | These methods always return the same data for every class so there's no point in computing their values on every call.
* Refactor processing of various Banzai filtersYorick Peterse2016-04-044-134/+120
| | | | | | | These filters now use a single iteration over all the document nodes instead of multiple ones. This in turn allows variables to be re-used (e.g. links only have to be unescaped once). Combined with some other refactoring this can drastically reduce render timings.
* Cache Banzai projects/objects using RequestStoreYorick Peterse2016-04-041-4/+67
| | | | | | | | | | This was originally suggested by @ayufan and modified to be a bit cleaner and use RequestStore instead of a regular Hash. By caching the output of the two methods involved the number of queries is reduced significantly. For example, for an issue with 200 notes (of which 100 reference a number of merge requests) this cuts down the amount of queries from around 6300 to around 3300.
* Merge branch 'add-ability-to-archive-a-project-via-api-14296' into 'master' Douwe Maan2016-04-031-0/+28
|\ | | | | | | | | | | | | Add endpoints for archiving and unarchiving Closes #14296 See merge request !3372
| * Merge branch 'master' into add-ability-to-archive-a-project-via-api-14296add-ability-to-archive-a-project-via-api-14296Zeger-Jan van de Weg2016-03-291-6/+10
| |\
| * \ Merge branch 'master' into add-ability-to-archive-a-project-via-api-14296Zeger-Jan van de Weg2016-03-241-0/+21
| |\ \
| * | | PUT becomes POST on archiving endpointsZeger-Jan van de Weg2016-03-241-4/+4
| | | | | | | | | | | | | | | | | | | | Also the specs have a minor improvement. Mainly the access right spec. Changes are reflected in the docs
| * | | Add endpoints for archiving and unarchivingZeger-Jan van de Weg2016-03-231-0/+28
| | | |
* | | | Merge branch 'routing' into 'master' Robert Speicher2016-04-0111-11/+24
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added & use Gitlab::Routing for URL helpers Extracted from !3389 See merge request !3486
| * | | | Added & use Gitlab::Routing for URL helpersroutingYorick Peterse2016-04-0111-11/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rails' "url_helpers" method creates an anonymous Module (which a bunch of methods) on every call. By caching the output of this method in a dedicated method we can shave off about 10 seconds of loading time for an issue with around 200 comments.
* | | | | Merge branch 'fix/fogbugz-import' into 'master' Robert Speicher2016-04-011-1/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | spec and fix for fogbugz lonely user problem Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/14766 I encountered this issue while manually testing all import types for https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3066 This is really due to a horrible API ``` { 'people' => { 'person' => array_of_people_or_single_person_as_hash } } ``` See merge request !3457
| * | | | | spec and fix for fogbugz lonely user problemJames Lopez2016-03-301-1/+1
| | | | | |
* | | | | | Merge branch ↵Douwe Maan2016-04-012-9/+7
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'snippets-with-comments-cause-a-500-when-they-show-up-in-search-results-14764' into 'master' Fix Error 500 when searching for a comment in a project snippet Closes #14764. /cc @stanhu, and thank you for the spec! ;) See merge request !3468
| * | | | | | Fix view of notes in search results when noteable is a snippetsnippets-with-comments-cause-a-500-when-they-show-up-in-search-results-14764Rémy Coutable2016-03-311-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, streamline the view. Signed-off-by: Rémy Coutable <remy@rymai.me>
| * | | | | | Rename Note#for_project_snippet? to #for_snippet?Rémy Coutable2016-03-312-2/+2
| | |/ / / / | |/| | | | | | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | | | | Merge branch 'fix/issue-move-rewrite-uploads' into 'master' Douwe Maan2016-04-012-2/+58
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite uploads when moving issue to another project Closes #14531 See merge request !3382
| * \ \ \ \ \ Merge branch 'master' into fix/issue-move-rewrite-uploadsGrzegorz Bizon2016-03-316-35/+102
| |\ \ \ \ \ \ | | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (27 commits) Fix commit comment alignment minor cleanup in system_hook_spec Pre-calculate Emoji digests Clear .todo listener Change window.location to use turbolinks Make entire todo row clickable Add 8.6.2 CHANGELOG items Ensure uploads dir exists when running backup specs Move CarrierWave test env config to separate file Remove console logs Off the event initially Collapsed sidebar opens over instead of pushing content. Sidebar collapse update issue User selection from collapsed sidebar Add json response for user avatar in merge request Make changed values visible in minimized sidebar. Fixed MergeRequestController spec We need `sha` reference from `diff_base_commit` to generate the diff Use `diff_base_commit` instead of `target_branch` to generate diffs Isolate CarrierWave uploads in test enviroment ...
| * | | | | | Remove reduntant `move_to_store` overrideGrzegorz Bizon2016-03-301-8/+2
| | | | | | |
| * | | | | | Add method that returns markdown in file uploaderGrzegorz Bizon2016-03-302-2/+2
| | | | | | |
| * | | | | | Check if GFM rewriters need rewrite internallyGrzegorz Bizon2016-03-302-1/+3
| | | | | | |
| * | | | | | Refactor uploads rewriter used when moving issueGrzegorz Bizon2016-03-302-13/+17
| | | | | | |
| * | | | | | Add uploads rewriter and use it when moving issueGrzegorz Bizon2016-03-301-0/+56
| | | | | | |
* | | | | | | Remove "Congratulations!" tweet button on newly-created project.connorshea2016-03-312-2/+0
| |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I’ve removed everything related to the feature based on this commit: ce08f919f34fd8849834365 Resolves #10857.
* | | | | | Merge branch 'precompile-emoji-urls' into 'master' Dmitriy Zaporozhets2016-03-302-14/+53
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pre-calculate Emoji digests cc @dzaporozhets @rspeicher @marin Do you happen to know if we allow users to configure asset hosts anywhere in Omnibus and such? I've not been able to find any reference to "asset_host" so it seems we don't allow this (which is a good thing as this simplifies the code). See merge request !3458
| * | | | | | Pre-calculate Emoji digestsprecompile-emoji-urlsYorick Peterse2016-03-302-14/+53
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By pre-calculating the digests we can manually construct the emoji URLs, removing the need for using Rails' asset URL helpers. The reason we don't want to use these helpers for Emojis is two-fold: 1. Rails' image_url() method is slow, really slow. For one it _might_ have to calculate digests but it also performs a lot of other intensive operations (judging by the source code and based on measuring timings). 2. We have a lot of Emoji which coupled with the above can result in it taking minutes to load Emoji autocomplete data. Using this pre-calculation setup generating the digests takes around 7 seconds (including the time it takes to start Rails/Rake), and only around 600 milliseconds to load _all_ the autocomplete data of a project (measured locally). This commit _does_ change the Emoji URLs from absolute to relative URLs as these are much easier to generate. To update the Emoji data simply run: rake gemojione:digests Then commit any changes. Fixes gitlab-org/gitlab-ce#14009
* | | | | | Merge branch '2364-fallback-to-in-reply-to-header' into 'master' Douwe Maan2016-03-303-21/+25
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fall back to In-Reply-To and References headers when sub-addressing is not available _Originally opened at !3024 by @dabit._ - - - Fixes #2364 Summary of the changes: - No more need to have the `%{key}` placeholder in the `incoming_email.address` - The fallback message id format is `reply-[key]@[gitlab_host]` (reminder: it doesn't have to be a real email address) - The fallback message id that includes the reply key is added to both `References` header - Documentation for the "Reply by email" feature updated See merge request !3305
| * | | | | Improve and finish the fallback to the In-Reply-To and References header for ↵2364-fallback-to-in-reply-to-headerRémy Coutable2016-03-253-26/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the reply-by-email feature A few things to note: - The IncomingEmail feature is now enabled even without a correctly-formatted sub-address - Message-ID for new thread mail are kept the same so that subsequent notifications to this thread are grouped in the thread by the email service that receives the notification (i.e. In-Reply-To of the answer == Message-ID of the first thread message) - To maximize our chance to be able to retrieve the reply key, we look for it in the In-Reply-To header and the References header - The pattern for the fallback reply message id is "reply-[key]@[gitlab_host]" - Improve docs thanks to Axil
| * | | | | Fix #2364. Fall back to In-Reply-To header when reply key not availableDavid Padilla2016-03-251-0/+15
| | |_|/ / | |/| | |
* | | | | Merge branch 'refactor/project-badges-interface' into 'master' Robert Speicher2016-03-301-0/+24
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor builds badge, encapsulate inside a class This merge requests attempts to introduce interface for all badges. Currently we only have a build badge, but other badges are in plans, like coverage badge. See merge request !3403
| * | | | Refactor builds badge, encapsulate inside a classGrzegorz Bizon2016-03-291-0/+24
| |/ / /
* | | | Merge branch 'rs-banzai-requires' into 'master' Rémy Coutable2016-03-3018-38/+0
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove redundant `require`s from Banzai files We're trying to avoid circular dependency errors. Related: https://gitlab.com/gitlab-org/gitlab-ce/issues/13521 Sentry: https://sentry.gitlap.com/gitlab/gitlabcom/issues/8/ See merge request !3391
| * | | | Remove redundant `require`s from Banzai filesrs-banzai-requiresRobert Speicher2016-03-2418-38/+0
| |/ / / | | | | | | | | | | | | We're trying to avoid circular dependency errors.
* | | | Merge branch ↵Robert Speicher2016-03-292-12/+14
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'mariusz_jachimowicz/gitlab-ce-i_14415_expose_label_description' into 'master' api - expose label description Resolves #14415 See merge request !3314
| * | | api - expose label descriptionMariusz Jachimowicz2016-03-242-12/+14
| |/ /
* | | Back dating of issues when creating throught the APIZeger-Jan van de Weg2016-03-281-6/+10
|/ /
* | Explain why ExclusiveLease has no #cancellease-design-commentsJacob Vosmaer2016-03-241-0/+21
|/ | | | [ci skip]
* Avoid using the same name between methods and variablesLin Jen-Shin2016-03-231-7/+7
|
* Fix build dependencies, when the dependency is a stringKamil Trzcinski2016-03-231-2/+2
|
* Merge branch 'drop_db_before_restore' into 'master' Robert Speicher2016-03-222-8/+61
|\ | | | | | | | | | | | | | | | | | | | | | | Reload the schema before restoring a database backup If a user tries to downgrade and restore after a failed upgrade, the database may still contain newer tables. Reload the older schema before restoring the database to avoid future upgrade problems. Also, add a rake task to help users add migration versions to the database so it's easier to recover from these errors if they do occur. Fixes #13419 See merge request !2807
| * Reload the schema before restoring a database backupDrew Blessing2016-03-212-8/+61
| |
* | Merge branch 'feature-ci-only-except-trigger' into 'master' Kamil Trzciński2016-03-221-8/+9
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CI: Add 'triggers' keyword to 'only' and 'except' lists to allow control over when triggers cause builds to run Currently, the `only` and `except` keywords in `.gitlab-ci.yml` only accept ref names or the special `branches` and `tags` keywords. However, these are primarily useful when controlling how repository activity affects the creation of builds. In my case, instead of building on every commit, I'd like to use the following logic: - If the repository is tagged, do a build. - Any other normal commits should not cause a build. - If a build is triggered via the API, always create one for the specified ref. From what I can tell, this isn't possible via the existing YAML syntax. In this MR, I introduce a new keyword `triggers` that goes along with `branches` and `tags`. I can implement the logic above using the following job configuration: ```yaml only: - tags - triggers ``` I updated the tests and documentation to reflect this and everything seems to pass. See merge request !3230
| * | make conditional a bit clearerJason Roehm2016-03-151-1/+1
| | |
| * | fixed missing argument in listJason Roehm2016-03-151-1/+1
| | |
| * | fix rubocop violationJason Roehm2016-03-151-1/+1
| | |
| * | add 'triggers' keyword to gitlab-ci.yml 'only' and 'except' fields to allow ↵Jason Roehm2016-03-151-7/+8
| | | | | | | | | | | | control over whether triggers will cause jobs to run