Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-07-27Enable frozen string in app/models/*.rbgfyoung
Partially addresses #47424.
2018-07-11Resolve "Rename the `Master` role to `Maintainer`" BackendMark Chao
2018-06-25Bring changes from EELin Jen-Shin
2018-03-07Backport relevant changes from EE ↵Tiago Botelho
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/4827 to CE
2017-12-22Replace '.team << [user, role]' with 'add_role(user)' in specsblackst0ne
2017-12-07Resolve "Display member role per project"Mike Greiling
2017-09-18Eliminate N+1 queries in loading discussions.json endpointStan Hu
In #37955,we see that the profile had a number of N+1 queries from repeated access to `cross_reference_not_visible_for?`. This was optimized in previous versions of GitLab by rendering all notes at once, counting the number of visible references, and then using that number to check whether a system note should be fully redacted. There was also another N+1 query calling `ProjectTeam#member?`, which did not take advantage of an optimization in prepare_notes_for_rendering that would preload the maximum access level per project. Closes #37955
2017-09-06WIP: refactor the first-contributor to Issuablemicael.bergeron
this will remove the need make N queries (per-note) at the cost of having to mark notes with an attribute this opens up the possibility for other special roles for notes
2017-06-21Enable Style/DotPosition Rubocop :cop:Grzegorz Bizon
2017-06-01Fix N+1 queries for non-members in comment threadsSean McGivern
When getting the max member access for a group of users, we stored the results in RequestStore. However, this will only return results for project members, so anyone who wasn't a member of the project would be checked once at the start, and then once for each comment they made. These queries are generally quite fast, but no query is faster!
2017-04-21Refactor add_users method for project and groupDmitriy Zaporozhets
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-03-31Eliminate unnecessary queries that add ~500 ms of load time for a large issueStan Hu
Looking at the SQL log, we see useless queries such as: ``` D, [2017-03-22T03:25:00.726710 #2629] DEBUG -- : (235.9ms) SELECT MAX("project_authorizations"."access_level") AS maximum_access_level, "project_authorizations"."user_id" AS project_authorizations_user_id FROM "project_authorizations" WHERE "project_authorizations"."project_id" = 13083 AND 1=0 GROUP BY "project_authorizations"."user_id" [["project_id", 13083]] ```
2016-11-23Update ProjectTeam#fetch_members to use project authorizationsAhmad Sherif
2016-11-23Update ProjectTeam#max_member_access_for_user_ids to use project authorizationsAhmad Sherif
2016-11-23Drop Project#authorized_for_user? in favor of ProjectTeam#member?Ahmad Sherif
Closes #23938
2016-11-18Add shortcuts for adding users to a project team with a specific roleRobert Speicher
This also updates _some_ specs to use these new methods, just to serve as an example for others going forward, but by no means is this exhaustive. Original implementations at !5992 and !6012. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/20944
2016-10-28Fix project member access for group linksSean McGivern
`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.
2016-09-28Allow Member.add_user to handle access requestersRémy Coutable
Changes include: - Ensure Member.add_user is not called directly when not necessary - New GroupMember.add_users_to_group to have the same abstraction level as for Project - Refactor Member.add_user to take a source instead of an array of members - Fix Rubocop offenses - Always use Project#add_user instead of project.team.add_user - Factorize users addition as members in Member.add_users_to_source - Make access_level a keyword argument in GroupMember.add_users_to_group and ProjectMember.add_users_to_projects - Destroy any requester before adding them as a member - Improve the way we handle access requesters in Member.add_user Instead of removing the requester and creating a new member, we now simply accepts their access request. This way, they will receive a "access request granted" email. - Fix error that was previously silently ignored - Stop raising when access level is invalid in Member, let Rails validation do their work Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-21Simplify invited_group_members filter-by-levelRobert Speicher
2016-09-21Use `public_send` over `send` in ProjectTeamRobert Speicher
2016-09-20Improve clarity of variable names in ProjectTeam#fetch_invited_membersRobert Speicher
2016-09-20Fix a logic error in ProjectTeam#fetch_invited_membersRobert Speicher
We were calling `.where` and `.send` on the relation, but never doing anything with the return value, resulting in proper access-level filtering never being of any consequence.
2016-09-20Simplify ProjectTeam#fetch_members to satisfy flogRobert Speicher
2016-08-18Add expiration date to group membershipsSean McGivern
2016-08-18Merge branch 'master' into expiration-date-on-membershipsSean McGivern
2016-08-04Fix Rename `add_users_into_project` and `projects_ids`Herminio Torres
We never add things `into` projects, we just add them `to` projects. So how about we rename this to `add_users_to_project`. Rename `projects_ids` to `project_ids` by following the convention of rails.
2016-08-02Replace optional parameters with keyword arguments.Adam Niedzielski
2016-08-01Only use RequestStore in ProjectTeam#max_member_access_for_user if it is activeStan Hu
2016-08-01WIPAdam Niedzielski
2016-07-27Fix typo in commentStan Hu
2016-07-27Optimize the invited group link access level checkStan Hu
2016-07-27Incorporate review commentsStan Hu
2016-07-27Optimize maximum user access level lookup in loading of notesStan Hu
NotesHelper#note_editable? and ProjectTeam#human_max_access currently take about 16% of the load time of an issue page. This MR preloads the maximum access level of users for all notes in issues and merge requests with several queries instead of one per user and caches the result in RequestStore.
2016-07-22Load project invited groups and members eagerly in ProjectTeam#fetch_membersAhmad Sherif
2016-07-01Exclude requesters from Project#members, Group#members and User#membersRémy Coutable
And create new Project#requesters, Group#requesters scopes. Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-29Reduce overhead and optimize ProjectTeam#max_member_access performanceStan Hu
The previous implementation would load the entire team member list and their respective attributes. Now we only search for the user's specific access level. In gitlab-com/operations#42, this reduces the overall overhead of rendering the issue from 28% to 20%. First step of optimizing #19273
2016-06-14UI and copywriting improvementsRémy Coutable
+ Move 'Edit Project/Group' out of membership-related partial + Show the access request buttons only to logged-in users + Put the request access buttons out of in a more visible button + Improve the copy in the #remove_member_message helper Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14Add request access for groupsRémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14Initial implementation of user access request to projectsDavid Alexander
2016-06-14Project members with guest role can't access confidential issuesDouglas Barbosa Alexandre
2016-03-11Allow users to access project shared with their groupDmitriy Zaporozhets
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-02-19Allow `ProjectTeam#human_max_access` to return "Owner"Robert Speicher
2015-10-15Improve ProjectTeam#max_member_access performanceYorick Peterse
By comparing objects in Ruby we can greatly improve the performance of this method. In the worst case (should no data be eager loaded) this will run the same amount of queries as before, in the best case (when data _is_ eager loadeD) it requires no queries at all. The added benchmark used to produce around 273 iterations per second. With this commit this has been increased to almost 40 000 iterations per second: a speedup of roughly 145 times. Combined with eager loading Note associations this results in about 30 queries less when viewing a single issue, this in turn cuts down the loading time by 30-40%.
2015-10-02Wrong access level badge on MR commentsValery Sizov
2015-04-14Correctly import invited members.Douwe Maan
2015-04-14Track who created a group or project member.Douwe Maan
2015-03-15Use `member` instead of `tm`.Douwe Maan
2015-01-01Append in place for strings and arraysCiro Santilli
2014-10-09Snippets: public/internal/privateValery Sizov
2014-10-03Add parenthesis to function def with arguments.Ciro Santilli