summaryrefslogtreecommitdiff
path: root/app/controllers
Commit message (Collapse)AuthorAgeFilesLines
* Exclude requesters from Project#members, Group#members and User#membersexplicit-requesters-scopeRémy Coutable2016-07-015-8/+16
| | | | | | And create new Project#requesters, Group#requesters scopes. Signed-off-by: Rémy Coutable <remy@rymai.me>
* Merge branch 'enable-shared-runners-with-admins' into 'master' Rémy Coutable2016-07-012-4/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Admin should be able to turn shared runners into specific ones: ## What does this MR do? Make sure admins could turn shared runners into specific runners. ## Are there points in the code the reviewer needs to double check? Is this the desired behaviour? ## Why was this MR needed? Closes #19039 Closes #19272 ![Screen_Shot_2016-06-30_at_9.30.05_PM](/uploads/97eb3b4923fd4e498b1f8ca70b1345c8/Screen_Shot_2016-06-30_at_9.30.05_PM.png) See merge request !4961
| * Merge remote-tracking branch 'upstream/master' into ↵Lin Jen-Shin2016-07-017-17/+123
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | enable-shared-runners-with-admins * upstream/master: (120 commits) Update CHANGELOG for 8.9.4, 8.8.7, and 8.7.9. Remove additional entries from CHANGELOG Catch permission denied errors and ignore the disk Remove coveralls lines Make GH one-off auth the default again for importing GH projects Import from Github using Personal Access Tokens. Remove hardcoded gitlab-shell version in test env now that the required tag is published Updated breakpoint for sidebar pinning Expire branch/tag git data when needed. Remove unnecessary parens Enable Style/UnneededCapitalW Rubocop cop Expiry date on pinned nav cookie Fix broken spec in git_push_service_spec by stubbing an external issue tracker Handle external issues in IssueReferenceFilter Move Changelog entry for build retry fix to 8.9.4 Add Changelog entry for build sidebar retry link fix Improve method that tells if build is retryable Do not show build retry link when build is active Remove coveralls as its unused Move changelot item "Add sub nav to file page view" to 8.9.4 ...
| * | Use Ability to check pre-requisite. Change back to 403 because:Lin Jen-Shin2016-06-291-2/+1
| | | | | | | | | | | | If we're using `can?` it would look weird to use 409
| * | Allow admins to assign locked runners:Lin Jen-Shin2016-06-281-2/+0
| | | | | | | | | | | | | | | | | | And show information about locked status. Help! This looks bad :o
| * | Use 409 to indicate that interface might be outdatedLin Jen-Shin2016-06-281-2/+2
| | | | | | | | | | | | Because invalid actions shouldn't be shown on the page.
| * | Admin should be able to turn shared runners into specific ones:Lin Jen-Shin2016-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The regression was introduced by: https://gitlab.com/gitlab-org/gitlab-ce/commit/1b8f52d9206bdf19c0dde04505c4c0b1cf46cfbe I did that because there's a test specifying that a shared runner cannot be enabled, in the API. So I assume that is the case for non-admin, but admins should be able to do so anyway. Also added a test to make sure this won't regress again. Closes #19039
* | | Merge branch 'avoid-instantiate-tree-for-projects-show-readme-view' into ↵Yorick Peterse2016-07-011-1/+6
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | 'master' Avoid instantiation of a Git::Tree See merge request !4997
| * | Avoid instantiation of a Git::Treeavoid-instantiate-tree-for-projects-show-readme-viewPaco Guzman2016-06-291-1/+6
| | | | | | | | | Only needed when the project view is ‘Files view’
* | | Catch permission denied errors and ignore the diskimprove-system-infoJosh Frye2016-06-301-11/+38
| | |
* | | Make GH one-off auth the default again for importing GH projectsRémy Coutable2016-06-301-1/+1
| | | | | | | | | | | | | | | | | | Advertise the PAT as an alternative unless GH import is not configured. Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | Import from Github using Personal Access Tokens.Eric K Idema2016-06-301-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This stands as an alternative to using OAuth to access a user's Github repositories. This is setup in such a way that it can be used without OAuth configuration. From a UI perspective, the how to import modal has been replaced by a full page, which includes a form for posting a personal access token back to the Import::GithubController. If the user has logged in via GitHub, skip the Personal Access Token and go directly to Github for an access token via OAuth.
* | | Merge branch 'issue-18886' into 'master' Dmitriy Zaporozhets2016-06-301-3/+22
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Loop all disks when displaying system info. Closes #18886 See merge request !4983
| * | | Loop all disks when displaying system infoissue-18886Josh Frye2016-06-291-3/+22
| | | |
* | | | Add Application Setting to configure default Repository Path for new projectsshards-configAlejandro Rodríguez2016-06-291-0/+1
| | | |
* | | | Merge branch 'rubocop/enable-space-after-cops' into 'master' Robert Speicher2016-06-291-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable Style/SpaceAfterComma and Colon Rubocop cops See #17478 See merge request !4991
| * | | | Enable Style/SpaceAfterColon Rubocop copsGrzegorz Bizon2016-06-291-1/+1
| | |/ / | |/| |
* | | | Merge branch 'master' into issue_3359_3issue_3359_3Felipe Artur2016-06-298-10/+96
|\ \ \ \ | |/ / /
| * | | Merge branch 'zj-workhorse-format-patch' into 'master' Robert Speicher2016-06-291-1/+7
| |\ \ \ | | |/ / | |/| | | | | | | | | | Workhorse to serve email diffs See merge request !4590
| | * | Workhorse to serve email diffsZ.J. van de Weg2016-06-281-1/+7
| | | | | | | | | | | | | | | | Depends on the changes in Workhorse (gitlab-org/gitlab-workhorse!48).
| * | | Change load average to cpu/cores on system info.Josh Frye2016-06-281-1/+2
| | | |
| * | | Use number_to_human_size for system info and remove dependency on Filesize gem.Josh Frye2016-06-281-4/+4
| | | |
| * | | Round figures for system infoJosh Frye2016-06-281-4/+4
| | | |
| * | | Show basic system info on admin panel. Closes #18886Josh Frye2016-06-281-0/+12
| | |/ | |/|
| * | Merge remote-tracking branch 'dev/master'Robert Speicher2016-06-271-1/+1
| |\ \
| | * \ Merge branch '19102-fix' into 'master' Robert Speicher2016-06-271-1/+1
| | |\ \ | | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix an information disclosure when requesting access to a group containing private projects Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/19102. The commit speaks for itself: Fix an information disclosure when requesting access to a group containing private projects The issue was with the `User#groups` and `User#projects` associations which goes through the `User#group_members` and `User#project_members`. Initially I chose to use a secure approach by storing the requester's user ID in `Member#created_by_id` instead of `Member#user_id` because I was aware that there was a security risk since I didn't know the codebase well enough. Then during the review, we decided to change that and directly store the requester's user ID into `Member#user_id` (for the sake of simplifying the code I believe), meaning that every `group_members` / `project_members` association would include the requesters by default... My bad for not checking that all the `group_members` / `project_members` associations and the ones that go through them (e.g. `Group#users` and `Project#users`) were made safe with the `where(requested_at: nil)` / `where(members: { requested_at: nil })` scopes. Now they are all secure. See merge request !1973
| | | * Fix an information disclosure when requesting access to a group containing ↵Rémy Coutable2016-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | private projects The issue was with the `User#groups` and `User#projects` associations which goes through the `User#group_members` and `User#project_members`. Initially I chose to use a secure approach by storing the requester's user ID in `Member#created_by_id` instead of `Member#user_id` because I was aware that there was a security risk since I didn't know the codebase well enough. Then during the review, we decided to change that and directly store the requester's user ID into `Member#user_id` (for the sake of simplifying the code I believe), meaning that every `group_members` / `project_members` association would include the requesters by default... My bad for not checking that all the `group_members` / `project_members` associations and the ones that go through them (e.g. `Group#users` and `Project#users`) were made safe with the `where(requested_at: nil)` / `where(members: { requested_at: nil })` scopes. Now they are all secure. Signed-off-by: Rémy Coutable <remy@rymai.me>
| * | | Fix rendering of commit notesDouwe Maan2016-06-271-1/+8
| |/ /
| * | Merge branch 'issue_19096' into 'master' Stan Hu2016-06-251-0/+7
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Validate presence of essential params for diff rendering ## What does this MR do? Check the presence of essential params before rendering diff content. ## Are there points in the code the reviewer needs to double check? No ## Why was this MR needed? To avoid the generated application error ## What are the relevant issue numbers? #19096 ## Screenshots (if relevant) ## 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 - [x] Added for this feature/bug - [x] All builds are passing - [ ] 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) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !4917
| | * | Validate presence of essential params for diff renderingissue_19096Ruben Davila2016-06-241-0/+7
| | | | | | | | | | | | | | | | | | | | This will avoid application errors generated by the assumption of the presence of these params.
| * | | Add specs and improve coffescript sortable binding functionissue_15588Felipe Artur2016-06-241-1/+2
| | | |
| * | | Fix issue being ordered twice and callback when moving between statesFelipe Artur2016-06-241-1/+1
| | | |
| * | | Fix a wrong MR status when merge_when_build_succeeds & ↵19035-fix-merge-issueRémy Coutable2016-06-241-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | project.only_allow_merge_if_build_succeeds are true The issue was that `MergeRequest#mergeable?` returns false when the CI state is not success and project.only_allow_merge_if_build_succeeds is true. In this case `Projects::MergeRequestsController#merge` would return the `:failed` status when enabling `merge_when_build_succeeds`, thus leading to a weird state and the MR never automatically merged. The fix is to disable the CI state check in the controller safeguard that early return the `:failed` status. Signed-off-by: Rémy Coutable <remy@rymai.me>
| * | | Merge branch 'fix/gitlab-import-project-file-fix' into 'master' Rémy Coutable2016-06-241-1/+5
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix temp file being deleted after the request while importing a GitLab project Fixes https://gitlab.com/gitlab-com/infrastructure/issues/151 In production, the temporary uploaded file is getting deleted straight after the request so the Sidekiq worker is unable to find it in `/tmp` Also, improved erroring/logging of this situation. See merge request !4894
| | * | | fix paramsJames Lopez2016-06-241-2/+2
| | | | |
| | * | | Fix tmp file being deleted after the request plus some cleanup and improved ↵James Lopez2016-06-241-1/+5
| | | |/ | | |/| | | | | | | | | erroring for this situation
| * | | Support for rendering/redacting multiple documentsYorick Peterse2016-06-243-3/+39
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the way certain documents are rendered (currently only Notes) and how documents are redacted. Previously both rendering and redacting would run on a per document basis. The result of this was that for every document we'd have to run countless queries just to figure out if we could display a set of links or not. This commit changes things around so that redacting Markdown documents is no longer tied into the html-pipeline Gem. This in turn allows it to redact multiple documents in a single pass, thus reducing the number of queries needed. In turn rendering issue/merge request notes has been adjusted to take advantage of this new setup. Instead of rendering Markdown somewhere deep down in a view the Markdown is rendered and redacted in the controller (taking the current user and all that into account). This has been done in such a way that the "markdown()" helper method can still be used on its own. This particular commit also paves the way for caching rendered HTML on object level. Right now there's an accessor method Note#note_html which is used for setting/getting the rendered HTML. Once we cache HTML on row level we can simply change this field to be a column and call a "save" whenever needed and we're pretty much done.
| * | Merge branch 'zj-pipeline-can-be-nil'Douwe Maan2016-06-231-2/+7
| |\ \ | | |/ | |/|
| | * Check if pipeline is nil before mergingzj-pipeline-can-be-nilZ.J. van de Weg2016-06-231-2/+7
| | |
| * | Preload notes/discussions associations (award_emoji: :user)optimize-award-emojiPaco Guzman2016-06-231-2/+2
| |/
* | merge master into issue_3359_3Felipe Artur2016-06-292-12/+10
|\ \
| * | Insert notification settings dropdown into groupsFelipe Artur2016-06-222-14/+39
| | |
* | | merge master into issue_3359_3Felipe Artur2016-06-2226-109/+377
|\ \ \ | | |/ | |/|
| * | Merge branch ↵Douwe Maan2016-06-224-37/+14
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '18755-fix-destroy-project-causes-post_decline_request-to-be-executed' into 'master' Resolve "Destroying a project causes post_decline_request to be executed" ## What does this MR do? Ensure we don't send "access request declined" to access requesters when a project is deleted. ## Are there points in the code the reviewer needs to double check? I've created a service to decouple the notification sending from the AR model. ## Why was this MR needed? Because there was an issue. ## What are the relevant issue numbers? Fixes #18755, #18750. ## Does this MR meet the acceptance criteria? - [x] No CHANGELOG needed. - [x] 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 !4744
| | * | Raise a new Gitlab::Access::AccessDeniedError when permission is not enough ↵Rémy Coutable2016-06-184-38/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to destroy a member This is a try for a new approach to put the access checks at the service level. Signed-off-by: Rémy Coutable <remy@rymai.me>
| | * | Redirect to the member's source on request withdrawalRémy Coutable2016-06-181-1/+2
| | | | | | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
| | * | Use the new Members::DestroyService in group/project member controllersRémy Coutable2016-06-182-2/+2
| | | | | | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
| | * | New Members::DestroyServiceRémy Coutable2016-06-181-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is to ensure we don't send unwanted notifications when deleting a project. In other words, stop abusing AR callbacks and use services. Signed-off-by: Rémy Coutable <remy@rymai.me>
| * | | Merge branch 'dz-fix-appearance-preview' into 'master' Jacob Schatz2016-06-211-0/+1
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix admin appearance settings preview Render appearance settings preview in devise layout instead of implementing it 2 times. See merge request !4792
| | * | | Fix admin appearance settings previewdz-fix-appearance-previewDmitriy Zaporozhets2016-06-201-0/+1
| | |/ / | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>