summaryrefslogtreecommitdiff
path: root/app/models
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'issue_23032' into 'master' Sean McGivern2016-11-041-0/+15
|\ | | | | | | | | | | | | Allow to test JIRA service when project does not have repository closes #23032 See merge request !7162
| * Allow to test JIRA service when project does not have repositoryissue_23032Felipe Artur2016-11-041-0/+15
| |
* | Merge branch 'show-status-from-branch' into 'master' Rémy Coutable2016-11-041-4/+11
|\ \ | | | | | | | | | | | | | | | | | | Show pipeline status from branch and commit than only commit Closes #23615 See merge request !7034
| * \ Merge remote-tracking branch 'upstream/master' into show-status-from-branchLin Jen-Shin2016-11-044-7/+39
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * upstream/master: (35 commits) Only skip group when it's actually a group in the "Share with group" select Fix: Todos Filter Shows All Users Fix: Guest sees some repository details and gets 404 Move shared params to a helper GrapeDSL for project hooks Update commits.scss updated styling commit SHA on branches page + added to changelog change build list height to show 6,5 builds + improve padding of list, with first/last child selectors Ignore builds directory from eslint Add changelog entry Document multiple repository storage paths Allow multiple repository storage shards to be enabled, and automatically round-robin between them Cleaned up global namespace JS Add tip for using Chrome to run and debug teaspoon tests. Add CHANGELOG entry file Add jquery.timeago.js to application.js Update match-regex to fix filename convention Move jquery.timeago to vendor directory Change a bunch of doc links to either relative or https://docs.gitlab.com. Show log corresponding to env in admin/logs ...
| * \ \ Merge remote-tracking branch 'upstream/master' into show-status-from-branchLin Jen-Shin2016-11-041-1/+1
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * upstream/master: (74 commits) Clarify the author field for the changelog documentation Add and update .gitignore & .gitlab-ci.yml templates for 8.14 Update "Installation from source" guide for 8.14.0 Add CHANGELOG entries for latest patches Merge branch 'fix/import-export-symlink-vulnerability' into 'security' Merge branch 'fix/import-projectmember-security' into 'security' Use stubs instead of modifying global states Add changelog instructions to CHANGELOG.md Try not to include anything globally! Update help banner for bin/changelog Add a `--force` option to bin/changelog Update examples in changelog docs to use single quotes around title Use the server's base URL without relative URL part when creating links in JIRA Update docs and test description Update docs and unexpose token Make ESLint ignore instrumented files for coverage analysis (!7236) Initialize form validation on new group form. Check that JavaScript file names match convention (!7238) Unchange username_validator. Move snake_case to camelCase. ...
| * | | | Initialize @statuses in status rather than constructorLin Jen-Shin2016-11-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7034#note_17742312
| * | | | Merge status_for and status, feedback:Lin Jen-Shin2016-11-031-5/+1
| | | | | | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7034#note_17742297
| * | | | Merge remote-tracking branch 'upstream/master' into show-status-from-branchLin Jen-Shin2016-11-0225-197/+246
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * upstream/master: (126 commits) Allow to search for user by secondary email address in the admin interface Rename :name search parameter to :search_query at /admin/users Fix project features default values Add a link to the Issue Boards API in main README Fix Markdown styling inside reference links Fix relative links in Markdown wiki when displayed in "Project" tab Flexbox webkit prefixes Tests update Tests update Changed where merge request link is New todos blank state Implement CreateMembers service to make controller thin Do not show tooltip for active element (!7105) Update CHANGELOG Assign local_assigns[:subject] to a variable on the shared label partial Use select instead of pluck on Project.group_ids Skip authorization check when searching for labels on IssuableFinder Use label subject to calculate number of issues/mrs within the group Remove unnecessary includes(:priorities) on Projects::LabelsController Add 8.13.2 CHANGELOG entries ...
| * | | | | It's not used as a public API right now, feedback:Lin Jen-Shin2016-10-281-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7034#note_17522443
| * | | | | Still show status from pipelines, see:Lin Jen-Shin2016-10-271-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7034#note_17397201 https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7034#note_17397461 https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6801#note_17468470 https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7034#note_17482654
| * | | | | Merge remote-tracking branch 'upstream/master' into show-status-from-branchLin Jen-Shin2016-10-261-1/+3
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * upstream/master: (65 commits) Fixed typo in css class Merge branch 'airat/gitlab-ce-23268-fix-milestones-filtering' into 'master' Escape quotes in gl_dropdown values to prevent exceptions Fixes various errors when adding deploy keys caused by not exiting the control flow. Fix typo on /help/ui to Alerts section Grapify tags API Add 8.13.1 CHANGELOG entries Fix sidekiq stats in admin area Remove use of wait_for_ajax since jQuery was removed Specify which Fog storage drivers are imported by default in backup_restore.md Moved avatar infront of labels Don't schedule ProjectCacheWorker unless needed Fixed height of sidebar causing scrolling issues Reduce overhead of LabelFinder by avoiding #presence call Fixed users profile link in sidebar Fixed new labels not being created Improve redis config tasks for migration paths job Ensure search val is defined. Ensure cursor is applied to end of issues search input. Increase debounce wait on issues search execution. Keep the new resque.yml aside and use it once we've checked out master ...
| * \ \ \ \ \ Merge remote-tracking branch 'upstream/master' into show-status-from-branchLin Jen-Shin2016-10-2516-35/+42
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * upstream/master: (67 commits) Stop unauthized users dragging on issue boards Capitalize Git Add docker-compose environment initialization command Improve readability and add specs for label filtering Improve label filtering implementation Allow the use of params[:name] when filtering labels Fix Rubocop offenses in issue move specs Add spec in Issues::MoveService to fix label assignment regression Fix bug where labels would be assigned to issues that were moved Fix `User#to_reference` Fix rubocop build error Remove redundant class_name and foreign_key overrides Enable SingleLinePerSelector in scss-lint Escape ref and path for relative links (!6050) Add failing test for #21420 Enable SpaceAfterVariableColon in scss-lint Enable SpaceAroundOperator in scss-lint Enable trailingWhitespace in scss-lint Disable Rails/Output cop since it makes no sense here Use File.write instead of File.open + File#write ...
| * | | | | | | Pass `@ref` along so we know which pipeline to showLin Jen-Shin2016-10-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #23615
* | | | | | | | Merge remote-tracking branch 'origin/labels-api'Rémy Coutable2016-11-041-4/+0
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See merge request !7014 Signed-off-by: Rémy Coutable <remy@rymai.me>
| * | | | | | | | Return conflict error in label API when title is taken by group labellabels-apiDouwe Maan2016-10-201-4/+0
| | | | | | | | |
* | | | | | | | | Merge branch '20968-add-setting-to-check-unresolved-discussion' into 'master' Douwe Maan2016-11-041-0/+7
|\ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add setting to only allow merge requests to be merged when all discussions are resolved _Originally opened at !6385 by @rodolfoasantos._ - - - ## What does this MR do? Based on #20968 this merge request adds setting only to allow merge requests to be merged when all discussions are resolved. ## Are there points in the code the reviewer needs to double check? Check if there are other points to add the resolved discussion setting ## Why was this MR needed? Add the possibility to configure the project to only accept merge request when all discussions are resolved ## Screenshots ![only_allow_merge_if_all_discussions_are_resolved](/uploads/9388db9421da0214590ffab6fb29f985/only_allow_merge_if_all_discussions_are_resolved.png) ![only_allow_merge_if_all_discussions_are_resolved_msg](/uploads/b1bba0c72ad67d3a1b34718baa08526e/only_allow_merge_if_all_discussions_are_resolved_msg.png) ## 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 - [ ] 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 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 #20968 See merge request !7125
| * | | | | | | | Add setting to only allow merge requests to be merged when all discussions ↵Rodolfo Santos2016-11-041-0/+7
| | |_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | are resolved Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | | | | | | Fix: Todos Filter Shows All Users22588-todos-filter-shows-all-usersValery Sizov2016-11-041-0/+1
|/ / / / / / /
* | | | | | | Allow multiple repository storage shards to be enabled, and automatically ↵Nick Thomas2016-11-042-5/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | round-robin between them
* | | | | | | Ensure merge request's "remove branch" accessors return booleans24102-cannot-unselect-remove-source-branch-when-editing-merge-requestRémy Coutable2016-11-031-2/+2
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | | | | Use the server's base URL without relative URL part when creating links in JIRABrian Kintz2016-11-021-1/+1
| |_|_|_|/ |/| | | | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | | | Merge branch 'Allow-admin-to-search-for-user-by-secondary-email-address' ↵Sean McGivern2016-11-011-0/+18
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into 'master' Allow admin to search for user by secondary email address Closes #23761 See merge request !7115
| * | | | | Allow to search for user by secondary email address in the admin interfaceYar2016-11-011-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not possible to search for a user by his secondary email address in the Users search bar in the admin interface(/admin/users). A use-case could be that an admin wants to remove a specific secondary email address of an user, because it interferes with another user. Issue #23761 This commit adds ability to search not only by main email, but also by any secondary email in the admin interface.
* | | | | | Fix project features default valuesFelipe Artur2016-11-012-1/+6
| | | | | |
* | | | | | Use select instead of pluck on Project.group_idsDouglas Barbosa Alexandre2016-10-311-1/+1
| | | | | |
* | | | | | Use label subject to calculate number of issues/mrs within the groupDouglas Barbosa Alexandre2016-10-313-15/+23
|/ / / / /
* | | | | Merge branch '22271-drone-tag-pipeline-build' into 'master' Douwe Maan2016-10-311-12/+12
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix lightweight tags not processed correctly by GitTagPushService ## What does this MR do? Fix lightweight tags not processed correctly by GitTagPushService ## Are there points in the code the reviewer needs to double check? No ## Why was this MR needed? Lightweight tags were being processed incorrectly, causing tag triggers to receive wrong information and not function properly. ## Does this MR meet the acceptance criteria? - [ ] [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) - [ ] API support added - Tests - [ ] 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) - [ ] 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) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Closes #22271 See merge request !6532
| * | | | | Fix lightweight tags not processed correctly by GitTagPushService22271-drone-tag-pipeline-buildAlejandro Rodríguez2016-10-281-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we updated gitlab_git to 10.4.1, `tag.target` changed from pointing to the sha of the tag to the sha of the commit the tag points to. The problem is that only annotated tags have `object_sha`s, lightweight tags don't (it's nil), so (only) in their case we still need to use `tag.target`.
* | | | | | Merge branch '23106-events-default-scope-results-in-a-slow-query' into 'master' Yorick Peterse2016-10-311-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimize Event queries by removing default order See merge request !7130
| * | | | | | Optimize Event queries by removing default order23106-events-default-scope-results-in-a-slow-queryAlejandro Rodríguez2016-10-271-1/+1
| | | | | | |
* | | | | | | Merge branch 'lfs_object_removal' into 'master' 23858-task-listsSean McGivern2016-10-311-0/+6
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unreferenced LFS objects from DB and fs Fixes #3666 See merge request !5901
| * | | | | | | Remove unreferenced LFS objects from DB and fsFrank Groeneveld2016-10-281-0/+6
| | | | | | | |
* | | | | | | | Merge branch 'dz-internal-api-fullpath' into 'master' Dmitriy Zaporozhets2016-10-281-0/+14
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make internal api work with full repo path and name ## What does this MR do? Make internal api work with full repo path and name ## Why was this MR needed? So we can pass full repository path on filesystem from gitlab-shell instead of extracted one. We need this for nested groups support where project is can be nested under several groups. ## What are the relevant issue numbers? https://gitlab.com/gitlab-org/gitlab-ce/issues/2772 See merge request !7148
| * | | | | | | | Refactor storage path extraction from full repo pathdz-internal-api-fullpathDmitriy Zaporozhets2016-10-281-0/+14
| | |_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | | | | | | | Merge branch '22392-add-x-of-y-tasks-completed-on-issuable' into 'master' Sean McGivern2016-10-284-4/+15
|\ \ \ \ \ \ \ \ | |_|_|_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | add "x of y tasks completed" on issuable Closes #22392 See merge request !6527
| * | | | | | | add "x of y tasks completed" on issuableGuilherme Salazar2016-10-284-4/+15
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix issues pointed out in !6527 add task completion status feature to CHANGELOG
* | | | | | | Merge branch ↵Rémy Coutable2016-10-281-8/+2
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '23872-members-of-group-that-has-project-access-getting-404-on-accessing-a-project-issue' into 'master' Fix project member access for group links Closes #23872. See merge request !7144
| * | | | | | | Fix project member access for group linksSean McGivern2016-10-281-8/+2
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `ProjectTeam#find_member` doesn't take group links into account. It was used in two places: 1. An admin view - it can stay here. 2. `ProjectTeam#member?`, which is often used to decide if a user has access to view something. This second part broke confidential issues viewing. `IssuesFinder` ends up delegating to `Project#authorized_for_user?`, which does consider group links, so users with access to the project via a group link could see confidential issues on the index page. However, `IssuesPolicy` used `ProjectTeam#member?`, so the same user couldn't view the issue when going to it directly.
* | | | | | | Merge branch 'adam-fix-labels-find-or-create' into 'master' Douwe Maan2016-10-281-1/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass user instance to Labels::FindOrCreateService or skip_authorization: true ## What does this MR do? It fixes a bug described in #23694 when `project.owner` was passed to `Labels::FindOrCreateService`. `Labels::FindOrCreateService` expected a user instance and `project.owner` may return a group as well. This MR makes sure that we either pass a user instance or `skip_authorization: true`. ## Are there points in the code the reviewer needs to double check? - places where we pass `skip_authorization: true` ## Does this MR meet the acceptance criteria? - 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) - [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? Fixes #23694 See merge request !7093
| * | | | | | | Pass user instance to Labels::FindOrCreateService or skip_authorization: trueadam-fix-labels-find-or-createAdam Niedzielski2016-10-281-1/+1
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not pass project.owner because it may return a group and Labels::FindOrCreateService throws an error in this case. Fixes #23694.
* | | | | | | Merge branch 'use-optimistic-locking' into 'master' Stan Hu2016-10-282-12/+12
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use optimistic locking ## What does this MR do? Removes the usage of pessimistic locking in favor of optimistic which is way cheaper and doesn't block database operation. Since this is very simple change it should be safe. If we receive `StaleObjectError` message we will reload object a retry operations in lock. However, I still believe that we need this one: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7005 as this will reduce a load on Database and FS. This changes a behavior from: ### Pesimistic locking (previous behavior) #### For updating 1. SELECT * FOR UPDATE (other updates wait on this) 2. we update ci_pipeline 3. latest_build_status 4. enqueue: (use: transition :created -> :pending) 5. [state_machine] we are in state created, we can go to pending 6. [state_machine] ci_pipeline.status = created 7. [state_machine] ci_pipeline.save 8. [state_machine] after_transition: (if for success): PipelineSuccessWorker on Sidekiq 9. release DB lock #### If no update is required 1. SELECT * FOR UPDATE (other updates wait on this) 2. we update ci_pipeline 3. latest_build_status 4. we are in pending, we can't transition to pending, because it's forbidden 5. release DB lock ### Optimistic locking (implemented by this MR) #### For updating 1. latest_build_status 2. enqueue: (use `transition :created -> :pending`) 3. [state_machine] we are in state created, we can go to pending 4. [state_machine] ci_pipeline.status = created 5. [state_machine] ci_pipeline.save 6. [state_machine] [save] where(lock_version: ci_pipeline.lock_version).update_all(status: :created, updated_at: Time.now) 7. [state_machine] [save] unless we_updated_row then raise ObjectInconsistentError #### If no update is required 1. we update ci_pipeline 2. latest_build_status 3. we are in pending, we can't transition to pending, because it's forbidden ## Why was this MR needed? We have been seeing a number of problems when we migrated Pipeline/Build processing to Sidekiq. Especially we started seeing a lot of blocking queries. We used a pessimistic locking which doesn't seem to be required. This effectively allows us to fix our issues with blocked queries by using more efficient method of operation. ## What are the relevant issue numbers? Issues: https://gitlab.com/gitlab-com/infrastructure/issues/623 and https://gitlab.com/gitlab-com/infrastructure/issues/584, but also there's a bunch of Merge Requests that try to improve behavior of scheduled jobs. cc @pcarranza @yorickpeterse @stanhu See merge request !7040
| * | | | | | Fix optimistic lockingKamil Trzcinski2016-10-261-6/+6
| | | | | | |
| * | | | | | Add tests for optimistic lockingKamil Trzcinski2016-10-261-1/+1
| | | | | | |
| * | | | | | Use optimistic lockingKamil Trzcinski2016-10-261-6/+6
| | |_|_|_|/ | |/| | | |
* | | | | | Merge branch '5905-duplicate-email-errors' into 'master' Rémy Coutable2016-10-281-1/+3
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only show one error message for an invalid email Changes it to only validate the notification_email format if it's different from email. Closes #5905 See merge request !7158
| * \ \ \ \ \ Merge branch 'master' into 5905-duplicate-email-errorsSteve Halasz2016-10-2716-36/+40
| |\ \ \ \ \ \ | | | |/ / / / | | |/| | | | | | | | | | | Getting latest CHANGELOG so I can resolve merge conflict
| * | | | | | Only show one error message for an invalid emailSteve Halasz2016-10-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If notification_email is blank, it's set from email. If an admin attempted to create a user with an invalid email, an error would be displayed for both fields. Only validate the notification_email if it's different from email.
* | | | | | | Merge branch '23928-sortable-highest_label_priority-is-bugged' into 'master' Rémy Coutable2016-10-282-4/+9
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix and improve `Sortable.highest_label_priority` Closes #23928 See merge request !7165
| * | | | | | | Fix and improve `Sortable.highest_label_priority`23928-sortable-highest_label_priority-is-buggedAlejandro Rodríguez2016-10-272-4/+9
| | |/ / / / / | |/| | | | |
* | | | | | | Merge branch 'issue_1008_1' into 'master' Sean McGivern2016-10-286-136/+122
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Jira refactoring to jira gem part of gitlab-org/gitlab-ee#1008 Original MR: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2572/commits See merge request !6598