summaryrefslogtreecommitdiff
path: root/app/finders
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'id-stale-branches' into 'master'Grzegorz Bizon2019-07-011-0/+14
|\ | | | | | | | | Add endpoint for fetching diverging commit counts See merge request gitlab-org/gitlab-ce!29802
| * Add endpoint for fetching diverging commit countsid-stale-branchesIgor Drozdov2019-06-281-0/+14
| | | | | | | | Extract diverging_commit_counts into a service class
* | Move Multiple Issue Boards for Projects to Core53811-issue-boards-to-core-projects-backend-ceAlexandru Croitor2019-06-261-0/+26
|/ | | | | Refactor code to allow multiple issue boards management for projects in CE
* Merge branch '63656-runner-tags-search-dropdown-is-empty' into 'master'Jan Provaznik2019-06-241-2/+1
|\ | | | | | | | | | | | | Resolve "Runner tags search dropdown is empty" Closes #63656 See merge request gitlab-org/gitlab-ce!29985
| * Return all runner tags when search is empty63656-runner-tags-search-dropdown-is-emptyDmitriy Zaporozhets2019-06-241-2/+1
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | Add name & search parameters to project environments APILee Tickett2019-06-241-0/+29
|/
* Remove unneeded parenthesesPatrick Derichs2019-06-191-1/+1
|
* Separate conditions to increase readabilityPatrick Derichs2019-06-191-1/+2
|
* Use NotesFinder to fetch notes on API and ControllersPatrick Derichs2019-06-191-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix missing iid query on NotesFinder Changed parameters of find_noteable, so changes across a few files were needed. MergeRequest also requires iid instead of id query Make NotesFinder fail with RecordNotFound again Add specs for target_iid Using RSpec tablesyntax for target_iid specs Revert "Using RSpec tablesyntax for target_iid specs" This reverts commit ba45c7f569a. Allow find_by! here Fix variable name Add readable check Revert "Add readable check" This reverts commit 9e3a1a7aa39. Remove unnecessary assignment Add required changes for EE Fix parameter count Reduce code duplication by extracting a noteable module method The call to find_noteable was redundant so multiple files and lines have changed in that commit to use the newly introduced module method `noteable`. Replace casecmp with include check Add parent_type parameter Revert "Reduce code duplication by extracting a noteable module method" This reverts commit 8c0923babff16. Method is no longer needed Check whether noteable can be read by user
* Remove some deprecated codedz-cleanup-deprecated-codeDmitriy Zaporozhets2019-06-071-5/+3
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Move file one folder level up to avoid namespace conflict58941-use-gitlab-serverless-with-existing-knative-installationJoão Cunha2019-06-033-117/+116
| | | | | | | | | | | | | | | | | | | Clusters::Cluster::KnativeServicesFinder becomes Clusters::KnativeServicesFinder This is to avoid loading race condition between: ``` module Clusters class Cluster < ApplicationRecord ``` and ``` module Clusters class Cluster ```
* Adapt functions to work for external KnativeJoão Cunha2019-05-292-15/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove Kn services cache from Clusters::Application::Knative Knative function can exist even if user did not installed Knative via GitLab managed apps. -> Move responsibility of finding services into the Cluster -> Responsability is inside Clusters::Cluster::KnativeServiceFinder -> Projects::Serverless::FunctionsFinder now calls depends solely on a cluster to find the Kn services. -> Detect Knative by resource presence instead of service presence -> Mock knative_installed response temporarily for frontend to develop Display loader while `installed === 'checking'` Added frontend work to determine if Knative is installed Memoize with_reactive_cache(*args, &block) to avoid race conditions When calling with_reactive_cache more than once, it's possible that the second call will already have the value populated. Therefore, in cases where we need the sequential calls to have consistent results, we'd fall under a race condition. Check knative installation via Knative resource presence Only load pods if Knative is discovered Always return a response in FunctionsController#index - Always indicate if Knative is installed, not installed or checking - Always indicate the partial response for functions. Final response is guaranteed when knative_installed is either true | false. Adds specs for Clusters::Cluster#knative_services_finder Fix method name when calling on specs Add an explicit check for functions Added an explicit check to see if there are any functions available Fix Serverless feature spec - we don't find knative installation via database anymore, rather via Knative resource Display error message for request timeouts Display an error message if the request times out Adds feature specs for when functions exist Remove a test purposed hardcoded flag Add ability to partially load functions Added the ability to partially load functions on the frontend Add frontend unit tests Added tests for the new frontend additions Generate new translations Generated new frontend translations Address review comments Cleaned up the frontend unit test. Added computed prop for `isInstalled`. Move string to constant Simplify nil to array conversion Put knative_installed states in a frozen hash for better read Pluralize list of Knative states Quey services and pods filtering name This way we don't need to filter the namespace in memory. Also, the data we get from the network is much smaller. Simplify cache_key and fix bug - Simplifies the cache_key by removing namespace duplicate - Fixes a bug with reactive_cache memoization
* Removes duplicated members from api/projects/:id/members/all51854-api-to-get-all-project-group-members-returns-duplicatesJacopo2019-05-271-11/+32
| | | | | | | | When using the members/all api the same user was returned multiple times when he was a member of the project/group and also of one of the ancestor groups. Now the member is returned only once giving priority to the membership on the project and maintaining the same behaviour of the members UI.
* Remove legacy Kubernetes #actual_namespace61935-remove-code-left-over-from-when-clusters-were-always-project-specificTiger2019-05-211-5/+7
| | | | | | | | | | | | | | | | | | When Kubernetes clusters were originally built they could only exist at the project level, and so there was logic included that assumed there would only ever be a single Kubernetes namespace per cluster. We now support clusters at the group and instance level, which allows multiple namespaces. This change consolidates various project-specific fallbacks to generate namespaces, and hands all responsibility to the Clusters::KubernetesNamespace model. There is now no concept of a single namespace for a Clusters::Platforms::Kubernetes; to retrieve a namespace a project must now be supplied in all cases. This simplifies upcoming work to use a separate Kubernetes namespace per project environment (instead of a namespace per project).
* Set attempt project search optimizations flag to default_enabledLuke Picciau2019-05-211-1/+1
|
* Add improvements to the global search processFrancisco Javier López2019-05-073-14/+24
| | | | | | | Removed the conditions added to Project.with_feature_available_for_user, and moved to the IssuableFinder. Now, we ensure that, in the projects retrieved in the Finder, the user has enough access for the feature.
* Add label_name as scalar param of IssuableFinder60569-timeline-entry-label-link-is-not-applying-the-filter-on-issuesHeinrich Lee Yu2019-04-231-0/+1
| | | | This was removed by a previous MR but broke some links
* Abstract author into private methodweimeng-user-autocomplete-fixWei-Meng Lee2019-04-161-1/+9
|
* Only show in autocomplete when author activeWei-Meng Lee2019-04-121-1/+1
|
* Revert "Merge branch 'sh-optimize-projects-api' into 'master'"revert-2cc01f12Stan Hu2019-04-101-1/+1
| | | This reverts merge request !26481
* [CE] Support multiple assignees for merge requestsosw-multi-assignees-merge-requestsOswaldo Ferreira2019-04-082-30/+14
| | | | | Backports https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/10161 (code out of ee/ folder).
* Add Knative metrics to PrometheusChris Baumbauer2019-04-061-2/+26
|
* Merge branch 'extend-cte-optimisations-to-projects' into 'master'Dmitriy Zaporozhets2019-04-051-26/+20
|\ | | | | | | | | | | | | Extend CTE search optimisation to projects Closes #55170 See merge request gitlab-org/gitlab-ce!26908
| * Extend CTE search optimisation to projectsextend-cte-optimisations-to-projectsSean McGivern2019-04-041-26/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we use the `search` param on an `IssuableFinder`, we can run into issues. We have trigram indexes to support these searches. On GitLab.com, we often see Postgres's optimiser prioritise the (global) trigram indexes over the index on `project_id`. For group and project searches, we know that it will be quicker to filter by `project_id` first, as it returns fewer rows in most cases. For group issues search, we ran into this issue previously, and went through the following iterations: 1. Use a CTE on the project IDs as an optimisation fence. This prevents the planner from disregarding the index on `project_id`. Unfortunately it breaks some types of sorting, like priority and popularity, as they sort on a joined table. 2. Use a subquery for listing issues, and a CTE for counts. The subquery - in the case of group lists - didn't help as much as the CTE, but was faster than not including it. We can safely use a CTE for counts as they don't have sorting. Now, however, we're seeing the same issue in a project context. The subquery doesn't help at all there (it would only return one row, after all). In an attempt to keep total code complexity under control, this commit removes the subquery optimisation and applies the CTE optimisation only for sorts we know that are safe. This means that for more complicated sorts (like priority and popularity), the search will continue to be very slow. If this is a high-priority issue, we can consider introducing further optimisations, but this finder is already very complicated and additional complexity has a cost. The group CTE optimisation is controlled by the same feature flag as before, `attempt_group_search_optimizations`, which is enabled by default. The new project CTE optimisation is controlled by a new feature flag, `attempt_project_search_optimizations`, which is disabled by default.
* | Fix IDE detecting MR from fork branchPaul Slaughter2019-04-051-1/+12
| | | | | | | | | | | | | | | | | | **Why?** Currently the IDE loads a merge request based on only the `source_branch` name. This means it loads MR's from forks that have the same branch name (not good). - This required updating the BE API to accept `source_project_id`
* | Consider array params on rendering MR list on dashboardIgor2019-04-041-1/+0
|/ | | | | This fixes the bug, when approver filter is provided, but dashboard asks to enter any filter
* Fix group transfer selection possibilitiesPeter Marko2019-04-021-0/+8
|
* Optimize /api/v4/projects endpoint for visibility levelStan Hu2019-03-271-1/+1
| | | | | | | | | | Previously when a user requested a list of projects, `Project#public_or_visible_to_user` would search all authorized projects and public/internal projects as well. However, when a user requests a specific `visibility_level` (e.g. private), that should reduce the search space, and we shouldn't need to load public/internal projects. Improves https://gitlab.com/gitlab-org/gitlab-ce/issues/59329
* Only count active milestones as startedSean McGivern2019-03-191-1/+1
| | | | | The Upcoming milestone filter only considers active milestones, but the Started one included closed milestones, too. This was inconsistent.
* Filter merge requests by target branchHiroyuki Sato2019-03-091-1/+1
|
* Allow all personal snippets to be accessed by APINick Thomas2019-03-061-0/+2
| | | | | | Previously, you could only access personal snippets in the API if you had authored them. The documentation doesn't state that this is the case, and it's quite surprising.
* Merge dev master into GitLab.com masterYorick Peterse2019-03-041-1/+8
|\
| * Merge branch 'security-commit-private-related-mr' into 'master'Yorick Peterse2019-03-041-1/+8
| |\ | | | | | | | | | | | | | | | | | | Don't allow non-members to see private related MRs Closes #2787 See merge request gitlab/gitlabhq!2866
| | * Modify MergeRequestsFinder to allow filtering by commitPatrick Bajao2019-01-281-1/+8
| | |
| | * Merge branch 'security-contributed-projects' into 'master'Yorick Peterse2019-01-251-0/+7
| | |\ | | | | | | | | | | | | | | | | [master] Fix contributed projects info is still visible even user enable private profile See merge request gitlab/gitlabhq!2743
| | | * Fix contributed projects finder shown private infoJames Lopez2019-01-081-0/+7
| | | |
* | | | Merge branch '54643-lower_issuable_finder_complexity' into 'master'Sean McGivern2019-03-011-15/+25
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IssuableFinder - Always use CTE for group counts Closes #54643 See merge request gitlab-org/gitlab-ce!25411
| * | | | Always use CTE for IssuableFinder countsMario de la Ossa2019-02-281-15/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the CTE is faster than a subquery and the only reason we're using a subquery is that the CTE can't handle sorting by certain attributes, let's use the CTE always (when the feature flag is enabled) when counting, since we can ignore ordering if we just want a count of results.
* | | | | use functional style for tags finderAlexis Reigel2019-02-271-19/+19
| | | | |
* | | | | don't filter tags by taggable typeAlexis Reigel2019-02-271-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to performance reasons we cannot use the type filter on the tags. The table for ActsAsTaggableOn is too big and too unoptimized, such that the queries time out on production. See the discussion https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19740#note_120087938 for more info.
* | | | | optimize sql query to get tags related to runnersAlexis Reigel2019-02-271-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | The query generated by ActsAsTaggableOn `@taggable_type.all_tags` is very inefficient (joins too much, grouping, inner select, ...).
* | | | | use lazy ajax filter dropdown for runner tagsAlexis Reigel2019-02-271-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the potential number of available runner tags is too large to load it statically to a dropdown. we use the same lazy loaded dropdown as is used for the users dropdown already.
* | | | | add tag filter to admin runners pageAlexis Reigel2019-02-271-0/+9
| | | | |
* | | | | Merge branch '42086-project-fetch-statistics-api-http-only' into 'master'57125-heatmap-chart-typeNick Thomas2019-02-271-0/+21
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | Resolve "Project fetch statistics API (HTTP only)" Closes #42086 See merge request gitlab-org/gitlab-ce!23596
| * | | | Add project http fetch statistics APIJacopo2019-02-271-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API get projects/:id/traffic/fetches allows user with write access to the repository to get the number of clones for the last 30 days.
* | | | | Remove N+1 query for tags in /admin/runners pageStan Hu2019-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in https://github.com/mbleigh/acts-as-taggable-on/issues/91, we can avoid N+1 queries if we use `tags` instead of `tag_list`. Seen while reviewing https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19740.
* | | | | Merge branch 'fix-misspellings-app-comments' into 'master'Rémy Coutable2019-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Fix misspellings in app/spec comments See merge request gitlab-org/gitlab-ce!25517
* | | | | Merge branch 'filter-confidential-issues' into 'master'Kamil Trzciński2019-02-261-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ability to filter confidential issues Closes #50747 See merge request gitlab-org/gitlab-ce!24960
* | | | | Revert "Merge branch 'fix-misspellings-app-comments' into 'master'"Michael Kozono2019-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 9202bbd129537a698b986e6295d0c783b5a84815, reversing changes made to 4b282e9ce1ae246c4538b3ede18d1380ea778029.
* | | | | Revert "Merge branch 'filter-confidential-issues' into 'master'"Michael Kozono2019-02-251-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d133bf84c668df3dfc9938bb04150754cb873c8b, reversing changes made to 7981c0292b07a0138b096fa082341fcb13e9ce2b.