summaryrefslogtreecommitdiff
path: root/app/models
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch ↵Dmitriy Zaporozhets2016-10-241-1/+1
|\ | | | | | | | | | | 'yesbabyyes/gitlab-ce-22967-adding-zero-users-to-group-reports-success' Merge request - https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6979
| * Revert "Change "Group#web_url" to return "/groups/twitter" rather than ↵Dmitriy Zaporozhets2016-10-241-1/+1
| | | | | | | | | | | | "/twitter"." This reverts commit c81ff152e08d58c13efbd50c40dd2e083ac65083.
* | Merge branch '21513-fix-branch-protection-api' into 'master' Douwe Maan2016-10-241-0/+5
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix branch protection API. ## What does this MR do? - Fixes the branch protection API. - Closes #21513 - EE Merge Request: gitlab-org/gitlab-ee!718 ## Tasks - [ ] #21513 !6215 Protected branches API bug - [x] Investigate - [x] Test + Fix - [x] Changelog - [x] MR - [x] Wait for build to pass - [x] Review - [x] Check for EE conflicts - [x] Create EE MR - [x] Refactor + Fix - [x] Rebase EE MR against EE master - [x] Wait for builds to pass - [x] Assign to dbalexandre/douwe - [x] Implement latest review comments - [x] Wait for Douwe's review - [x] Implement changes - [x] Port changes to EE MR - [x] Assign both back to Douwe - [ ] Wait for merge - [ ] Merge gitlab-org/gitlab-ee!718 See merge request !6215
| * | Implement review comments from @DouweM.Timothy Andrew2016-10-241-2/+2
| | |
| * | Fix branch protection API.Timothy Andrew2016-10-241-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Previously, we were not removing existing access levels before creating new ones. This is not a problem for EE, but _is_ for CE, since we restrict the number of access levels in CE to 1. 2. The correct approach is: CE -> delete all access levels before updating a protected branch EE -> delete developer access levels if "developers_can_{merge,push}" is switched off 3. The dispatch is performed by checking if a "length: 1" validation is present on the access levels or not. 4. Another source of problems was that we didn't put multiple queries in a transaction. If the `destroy_all` passes, but the `update` fails, we should have a rollback. 5. Modifying the API to provide users direct access to CRUD access levels will make things a lot simpler. 6. Create `create/update` services separately for this API, which perform the necessary data translation, before calling the regular `create/update` services. The translation code was getting too large for the API endpoint itself, so this move makes sense.
* | | Merge branch 'remove-callback' into 'master' Rémy Coutable2016-10-241-4/+2
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | This MR removes AR before_validation callback in favor setter. ## Why was this MR needed? Because setters is good practice to normalize model attributes instead AR callbacks. Because new object should be valid right after initialization. If it MR interested I can try to find other places where we can use setters. See merge request !6763
| * | refactor(email): use setter method instead AR callbacksSemyon Pupkov2016-10-231-4/+2
| |/
* | Remove duplicate code in repository cache clearingsh-flush-cache-after-importStan Hu2016-10-231-8/+1
| |
* | Expire and build repository cache after project importStan Hu2016-10-231-4/+14
|/ | | | | | | | | After a project import, there's a chance that the UI checks the branch count before the project has been imported. This change causes more of the keys to be flushed after an import and forces a rebuild of the repository cache. Closes #13518
* Merge branch 'adam-fix-group-web-url' into 'master' Sean McGivern2016-10-211-1/+1
|\ | | | | | | | | | | | | Change "Group#web_url" to return "/groups/twitter" rather than "/twitter" Fixes #23527 See merge request !7035
| * Change "Group#web_url" to return "/groups/twitter" rather than "/twitter".Adam Niedzielski2016-10-211-1/+1
| | | | | | | | | | Bring back the old behaviour which was changed by 6b90ccb9. Fixes #23527.
* | Merge branch '14192-issues-closed-by-merge-requests-using-metrics-data' into ↵Yorick Peterse2016-10-211-1/+7
|\ \ | |/ |/| | | | | | | | | | | 'master' Use MergeRequestsClosingIssues cache data on Issue#closed_by_merge_requests method See merge request !6996
| * Use MergeRequestsClosingIssues cache data on Issue#closed_by_merge_requests ↵14192-issues-closed-by-merge-requests-using-metrics-dataPaco Guzman2016-10-201-1/+7
| | | | | | | | method
* | Merge branch 'fix/validate-board-limit' into 'master' Douwe Maan2016-10-201-0/+7
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | [ci skip] Add a comment explaining validate_board_limit callback ## What are the relevant issue numbers? https://gitlab.com/gitlab-org/gitlab-ee/issues/929 See merge request !7023
| * | [ci skip] Add a comment explaining validate_board_limit callbackfix/validate-board-limitDouglas Barbosa Alexandre2016-10-201-0/+7
| | | | | | | | | | | | | | | | | | Callback associations are not common to see around. We want to make clear that the `before_add` callback uses the number before the addition, in this particular case 1.
* | | Merge branch 'zj-use-iid-deployment-refs' into 'master' Kamil Trzciński2016-10-202-4/+4
|\ \ \ | |/ / |/| | | | | | | | | | | | | | Use iid deployment refs This fixes the 404, because `find_by` will return nil instead of throwing an error. See merge request !7021
| * | Only create refs for new deploymentszj-use-iid-deployment-refsZ.J. van de Weg2016-10-201-1/+1
| | | | | | | | | | | | | | | | | | This patch makes sure GitLab does not save the refs to the filesystem each time the deployment is updated. This will save some IO although I expect the impact to be minimal.
| * | Use deployment IID when saving refsZ.J. van de Weg2016-10-202-3/+3
| | |
* | | Merge branch 'update-duration-at-the-end-of-pipeline' into 'master' Rémy Coutable2016-10-201-3/+0
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update duration at the end of pipeline ## What does this MR do? Moves duration calculation to be done only once at the end of pipeline processing. Currently this is done every one build. ## Why was this MR needed? This is the simplest thing that we can do before properly implementing duration calculation: https://gitlab.com/gitlab-org/gitlab-ce/issues/23523#note_17145614 This is ~Performance improvement that significantly affects: http://performance.gitlab.net/dashboard/db/sidekiq-workers?var-worker=PipelineUpdateWorker%23perform&var-database=Production&from=now-1h&to=now See merge request !6987
| * | | Update duration at the end of pipelineupdate-duration-at-the-end-of-pipelineKamil Trzcinski2016-10-201-3/+0
| | | |
* | | | Merge branch 'render-hipchat-notification-descriptions' into 'master' Rémy Coutable2016-10-201-22/+36
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Render HipChat notification descriptions as HTML instead of raw markdown ## What does this MR do? Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/1621 for issues, merge requests and comments. ## Are there points in the code the reviewer needs to double check? This MR is small enough to double check everything. ## Why was this MR needed? Because seeing raw markdown in HipChat notifications is not nice :) See merge request !6371
| * | | | Return truncation for notification descriptions, fix minor bugs with renderingAirat Shigapov2016-10-201-6/+11
| | | | |
| * | | | Use guard clause instead of if-else statementAirat Shigapov2016-10-201-13/+12
| | | | |
| * | | | Clean up Banzai HTML for HipChatDavid Eisner2016-10-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `class` and `data-*` attributes are meaningless in HipChat, and it would probably be better to limit the tags, too. For example, we could avoid block-level elements in `render_line`.
| * | | | Ensure absolute URLs for single lines from Banzai for HipChatDavid Eisner2016-10-201-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "pipeline: :single_line" leaves the protocol/host part out of the URLs and caches them that way. To avoid giving those out to HipChat, markdown is always rendered with "pipeline: :email" first. There must be a better way to do this, but I can't see how to avoid the link caching.
| * | | | Absolute URLs for Banzai HTML for HipChatDavid Eisner2016-10-201-11/+21
| | | | | | | | | | | | | | | | | | | | | | | | | Using "pipeline: :email" gets "only_path: false" into the context to produce full URLs instead of /namespace/project/...
| * | | | Also render commit titles in HipChat notificationsDavid Eisner2016-10-201-4/+8
| | | | |
| * | | | Full Banzai rendering for HipChat notificationsDavid Eisner2016-10-201-11/+3
| | | | |
| * | | | Render hipchat notification descriptions as HTML instead of raw markdownAirat Shigapov2016-10-201-6/+3
| | | | |
* | | | | Merge branch '23341-fix-viewing-mr-from-deleted-project' into 'master' Douwe Maan2016-10-201-17/+8
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a 500 error viewing an MR with a deleted source project ## What does this MR do? Allows merged MRs to be shown without any 500 errors if the source project is removed ## Are there points in the code the reviewer needs to double check? https://gitlab.com/gitlab-org/gitlab-ce/commit/31c37c6c38258684fc92e0d91119c33872e39034 fixed this for closed MRs only. I had trouble understanding the introduced helper and logic, so reverted it and keyed everything on the existence of the source project or branch directly. commits.json returns a 500 error for a closed or merged MR; the approach taken in the above MR was to hide the commits... tab, so I've run with that. For merged MRs, the commits (but not the pipeline data) are in the target project, so we *could* do better, but it's a fairly nasty intervention to make it happen. ## Why was this MR needed? Viewing merged MRs should work even if the fork they came from has been deleted or unlinked. ## Screenshots (if relevant) ![Screen_Shot_2016-10-19_at_17.56.37](/uploads/1aeadd5147b9a4ad29b946b1c7ea52cb/Screen_Shot_2016-10-19_at_17.56.37.png) ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG.md) 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 [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [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 it does - 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 #23341 See merge request !6991
| * | | | Rename forked_source_project_missing? to source_project_missing?Nick Thomas2016-10-201-3/+3
| | | | |
| * | | | Fix the merge request view when source projects or branches are removedNick Thomas2016-10-201-9/+6
| | | | |
| * | | | Revert "Add #closed_without_source_project?"Nick Thomas2016-10-201-8/+2
| | |_|/ | |/| | | | | | | | | | | | | | | | | | This reverts commit 31c37c6c38258684fc92e0d91119c33872e39034. See #23341
* | | | Merge branch 'issue_22944' into 'master' Sean McGivern2016-10-201-6/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create project feature when project is created closes #22944 See merge request !6908
| * | | | Create project feature when project is createdissue_22944Felipe Artur2016-10-191-6/+1
| |/ / /
* | | | Merge branch 'refactoring_find_commits_method' into 'master' Sean McGivern2016-10-201-3/+6
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | | | | | | | | | Refactoring find_commits method It's possible that `find_commits_by_message` return nil in array which is not OK. We have different checks outside of this method. This MR places all checks inside the method. See merge request !7000
| * | | Refactoring find_commits functionalityValery Sizov2016-10-201-3/+6
| | |/ | |/|
* | | Differentiate the expire from leave eventCallum Dryden2016-10-203-3/+18
| |/ |/| | | | | | | | | | | | | | | | | At the moment we cannot see weather a user left a project due to their membership expiring of if they themselves opted to leave the project. This adds a new event type that allows us to make this differentiation. Note that is not really feasable to go back and reliably fix up the previous events. As a result the events for previous expire removals will remain the same however events of this nature going forward will be correctly represented.
* | Merge branch 'feature/group-level-labels' into 'master' Douwe Maan2016-10-1912-65/+201
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add group level labels ## What does this MR do? Add group level labels. ## Are there points in the code the reviewer needs to double check? * `LabelsFinder` * `Gitlab::Gfm::ReferenceRewriter` * `Banzai::Filter::LabelReferenceFilter` ## Why was this MR needed? We'll be adding more feature that allow you to do cross-project management of issues. ## Screenshots (if relevant) * Group Labels ![Group Labels](/uploads/2244c06ad68eae4fb246fb4c81bf8060/2.png) * Project Labels ![Project Labels](/uploads/c5839516d2282b51f7418d9dadbeceb4/1.png) * Expanded references for group labels when moving issue to another project ![Expanded references for group labels when moving issue to another project](/uploads/0c9ab248a8420d4978d59349ae3d42e5/3.png) ## 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 - [ ] All builds are passing - [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [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) ## What are the relevant issue numbers? #19997 See merge request !6425
| * | Rename Labels::CreateService to Labels::FindOrCreateServiceDouglas Barbosa Alexandre2016-10-191-1/+1
| | |
| * | Add self.project_foreign_key on both Issue and MergeRequestDouglas Barbosa Alexandre2016-10-193-7/+9
| | |
| * | Remove unused method Project#all_labelsDouglas Barbosa Alexandre2016-10-191-4/+0
| | |
| * | Update specs to cope with new label types and prioritiesJames Lopez2016-10-191-0/+4
| | | | | | | | | | | | | | | | | | Fixed all related specs and also changed the logic to handle edge cases. This includes exporting and exporting of group labels, which will get associated with the new group (if any) or they will become normal project labels otherwise. Found other issues to do with not being able to import all labels at once in the beginning of the JSON - code was much simpler when we import all labels and milestones associated to a project first, then the associations will find the already created labels instead of creating them from the associations themselves.
| * | Fix max number of permitted priorities per project labelDouglas Barbosa Alexandre2016-10-191-2/+2
| | |
| * | Use join instead of subquery on Label.unprioritized scopeDouglas Barbosa Alexandre2016-10-191-1/+8
| | |
| * | User Labes::CreateService to create labelsDouglas Barbosa Alexandre2016-10-191-1/+2
| | |
| * | Fix sorting merge requests by priorityDouglas Barbosa Alexandre2016-10-191-1/+7
| | |
| * | Use keyword arguments on Sortable#highest_label_priorityDouglas Barbosa Alexandre2016-10-193-8/+19
| | |
| * | Add subject to group and projects labels which return group/projectDouglas Barbosa Alexandre2016-10-192-0/+4
| | |
| * | Abstract LabelPriority away into methods on Label modelDouglas Barbosa Alexandre2016-10-191-1/+15
| | |