Skip to content
Snippets Groups Projects
  1. Sep 13, 2019
  2. Aug 23, 2019
    • Stan Hu's avatar
      Remove N+1 SQL query loading project feature in dashboard · 29e60b06
      Stan Hu authored
      Projects that have a pipeline may need to check whether the user has
      permission to read the build (`can?(current_user, :read_build,
      project)`), which requires checking the `project_features` table.
      This would cause an N+1 SQL query for each project.
      
      This change also has a beneficial side effect that may avoid a race
      condition. When a user deletes a project, the project is queued for
      deletion and the user is redirected back to the dashboard page. However,
      the following may happen:
      
      1. The dashboard page may load this deleted project in the list of
      20 projects.
      2. The view will load the project pipeline status from the cache and
      attempt to show each project.
      3. When the view encounters the deleted project, it calls
      `can?(current_user, :read_build, project)` to determine whether to
      display the pipeline status.
      4. Sidekiq deletes the project from the database.
      5. However, since the deleted project is still loaded in memory, it will
      attempt to call `project.project_feature.access_level`.
      6. Since `project_feature` was not eager loaded, a lazy `SELECT` call is
      made to the database.
      7. This `SELECT` call returns nothing, and the user sees a 500 error.
      
      By eager loading `project_feature`, we can ensure that we have a
      consistent view and avoid records from being deleted later.
      
      Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/66482
      29e60b06
  3. Aug 21, 2019
    • George Koltsov's avatar
      Add SortingPreference concern · 8bcc47ac
      George Koltsov authored
      Sorting preference functionality has been extracted
      from `IssuableCollections` to a new `SortingPreference`
      concern in order to reuse this functionality in projects
      (and groups in the future).
      8bcc47ac
  4. Jul 04, 2019
  5. Jun 28, 2019
  6. Jun 05, 2019
  7. Apr 09, 2019
  8. Mar 19, 2019
  9. Feb 27, 2019
  10. Jan 15, 2019
  11. Dec 10, 2018
  12. Nov 29, 2018
  13. Nov 23, 2018
  14. Sep 23, 2018
    • gfyoung's avatar
      Enable more frozen string in app/controllers/ · be42c050
      gfyoung authored
      Enables frozen string for the following:
      
      * app/controllers/dashboard/**/*.rb
      * app/controllers/explore/**/*.rb
      * app/controllers/google_api/**/*.rb
      * app/controllers/groups/**/*.rb
      * app/controllers/import/**/*.rb
      * app/controllers/instance_statistics/**/*.rb
      * app/controllers/ldap/**/*.rb
      * app/controllers/oauth/**/*.rb
      * app/controllers/profiles/**/*.rb
      
      Partially addresses #47424.
      be42c050
  15. Sep 11, 2018
  16. Jul 06, 2018
  17. Feb 22, 2018
  18. Dec 07, 2017
  19. Nov 06, 2017
  20. Sep 11, 2017
  21. Aug 10, 2017
    • Yorick Peterse's avatar
      Use a specialized class for querying events · aac1de46
      Yorick Peterse authored
      This changes various controllers to use the new EventCollection class
      for retrieving events. This class uses a JOIN LATERAL query on
      PostgreSQL to retrieve queries in a more efficient way, while falling
      back to a simpler / less efficient query for MySQL.
      
      The EventCollection class also includes a limit on the number of events
      to display to prevent malicious users from cycling through all events,
      as doing so could put a lot of pressure on the database.
      
      JOIN LATERAL is only supported on PostgreSQL starting with version 9.3.0
      and as such this optimisation is only used when using PostgreSQL 9.3 or
      newer.
      Verified
      aac1de46
  22. Aug 07, 2017
  23. Jun 21, 2017
  24. Jun 12, 2017
  25. May 25, 2017
  26. Apr 06, 2017
    • Jacopo's avatar
      ProjectsFinder should handle more options · b996a82f
      Jacopo authored
      Extended ProjectFinder in order to handle the following options:
       - current_user - which user use
       - project_ids_relation: int[] - project ids to use
       - params:
         -  trending: boolean
         -  non_public: boolean
         -  starred: boolean
         -  sort: string
         -  visibility_level: int
         -  tags: string[]
         -  personal: boolean
         -  search: string
         -  non_archived: boolean
      
      GroupProjectsFinder now inherits from ProjectsFinder.
      Changed the code in order to use the new available options.
      b996a82f
  27. Mar 16, 2017
  28. Feb 13, 2017
  29. Feb 03, 2017
  30. Jun 03, 2016
  31. May 10, 2016
    • Sean McGivern's avatar
      Restrict starred projects to viewable ones · 97424ea5
      Sean McGivern authored
      `User#starred_projects` doesn't perform any visibility checks. This has
      a couple of problems:
      
      1. It assumes a user can always view all of their starred projects in
         perpetuity (project not changed to private, access revoked, etc.).
      2. It assumes that we'll only ever allow a user to star a project they
         can view. This is currently the case, but bugs happen.
      
      Add `User#viewable_starred_projects` to filter the starred projects by
      those the user either has explicit access to, or are public or
      internal. Then use that in all places where we list the user's starred
      projects.
      97424ea5
  32. Mar 19, 2016
  33. Mar 10, 2016
  34. Mar 04, 2016
  35. Mar 03, 2016
  36. Mar 02, 2016
  37. Feb 09, 2016
Loading