summaryrefslogtreecommitdiff
path: root/app/models
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | | | Soft delete issuablesZeger-Jan van de Weg2016-03-193-1/+10
| | | | | |
| * | | | | Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into ↵James Lopez2016-03-2135-321/+705
| |\ \ \ \ \ | | | |/ / / | | |/| | | | | | | | | fix/safe-import-url
| | * | | | Merge branch 'issues-show-performance' into 'master' Robert Speicher2016-03-214-12/+32
| | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve performance of viewing individual issues This MR does two things: 1. `Issue#related_branches` no longer performs Git operations that aren't needed 2. The output of `Repository#exists?` is now cached and flushed properly Combined these two changes should further cut down the amount of Git operations performed when viewing individual issues (and possibly other pages). See merge request !3296
| | | * | | | Cache output of Repository#exists?Yorick Peterse2016-03-193-9/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This caches the output of Repository#exists? in Redis while making sure it's flushed properly when creating new repositories, deleting them, etc. For the ProjectWiki tests to work I had to make ProjectWiki#create_repo! public as testing private methods in RSpec is a bit of a pain.
| | | * | | | Tweaked performance of Issue#related_branchesYorick Peterse2016-03-191-3/+3
| | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requesting the branch names of a repository works even when it's empty, thus there's no need to explicitly check for an empty repository. Removing this check cuts down the amount of Git operations which in turn cuts down request timings a bit. The regular expression used to compare branches was also moved out of the loop so it's created only once.
| | * | | | Merge branch 'master' into feature/issue-moveGrzegorz Bizon2016-03-202-5/+10
| | |\ \ \ \ | | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: Fix bug where wrong commit ID was being used in a merge request diff to show old image Remove CHANGELOG item that was added during merge resolution Improve the "easy WIP & un-WIP from link" feature Fix specs \#to_branch_name now uses the iid as postfix Add label description in tooltip to labels in issue index and sidebar Easily (un)mark merge request as WIP using link Use specialized system notes when MR is (un)marked as WIP another attempt to fix oauth issue attempting to fix omniauth problem Conflicts: app/assets/javascripts/issuable_form.js.coffee
| | * | | | Merge branch 'master' into feature/issue-moveGrzegorz Bizon2016-03-1911-73/+169
| | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (121 commits) Dedupe labels in labels selector in Dashboard pages Refactor colors and lists Add a safeguard in MergeRequest#compute_diverged_commits_count Fix an issue when the target branch of a MR had been deleted Add avatar to issue and MR pages header Cleanup somce css colors Re-group scss variables Refactor `Todo#target` Fixes issue with filter label missing on labels & milestones Rename `Todo#to_reference` to `Todo#target_reference` Fixed failing tests Updated controller with before_action Fixed other issues based on feedback Fixes issue on dashboard issues Full labels data in JSON Fixed issue with labels dropdown getting wrong labels Update CHANGELOG Use `Note#for_project_snippet?` to skip notes on project snippet Use `Commit#short_id` instead of `Commit.truncate_sha` Reuse `for_commit?` on conditional validations Update schema info comment on todo related files ... Conflicts: app/models/issue.rb db/schema.rb spec/models/issue_spec.rb
| | * | | | | Improvements in issue move feaure (refactoring)Grzegorz Bizon2016-03-191-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | According to endbosses' suggestions.
| | * | | | | Prevent issue move if issue has been already movedGrzegorz Bizon2016-03-171-0/+12
| | | | | | |
| | * | | | | Add field that references issue this issue has been moved toGrzegorz Bizon2016-03-171-0/+3
| | | | | | |
| | * | | | | Add feature specs for issue moveGrzegorz Bizon2016-03-171-1/+1
| | | | | | |
| | * | | | | Add access-level filter support for projects selectGrzegorz Bizon2016-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This also refactores ProjectSelect adding some decorator-like functions.
| | * | | | | Make it possible to move issue if user is a reporterGrzegorz Bizon2016-03-171-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Discussed it here: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2831#note_4190228
| | * | | | | Add issue move ability and use it in move serviceGrzegorz Bizon2016-03-171-1/+2
| | | | | | |
| * | | | | | update safe_import_url to prevent tokens to be showed by the UIJames Lopez2016-03-211-0/+1
| | | | | | |
* | | | | | | Fix specDouwe Maan2016-03-211-2/+7
| | | | | | |
* | | | | | | Fix specsDouwe Maan2016-03-201-2/+2
| | | | | | |
* | | | | | | Fix some specsDouwe Maan2016-03-201-8/+2
| | | | | | |
* | | | | | | Fix group project selection in IssuableFinderDouwe Maan2016-03-202-5/+1
| | | | | | |
* | | | | | | Tweaks, refactoring, and specsDouwe Maan2016-03-203-39/+41
| | | | | | |
* | | | | | | Merge branch 'master' into issue_12658Douwe Maan2016-03-2013-58/+156
|\ \ \ \ \ \ \ | | |_|_|/ / / | |/| | | | |
| * | | | | | Merge branch 'remove-wip' into 'master' Jacob Schatz2016-03-191-1/+7
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Easily (un)mark merge request as WIP using link Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/3768 and https://gitlab.com/gitlab-org/gitlab-ce/issues/3516 ## Link to add `WIP` prefix (underline is visible because of hover) ![wipless_title](/uploads/72a6f7119ba9d8043ca8329641e97c3b/wipless_title.png) ## Link to remove `WIP` prefix ![wip_title](/uploads/8620ad65da9ef620b180603520fead55/wip_title.png) ## System note after WIP is added ![wip_sysnote](/uploads/2de073b75e854d2c9e243eb8b5d5c259/wip_sysnote.png) ## Widget with link to remove WIP ![wip_widget](/uploads/cf83ea93743c4c26d9df759c17cb9d7b/wip_widget.png) ## Flash after WIP is removed ![wip_flash](/uploads/27b7240cd5d7ceeb8b7b477abd94d7ff/wip_flash.png) ## System note after WIP is removed ![wipless_sysnote](/uploads/c0d3368abdf21a2f253532a9a9594d90/wipless_sysnote.png) ## Widget when current user cannot remove the WIP prefix ![wip_widget_unauthorized](/uploads/174ccf1674be86dc81c3078fe297acb7/wip_widget_unauthorized.png) cc @creamzy See merge request !3006
| | * \ \ \ \ \ Merge remote-tracking branch 'origin/master' into remove-wipRémy Coutable2016-03-1839-434/+843
| | |\ \ \ \ \ \ | | | | |_|/ / / | | | |/| | | |
| | * | | | | | Improve the "easy WIP & un-WIP from link" featureRémy Coutable2016-03-181-1/+1
| | | | | | | |
| | * | | | | | Merge branch 'master' into remove-wipDouwe Maan2016-02-292-13/+41
| | |\ \ \ \ \ \
| | * | | | | | | Use specialized system notes when MR is (un)marked as WIPDouwe Maan2016-02-261-1/+7
| | | | | | | | |
| * | | | | | | | Merge branch 'issue-branch-iid-postfix' into 'master' Douwe Maan2016-03-191-4/+3
| |\ \ \ \ \ \ \ \ | | |_|_|/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #to_branch_name now uses the iid as postfix Given the branch name 'mep-mep' with an iid being 1, the current way, master's way, would yield a branch name of 1-mep-mep. The problem for larger projects however would be that a developer might forget what iid the issue was. When this developer would try to tab complete it would: - Or result in 20+ branches possibly - Or start with the wrong digit, try again with digit++ - Would see 20 branches, repeat Thus the obvious way of solving this is letting the dev tab complete on the issue title, which is easier to remember. @DouweM Should this be labelled `pick-in-master`? See merge request !3308
| | * | | | | | | \#to_branch_name now uses the iid as postfixissue-branch-iid-postfixZeger-Jan van de Weg2016-03-181-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given the branch name 'mep-mep' with an iid being 1, the current way, master's way, would yield a branch name of 1-mep-mep. The problem for larger projects however would be that a developer might forget what iid the issue was. When this developer would try to tab complete it would: - Or result in 20+ branches possibly - Or start with the wrong digit, try again with digit++ - Would see 20 branches, repeat Thus the obvious way of solving this is letting the dev tab complete on the issue title, which is easier to remember.
| * | | | | | | | Add a safeguard in MergeRequest#compute_diverged_commits_countRémy Coutable2016-03-181-1/+4
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have to ensure source_sha and target_sha are not nil before calling Gitlab::Git::Commit.between.
| * | | | | | | Refactor `Todo#target`Douglas Barbosa Alexandre2016-03-181-5/+1
| | | | | | | |
| * | | | | | | Rename `Todo#to_reference` to `Todo#target_reference`Douglas Barbosa Alexandre2016-03-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we're not actually returning a todo reference.
| * | | | | | | Use `Commit#short_id` instead of `Commit.truncate_sha`Douglas Barbosa Alexandre2016-03-181-1/+1
| | | | | | | |
| * | | | | | | Reuse `for_commit?` on conditional validationsDouglas Barbosa Alexandre2016-03-181-2/+2
| | | | | | | |
| * | | | | | | Update schema info comment on todo related filesDouglas Barbosa Alexandre2016-03-181-2/+3
| | | | | | | |
| * | | | | | | Use todo.done without ! in the controller to mark todo as doneDouglas Barbosa Alexandre2016-03-181-1/+1
| | | | | | | |
| * | | | | | | Trigger a todo for mentions on commits pageDouglas Barbosa Alexandre2016-03-181-1/+28
| | | | | | | |
| * | | | | | | Merge branch 'fix-mr-source-sha' into 'master' Douwe Maan2016-03-181-1/+5
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix MergeRequest#source_sha when there is no diff Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/14170 ### Overview This MR fixes an unhandled Exception when visiting the page of an open Merge Request without diff. ### Description `MergeRequest#source_sha` is expected to return the sha of the source branch last commit. But when an open Merge Request has no diff (e.g. all commits have already been merged to the target branch), `merge_request.source_sha` incorrectly returns `nil`. This was without consequences before – but since !2217 was merged (a few days ago), it makes `Gitlab::Git::Commit.between` raise an "Unexpected nil argument" exception. This can be reproduced when visiting the http://localhost:3000/gitlab-org/gitlab-test/merge_requests/2 page on a fresh local Gitlab setup. This MR fixes the crash, by making sure that `source_sha` returns a correct result even when there is no diff available. I also added tests. @DouweM I believe you wrote most of this code in the first place ; does this looks correct to you, or is there a better way to resolve this issue maybe? See merge request !3135
| | * | | | | | | Fix MergeRequest#source_sha when there is no diffPierre de La Morinerie2016-03-161-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `MergeRequest#source_sha` is expected to return the sha of the source branch last commit. But when a open Merge Request has no diff (e.g. all commits have already been merged to the target branch), `merge_request.source_sha` incorrectly returns `nil`. This was un-noticed before – but now that !2217 has been merged, it makes `Gitlab::Git::Commit.between` raise an "Unexpected nil argument" exception. This fixes the crash, by making sure that `source_sha` returns a correct result even when there is no diff available.
| * | | | | | | | Merge branch 'confidential-issues' into 'master' Douwe Maan2016-03-185-13/+41
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add confidential issues Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/3678 More information: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/227 See merge request !3282
| | * | | | | | | | Restrict access to confidential issues on activity feedDouglas Barbosa Alexandre2016-03-171-2/+4
| | | | | | | | | |
| | * | | | | | | | Restrict access for confidential issues on milestone viewDouglas Barbosa Alexandre2016-03-172-10/+14
| | | | | | | | | |
| | * | | | | | | | Restrict access to confidential issuesDouglas Barbosa Alexandre2016-03-172-1/+23
| | | | | | | | | |
| * | | | | | | | | Don't rebuild diverging commit count cachesYorick Peterse2016-03-171-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calling Repository#build_cache we _don't_ want to build the diverging commit count cache as doing so can be _very_ slow for repositories with lots of branches. Because these caches are built whenever needed (= when actually viewing the list of branches in the web UI) we can safely remove this code from Repository#build_cache.
| * | | | | | | | | Removed Repository#rebuild_cacheYorick Peterse2016-03-171-12/+0
| |/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | This method is not used or tested anywhere.
| * | | | | | | | Cache project avatars stored in GitYorick Peterse2016-03-172-7/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The avatar logic has been moved from Project to Repository as this makes caching easier. The logic itself in turn has been changed so that the logo file names are cached in Redis. This cache is flushed upon pushing a commit but _only_ if: 1. The commit was pushed to the default branch 2. The commit actually changes any of the logo files If no branch or commit is given the cache is flushed anyway, this ensures that calling Repository#expire_cache without any arguments still flushes the avatar cache (e.g. this is used when removing a project). Fixes gitlab-org/gitlab-ce#14363
| * | | | | | | | Merge branch 'glalonde-triggerbuild' into 'master' Kamil Trzciński2016-03-171-1/+1
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adjusted behavior so canceled builds tagged as allowed to fail do not fail build ## What does this MR do? This diff changes the 'Allowed to fail' flag to also ignore canceled builds, whereas before, canceled builds could fail the suite even if they were marked as 'Allowed to fail' dupe of !3258 to force a build ## Are there points in the code the reviewer needs to double check? no ## Why was this MR needed? Unexpected behavior as a user ## What are the relevant issue numbers? ## Screenshots (if relevant) ![whatisgoingon](/uploads/fcd7c8f3d8454bc730d7fd41eff59b31/whatisgoingon.png) See merge request !3271
| | * | | | | | | | adjusted behavior so canceled builds tagged as allowed to fail do not fail buildGeoffrey Lalonde2016-03-171-1/+1
| | |/ / / / / / /
| * | | | | | | | Merge branch '4009-external-users' into 'master' Douwe Maan2016-03-173-23/+30
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | External Users The user has the rights of a public user execpt it can never create a project, group, or team. Also it cant view internal projects. Partially fix for both #4009 and #13938 (except the LDAP sync or a pattern to detect external users) ![Screen_Shot_2016-03-14_at_22.02.52](/uploads/486a84ab3acb98c6cfb71a4ec7d268e2/Screen_Shot_2016-03-14_at_22.02.52.png) See merge request !3171
| * | | | | | | | | Fix specsZeger-Jan van de Weg2016-03-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Spinach was right, I was a fool..
| * | | | | | | | | Merge branch 'master' into new-branch-button-issueZeger-Jan van de Weg2016-03-174-7/+11
| |\ \ \ \ \ \ \ \ \ | | | |_|_|_|_|/ / / | | |/| | | | | | |