Commit Graph

17 Commits

Author SHA1 Message Date
GitLab Bot 80f61b4035 Add latest changes from gitlab-org/gitlab@master 2019-09-18 14:02:45 +00:00
Bob Van Landuyt 788ff54816 Group `parent not preloaded` errors in sentry
I still haven't found a moment to look into the exact cases that
causes this error, but we're not loosing any information this way.

In fact, it will be easier to find the right information as we only
need to look to one entry in Sentry.
2019-08-02 19:24:04 +02:00
Martin Wortschack cd6f774093 Externalize strings in app/models
- Update PO file
2019-04-12 12:28:07 +00:00
gfyoung 15b878e27e Enable more frozen string in app/models/**/*.rb
Partially addresses #47424.
2018-08-07 00:37:36 -07:00
Bob Van Landuyt de35c044fb Preload ancestors after pagination when filtering
We need to preload the ancestors of search results after applying
pagination limits. This way the search results itself are paginated,
but not the ancestors.

If we don't do this, we might not preload a parent group of a search
result as it has been cut off by pagination.
2018-07-06 14:09:36 +02:00
Bob Van Landuyt 1b0156204d Recover from errors when a parent is not preloaded 2018-04-18 17:15:51 +02:00
Bob Van Landuyt 9d1348d668 Move the `ancestors_upto` to `Project` and `Namespace` 2017-10-10 16:55:02 +02:00
Bob Van Landuyt 57bd3bb34a Force parents to be preloaded for building a hierarchy 2017-10-05 11:10:57 +02:00
Bob Van Landuyt 06e00913f5 Move merging of Hashes out of the `GroupDescendant` concern
Since it can technically merge any hash with objects that respond to `==`
2017-10-04 22:49:42 +02:00
Bob Van Landuyt 67815272dc Return an empty array when no matches are found 2017-10-04 22:49:42 +02:00
Bob Van Landuyt 167fd71348 Always preload all elements in a hierarchy to avoid extra queries. 2017-10-04 22:49:42 +02:00
Bob Van Landuyt ef043063f9 Clean up public/private api of `GroupDescendant`
So only methods that are used elsewhere are public.
2017-10-04 22:49:42 +02:00
Bob Van Landuyt af0b8e0558 Only preload ancestors for search results in the specified parent
When filtering we want all to preload all the ancestors upto the specified
parent group.

- root
  - subgroup
    - nested-group
      - project

So when searching 'project', on the 'subgroup' page we want to preload
'nested-group' but not 'subgroup' or 'root'
2017-10-04 22:49:42 +02:00
Bob Van Landuyt ac0b104ae4 Minimize the number of queries by preloading counts and ancestors
By preloading the count of members, projects and subgroups of a group,
we don't need to query them later.

We also preload the entire hierarchy for a search result and include
the counts so we don't need to query for them again
2017-10-04 22:49:42 +02:00
Bob Van Landuyt cd85c22faa Rename hierarchies to descendants where applicable 2017-10-04 22:49:42 +02:00
Bob Van Landuyt cd8e1b85b6 Keep the `parent` method in `Project` 2017-10-04 22:49:41 +02:00
Bob Van Landuyt 22aa034427 Rename `GroupHierarchy` to `GroupDescendant` 2017-10-04 22:49:41 +02:00