- 30 May, 2017 40 commits
-
-
Toon Claes authored
To avoid the use of slow queries, remove some deprecated methods and encourage the use of ProjectFinder to find projects.
-
Toon Claes authored
And use it in the API.
-
Toon Claes authored
Now it is possible to combine the :non_public parameter. This might be useful when a user wants to know the trending projects they are member of.
-
Toon Claes authored
The ProjectsFinder and GroupFinder both support the same set of params. And the `/api/v4/projects` and `/api/v4/group/:id/projects` also support the same set of params. But they do not match the Finder params. So use a helper method to transform them.
-
Toon Claes authored
Instead of applying WHERE on a UNION, apply the WHERE on each of the seperate SELECT statements, and do UNION on that. Local tests with about 2_000_000 projects: - 1_500_000 private projects - 40_000 internal projects - 400_000 public projects For the API endpoint `/api/v4/projects?visibility=private` the slowest query was: ```sql SELECT "projects".* FROM "projects" WHERE ... ``` The original query took 1073.8ms. The query refactored to UNION of SELECT/WHERE took 2.3ms. The original query was: ```sql SELECT "projects".* FROM "projects" WHERE "projects"."pending_delete" = $1 AND (projects.id IN (SELECT "projects"."id" FROM "projects" INNER JOIN "project_authorizations" ON "projects"."id" = "project_authorizations"."project_id" WHERE "projects"."pending_delete" = 'f' AND "project_authorizations"."user_id" = 23 UNION SELECT "projects"."id" FROM "projects" WHERE "projects"."visibility_level" IN (20, 10))) AND "projects"."visibility_level" = $2 AND "projects"."archived" = $3 ORDER BY "projects"."created_at" DESC LIMIT 20 OFFSET 0 [["pending_delete", "f"], ["visibility_level", 0], ["archived", "f"]] ``` The refactored query: ```sql SELECT "projects".* FROM "projects" WHERE "projects"."pending_delete" = $1 AND (projects.id IN (SELECT "projects"."id" FROM "projects" INNER JOIN "project_authorizations" ON "projects"."id" = "project_authorizations"."project_id" WHERE "projects"."pending_delete" = 'f' AND "project_authorizations"."user_id" = 23 AND "projects"."visibility_level" = 0 AND "projects"."archived" = 'f' UNION SELECT "projects"."id" FROM "projects" WHERE "projects"."visibility_level" IN (20, 10) AND "projects"."visibility_level" = 0 AND "projects"."archived" = 'f')) ORDER BY "projects"."created_at" DESC LIMIT 20 OFFSET 0 [["pending_delete", "f"]] ```
-
Toon Claes authored
Instead of trying to do the heavy lifting in the API itself, use the existing features of the ProjectFinder.
-
Toon Claes authored
The `starred` parameter couldn't be used in combination with `trending` or `non_public`. But this is changed now.
-
Toon Claes authored
Add a scope to search for the projects that are starred by a certain user.
-
Toon Claes authored
The ProjectFinder supports the `non_public` parameter. This can be used to find only projects the user is member of.
-
Toon Claes authored
Because this order makes more sense and makes the code easier to read.
-
Toon Claes authored
To avoid passing parameters double, move all filtering to the `present_projects` helper.
-
Toon Claes authored
The helper will be modified in V4, so copy the original to V4 to keep the current behavior in V3.
-
Douwe Maan authored
Resolve "Allow to disable username on checkout url" Closes #30410 and #30174 See merge request !11792
-
Annabel Dunstone Gray authored
Remove extra bottom padding on Job log page Closes #30502 See merge request !11791
-
Rémy Coutable authored
Enable Gitaly by default in GitLab 9.3 Closes gitaly#242 See merge request !11796
-
Douwe Maan authored
Avoid crash when trying to parse string with invalid UTF-8 sequence See merge request !11770
-
Bob Van Landuyt authored
-
Rémy Coutable authored
Don’t create comment on JIRA if link already exists Closes #25373 See merge request !11485
-
Phil Hughes authored
`canEdit` changes for conditional remove button on filtered search -- EE backport Closes gitlab-ee#2433 See merge request !11696
-
Rémy Coutable authored
Disable sub_group_issuables_spec.rb for mysql Closes #33057 See merge request !11795
-
Jacob Vosmaer authored
-
Rémy Coutable authored
Make `ActiveRecord::Migrator` idempotent again in test environment Closes #33030 See merge request !11762
-
Annabel Dunstone Gray authored
Fix alignment of tree symbols in merge requests Closes #29590 See merge request !11761
-
Jarka Kadlecova authored
-
Douwe Maan authored
Merge branch '19107-404-when-creating-new-milestone-or-issue-for-project-that-has-issues-disabled' into 'master' 'New issue'/'New merge request' dropdowns should show only projects with issues/merge requests feature enabled Closes #19107 See merge request !11754
-
Douwe Maan authored
Merge branch '33048-markdown-rendering-of-md-files-has-ceased-to-display-latex-equations' into 'master' Fix math rendering on blob pages Closes #33048 See merge request !11793
-
Luke "Jared" Bennett authored
-
Grzegorz Bizon authored
Merge branch '33032-invalid-you-directly-addressed-yourself-todo-when-using-unsubscribe' into 'master' Resolve "Invalid 'You directly addressed yourself' TODO when using `/unsubscribe`" Closes #33032 See merge request !11788
-
Grzegorz Bizon authored
Fix omniauth-google-oauth2 dependencies in Gemfile.lock Closes #32653 See merge request !11787
-
Sean McGivern authored
`renderGFM` adds the correct syntax highlighting class and triggers KaTeX if required.
-
Rémy Coutable authored
Signed-off-by: Rémy Coutable <remy@rymai.me>
-
Rémy Coutable authored
This partially reverts be25bbc4. Signed-off-by: Rémy Coutable <remy@rymai.me>
-
Rémy Coutable authored
This reverts commit c425f366, reversing changes made to 82f6c0f5. Signed-off-by: Rémy Coutable <remy@rymai.me>
-
Rémy Coutable authored
Use 'sudo bash' when adding nodesource repository See merge request !10527
-
kushalpandya authored
-
Fatih Acet authored
Resolve "Browser notifications for pipeline running in a MR is gone" Closes #32916 See merge request !11734
-
Kamil Trzciński authored
Set head pipeline when creating merge requests See merge request !11669
-
Sean McGivern authored
The /unsubscribe slash command means that we check if the current user is subscribed to the issuable without having an explicit subscription. That means that we use the UserParser to find references to them in the notes. The UserParser (and all parsers inheriting from BaseParser) use RequestStore to cache ActiveRecord objects, so that we don't need to load the User object each time, if we're parsing references a bunch of times in the same request. However, it was always returning _all_ of the previously cached items, not just the ones matching the IDs passed. This would mean that we did two runs through with UserParser if you were mentioned in a comment, and then mentioned someone else in your comment while using /unsubscribe: 1. Because /unsubscribe was used, we see if you were mentioned in any comments. 2. Because you mentioned someone, we find them - but we would also get back your user, even if you didn't mention yourself. This would have the effect of creating a mention or directly addressed todo for yourself incorrectly. The fix is simple: only return values from the cache matching the IDs passed.
-
Rémy Coutable authored
Signed-off-by: Rémy Coutable <remy@rymai.me>
-
Phil Hughes authored
Update looks job log Closes #30117 See merge request !11663
-