summaryrefslogtreecommitdiff
path: root/app/models/concerns
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' into prevent_authored_awardable_votesbarthc2016-08-302-2/+6
|\
| * Merge branch 'shorten-task-status-phrase' into 'master' Douwe Maan2016-08-301-2/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shorten task status phrase ## What does this MR do? Shortens the task status phrase to make it easier to read ## Are there points in the code the reviewer needs to double check? Shouldn't be any ## Why was this MR needed? Improve readability/scan-ability of the issues table ## Screenshots (if relevant) Before: ![Screen_Shot_2016-08-27_at_12.38.17_PM](/uploads/12d54e4ce24dea203e8f7189b32e3a43/Screen_Shot_2016-08-27_at_12.38.17_PM.png) After: ![Screen_Shot_2016-08-27_at_12.38.05_PM](/uploads/7dfcc3284025b889f6afa09ca273d928/Screen_Shot_2016-08-27_at_12.38.05_PM.png) ## Does this MR meet the acceptance criteria? - [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) ## What are the relevant issue numbers? Closes #21543 See merge request !6062
| | * Shorten task status phraseClement Ho2016-08-291-2/+2
| | |
| * | Move #to_discussion to NoteOnDiff21211-comment-on-diff-partially-broken-after-updating-to-8-11Sean McGivern2016-08-301-0/+4
| |/
* | prevent authored awardable thumbs votesbarthc2016-08-301-2/+5
| |
* | prevent authored awardable thumbs votesbarthc2016-08-282-0/+13
|/ | | | | | prevent authored awardable thumbs votes prevent authored awardable thumbs votes
* rename Statuseable to HasStatusDe Wet Blomerus2016-08-251-1/+1
|
* Also check if Akismet is enabled, before showing the `Submit as spam` button.fix-spam-submit-buttonPatricio Cano2016-08-221-1/+1
|
* Revert the revert of Optimistic Lockingrevert_revert_issuable_lockValery Sizov2016-08-221-0/+6
|
* Merge branch 'issue_18135' into 'master' Douwe Maan2016-08-192-15/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Todos sorting dropdown Implements #18135 ![todos_sorting](/uploads/bff76827c421628134dfb8b864e47c74/todos_sorting.png) - [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 !5691
| * Todos sorting dropdownissue_18135Felipe Artur2016-08-192-15/+18
| |
* | Merge branch 'fix-discussions-on-changed-lines' into 'master' Robert Speicher2016-08-191-0/+4
|\ \ | | | | | | | | | | | | Fix bug where notes weren’t shown in discussion when the code had changed after creation See merge request !5908
| * | Fix bug where notes weren’t shown in discussion when the code had changed ↵Douwe Maan2016-08-191-0/+4
| |/ | | | | | | after creation
* | Merge branch 'wall-clock-time-for-showing-pipeline' into 'master' Robert Speicher2016-08-191-5/+10
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Show wall-clock time when showing pipeline ## What does this MR do? Show wall-clock time when showing pipeline instead of cumulative builds time. Closes #17007 See merge request !5734
| * | Use travel_to instead of dependency injection, feedback:Lin Jen-Shin2016-08-191-1/+1
| | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5734#note_14056642
| * | Merge remote-tracking branch 'upstream/master' into ↵Lin Jen-Shin2016-08-172-0/+59
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wall-clock-time-for-showing-pipeline * upstream/master: (99 commits) Update CHANGELOG for 8.10.6, 8.9.7, and 8.8.8 Updated Akismet documentation Add hover state to todos (!5361) Load issues and merge requests templates from repository Backport EE assertions in protected branch related specs. Revert "Merge branch '19957-write-tests-for-adding-comments-for-different-line-types-in-diff' into 'master'" Fix a missed `before_action` for `AutocompleteController`. Backport `AutocompleteController#load_project` from EE!581. Fix API::BranchesSpec. Fix failing tests relating to backporting ee!581. Revert unrelevant changes Fix the protected branches factory. Improve EE compatibility with protected branch access levels. Move the "update" portion of the protected branch view into a partial. Don't select an access level if already selected. Backport changes from gitlab-org/gitlab-ee!581 to CE. Further refactor and syntax fixes. Upgrade httpclient gem from 2.7.0.1 to 2.8.2. Make rubocop happy Make rubocop happy ...
| * | Introduce Gitlab::Utils.now so that it's easier to stubLin Jen-Shin2016-08-151-1/+1
| | |
| * | Merge branch 'pipeline-hooks-without-slack' into ↵Lin Jen-Shin2016-08-151-12/+19
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wall-clock-time-for-showing-pipeline * pipeline-hooks-without-slack: (156 commits) Fix test failures Make pipeline to be in created state for hooks tests Make `execute_methods` public Added specs for started_at and finished_at Use explicit events to transition between states Fix tests. We cannot reload unless it's already saved: Have trait all_events_enabled so that's easier to reuse, feedback: Simplify the name for data builder, feedback: Prefer extend self over module_function, feedback: Make it more grammatically correct, feedback: if -> when; when -> `when`; %w() -> %w[]; and fix some typos: Prefer described_class, feedback: Make the comment more clear, feedback: Update CHANGELOG render only commit title Fix test failures, that did occur because of missing previously used `reload_status!` call Use state machine for pipeline event processing Upgrade Rails to 4.2.7.1 for security fixes. Update gitlab-shell to v3.3.3 Verify the pipeline status after executing events on builds ...
| * | | Cleanup the use of duration and optimize some queriesLin Jen-Shin2016-08-101-5/+10
| | | |
* | | | Allow project group links to be expiredSean McGivern2016-08-181-0/+15
| |_|/ |/| |
* | | Backport changes from gitlab-org/gitlab-ee!581 to CE.Timothy Andrew2016-08-161-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | !581 has a lot of changes that would cause merge conflicts if not properly backported to CE. This commit/MR serves as a better foundation for gitlab-org/gitlab-ee!581. = Changes = 1. Move from `has_one {merge,push}_access_level` to `has_many`, with the `length` of the association limited to `1`. This is _effectively_ a `has_one` association, but should cause less conflicts with EE, which is set to `has_many`. This has a number of related changes in the views, specs, and factories. 2. Make `gon` variable loading more consistent (with EE!581) in the `ProtectedBranchesController`. Also use `::` to prefix the `ProtectedBranches` services, because this is required in EE. 3. Extract a `ProtectedBranchAccess` concern from the two access level models. This concern only has a single `humanize` method here, but will have more methods in EE. 4. Add `form_errors` to the protected branches creation form. This is not strictly required for EE compatibility, but was an oversight nonetheless.
* | | Further refactor and syntax fixes.Patricio Cano2016-08-151-28/+14
| | |
* | | Refactored AkismetHelper into AkismetService and cleaned up `Spammable`Patricio Cano2016-08-151-40/+28
| | | | | | | | | | | | - Refactored SpamCheckService into SpamService
* | | Allow `Issue` to be submitted as spamPatricio Cano2016-08-151-3/+15
| | | | | | | | | | | | | | | - Added controller actions as reusable concerns - Added controller tests
* | | Refactored spam related code even furtherPatricio Cano2016-08-151-16/+28
| | | | | | | | | | | | | | | | | | | | | - Removed unnecessary column from `SpamLog` - Moved creation of SpamLogs out of its own service and into SpamCheckService - Simplified code in SpamCheckService. - Moved move spam related code into Spammable concern
* | | Complete refactor of the `Spammable` concern and tests:Patricio Cano2016-08-152-17/+56
| | | | | | | | | | | | | | | | | | | | | - Merged `AkismetSubmittable` into `Spammable` - Clean up `SpamCheckService` - Added tests for `Spammable` - Added submit (ham or spam) options to `AkismetHelper`
* | | Lay the ground works to submit information to AkismetPatricio Cano2016-08-151-0/+15
| |/ |/| | | | | | | | | - New concern `AkismetSubmittable` to allow issues and other `Spammable` models to be submitted to Akismet. - New model `UserAgentDetail` to store information needed for Akismet. - Services needed for their creation and tests.
* | Pre-create all builds for Pipeline when a trigger is receivedKamil Trzcinski2016-08-111-12/+19
|/ | | | | | | | | | | This change simplifies a Pipeline processing by introducing a special new status: created. This status is used for all builds that are created for a pipeline. We are then processing next stages and queueing some of the builds (created -> pending) or skipping them (created -> skipped). This makes it possible to simplify and solve a few ordering problems with how previously builds were scheduled. This also allows us to visualise a full pipeline (with created builds). This also removes an after_touch used for updating a pipeline state parameters. Right now in various places we explicitly call a reload_status! on pipeline to force it to be updated and saved.
* Added concern for a faster "cache_key" methodfaster-cache-keysYorick Peterse2016-08-081-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | This concern provides an optimized/simplified version of the "cache_key" method. This method is about 9 times faster than the default "cache_key" method. The produced cache keys _are_ different from the previous ones but this is worth the performance improvement. To showcase this I set up a benchmark (using benchmark-ips) that compares FasterCacheKeys#cache_key with the regular cache_key. The output of this benchmark was: Calculating ------------------------------------- cache_key 4.825k i/100ms cache_key_fast 21.723k i/100ms ------------------------------------------------- cache_key 59.422k (± 7.2%) i/s - 299.150k cache_key_fast 543.243k (± 9.2%) i/s - 2.694M Comparison: cache_key_fast: 543243.4 i/s cache_key: 59422.0 i/s - 9.14x slower To see the impact on real code I applied these changes and benchmarked Issue#referenced_merge_requests. For an issue referencing 10 merge requests these changes shaved off between 40 and 60 milliseconds.
* Merge branch 'rubocop/enable-access-modifiers-cops' into 'master' Robert Speicher2016-07-291-15/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable Rubocop cops that check access modifiers ## What does this MR do? This MR enables Rubocop cops that detect methods that should be restricted but are the part of public API because of access modifiers used improperly. This also fixes existing offenses. ## Why was this MR needed? Some method in our codebase are public instead of being private because it is sometimes difficult to get it right without static analysis. ## What are the relevant issue numbers? See #17478 Closes #17372 See merge request !5014
| * Enable Rubocop cops for invalid access modifiersrubocop/enable-access-modifiers-copsGrzegorz Bizon2016-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enables following cops: Check for useless access modifiers Lint/UselessAccessModifier Checks for attempts to use `private` or `protected` to set the visibility of a class method, which does not work. Lint/IneffectiveAccessModifier This also disables two false possitives in concerns.
| * Fix some useless access modifiers in the codeGrzegorz Bizon2016-07-191-14/+14
| |
* | Reduce number of queries made for merge_requests/:id/diffsfix/use-fewer-queries-for-mr-notesAhmad Sherif2016-07-281-1/+1
| |
* | Refactor spam validation to a concern that can be easily reused and improve ↵akismet-ui-checkPatricio Cano2016-07-261-0/+16
| | | | | | | | legibility in `SpamCheckService`
* | Add Discussion model to represent MR/diff discussiondiscussion-modelDouwe Maan2016-07-201-25/+0
| |
* | Mark builds with manual actions as skippedKamil Trzcinski2016-07-181-3/+3
|/
* Merge branch 'normalize_emoji_aliases_paths' into 'master' Rémy Coutable2016-07-181-2/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix not normalized emoji paths ## What does this MR do? It normalizes emoji names in `api` and `toggle_award` ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? User was able to store +1 and thumbsup to databse, causing UI inconsistency. ## What are the relevant issue numbers? Fixes #19104 ## Screenshots (if relevant) ## Does this MR meet the acceptance criteria? - [x] [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) - [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 !5060
| * Fix not normalized emoji pathsdixpac2016-07-141-2/+7
| | | | | | | | | | | | * There where path where +1 was stored as +1 not as thumbsup that was causing problems such as showing thumbsup icon 2 time. I fixed this to always normalize and store +1 as tumbsup
* | Merge branch 'fix-mentioned-users-on-diff-notes' into 'master' Douwe Maan2016-07-152-6/+9
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix mentioned users on diff notes ## Summary `DiffNote`, and `LegacyDiffNote` returns empty array for `mentionable_attrs`, because `mentionable_attrs` is not inheritable by subclasses. The problem can be illustrated with this small sample: ```ruby module Mentionable extend ActiveSupport::Concern module ClassMethods def attr_mentionable(attr) mentionable_attrs << [attr.to_s] end def mentionable_attrs @mentionable_attrs ||= [] end end end class A include Mentionable attr_mentionable :foo end class B < A end A.mentionable_attrs => [["foo", {}]] B.mentionable_attrs => [] ``` Possible solution using `cattr_accessor`: ```ruby module Mentionable extend ActiveSupport::Concern module ClassMethods def attr_mentionable(attr) mentionable_attrs << [attr.to_s] end end included do cattr_accessor :mentionable_attrs, instance_accessor: false do [] end end end class A include Mentionable attr_mentionable :foo end class B < A end A.mentionable_attrs => [["foo"]] B.mentionable_attrs => [["foo"]] B.mentionable_attrs < [:bar] => [["foo"], ["bar"]] A.mentionable_attrs => [["foo"], ["bar"]] ``` `mentionable_attrs` is inheritable by subclasses. If a subclass changes the value then that would also change the value for parent class. Similarly if parent class changes the value then that would change the value of subclasses too. ## What are the relevant issue numbers? Fixes #19807 Fixes #18022 /cc @stanhu @DouweM @rspeicher See merge request !5243
| * | Use cattr_accessor instead duplicating code on NoteOnDiff concernDouglas Barbosa Alexandre2016-07-153-9/+9
| | |
| * | Fix mentioned users list on diff notesDouglas Barbosa Alexandre2016-07-151-0/+3
| |/
* | Revert "Optimistic locking for Issue and Merge Requests"revert-lock-for-issuableStan Hu2016-07-131-6/+0
|/ | | | This reverts commit c39356998b1850f3dc26fe0b987cb419c1d1afb4.
* Optimistic locking for Issue and Merge RequestsValery Sizov2016-07-121-0/+6
|
* Remove duplication, unused methods, and some other style thingsDouwe Maan2016-07-061-2/+0
|
* Add some more code comments.Douwe Maan2016-07-061-0/+1
|
* Extract parts of LegacyDiffNote into DiffOnNote concern and move part of ↵Douwe Maan2016-07-061-0/+53
| | | | responsibility to other classes
* Merge branch 'master' into dev-masterTomasz Maczukin2016-07-021-1/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (98 commits) Enable Style/EmptyLines cop, remove redundant ones Update CHANGELOG Cache results from jQuery selectors to retrieve namespace name Fix import button when import fail due the namespace already been taken Fix snippets comments not displayed Fix emoji paths in relative root configurations Exclude requesters from Project#members, Group#members and User#members Upgrade Thin from 1.6.1 to 1.7.0. Many squashed commits Cache autocomplete results Upgrade Sidekiq from 4.1.2 to 4.1.4. Upgrade seed-fu from 2.3.5 to 2.3.6 use has_many relationship with events Support creating a todo on issuables via API Expose target, filter by state as string Add todos API documentation and changelog Improve the request / withdraw access button Metrics for Rouge::Plugins::Redcarpet and Rouge::Formatters::HTMLGitlab Groundwork for Kerberos SPNEGO (EE feature) Update CHANGELOG 8.9.5 for runners related fixes ...
| * Enable Style/EmptyLines cop, remove redundant onesrubocop/enable-cops-for-empty-linesGrzegorz Bizon2016-07-011-1/+0
| |
* | Ensure logged-out users can't see private refsSean McGivern2016-06-301-1/+1
|/
* Preload notes/discussions associations (award_emoji: :user)optimize-award-emojiPaco Guzman2016-06-232-10/+20
|