Commit 9e68395a authored by 🤖 GitLab Bot 🤖's avatar 🤖 GitLab Bot 🤖
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 202268ad
......@@ -71,6 +71,7 @@ eslint-report.html
/builds*
/.gitlab_workhorse_secret
/.gitlab_pages_secret
/.gitlab_kas_secret
/webpack-report/
/knapsack/
/rspec_flaky/
......
0fe0cfaccc979592610cbf65807f19b307957750
b2e2ec1069625c4a4f220b0ec72154b1f2bdf834
......@@ -338,7 +338,7 @@ GEM
fast_blank (1.0.0)
fast_gettext (1.6.0)
ffaker (2.10.0)
ffi (1.12.2)
ffi (1.13.1)
ffi-compiler (1.0.1)
ffi (>= 1.0.0)
rake
......@@ -695,7 +695,7 @@ GEM
faraday (>= 0.9, < 2.0.0)
faraday-cookie_jar (~> 0.0.6)
ms_rest (~> 0.7.6)
msgpack (1.3.1)
msgpack (1.3.3)
multi_json (1.14.1)
multi_xml (0.6.0)
multipart-post (2.1.1)
......@@ -804,7 +804,7 @@ GEM
validate_url
webfinger (>= 1.0.1)
opentracing (0.5.0)
optimist (3.0.0)
optimist (3.0.1)
org-ruby (0.9.12)
rubypants (~> 0.2)
orm_adapter (0.5.0)
......@@ -904,7 +904,7 @@ GEM
ffi (>= 0.5.0, < 2)
rblineprof (0.3.6)
debugger-ruby_core_source (~> 1.3)
rbtrace (0.4.11)
rbtrace (0.4.14)
ffi (>= 1.0.6)
msgpack (>= 0.4.3)
optimist (>= 3.0.0)
......
<script>
import { GlSkeletonLoading } from '@gitlab/ui';
import { GlSkeletonLoading, GlButton } from '@gitlab/ui';
import { sprintf, __ } from '../../../locale';
import getRefMixin from '../../mixins/get_ref';
import projectPathQuery from '../../queries/project_path.query.graphql';
......@@ -13,6 +13,7 @@ export default {
TableHeader,
TableRow,
ParentRow,
GlButton,
},
mixins: [getRefMixin],
apollo: {
......@@ -39,6 +40,10 @@ export default {
required: false,
default: '',
},
hasMore: {
type: Boolean,
required: true,
},
},
data() {
return {
......@@ -65,6 +70,11 @@ export default {
return !this.isLoading && ['', '/'].indexOf(this.path) === -1;
},
},
methods: {
showMore() {
this.$emit('showMore');
},
},
};
</script>
......@@ -110,6 +120,20 @@ export default {
<td><gl-skeleton-loading :lines="1" class="ml-auto h-auto w-50" /></td>
</tr>
</template>
<template v-if="hasMore">
<tr>
<td align="center" colspan="3" class="gl-p-0!">
<gl-button
variant="link"
class="gl-display-flex gl-w-full gl-py-4!"
:loading="isLoading"
@click="showMore"
>
{{ s__('ProjectFileTree|Show more') }}
</gl-button>
</td>
</tr>
</template>
</tbody>
</table>
</div>
......
<script>
import { GlButton } from '@gitlab/ui';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import { __ } from '../../locale';
import FileTable from './table/index.vue';
......@@ -17,7 +16,6 @@ export default {
components: {
FileTable,
FilePreview,
GlButton,
},
mixins: [getRefMixin],
apollo: {
......@@ -127,7 +125,7 @@ export default {
.concat(data.trees.pageInfo, data.submodules.pageInfo, data.blobs.pageInfo)
.find(({ hasNextPage }) => hasNextPage);
},
showMore() {
handleShowMore() {
this.clickedShowMore = true;
this.fetchFiles();
},
......@@ -142,20 +140,9 @@ export default {
:entries="entries"
:is-loading="isLoadingFiles"
:loading-path="loadingPath"
:has-more="hasShowMore"
@showMore="handleShowMore"
/>
<div
v-if="hasShowMore"
class="gl-border-1 gl-border-gray-100 gl-rounded-base gl-border-t-none gl-border-b-solid gl-border-l-solid gl-border-r-solid gl-rounded-top-right-none gl-rounded-top-left-none gl-mt-n1"
>
<gl-button
variant="link"
class="gl-display-flex gl-w-full gl-py-4!"
:loading="isLoadingFiles"
@click="showMore"
>
{{ s__('ProjectFileTree|Show more') }}
</gl-button>
</div>
<file-preview v-if="readme" :blob="readme" />
</div>
</template>
......@@ -2,19 +2,23 @@
module Resolvers
class ProjectMembersResolver < BaseResolver
include Gitlab::Graphql::Authorize::AuthorizeResource
argument :search, GraphQL::STRING_TYPE,
required: false,
description: 'Search query'
type Types::ProjectMemberType, null: true
type Types::MemberInterface, null: true
authorize :read_project_member
alias_method :project, :object
def resolve(**args)
return Member.none unless project.present?
authorize!(project)
MembersFinder
.new(project, context[:current_user], params: args)
.new(project, current_user, params: args)
.execute
end
end
......
......@@ -8,7 +8,7 @@ class GroupMemberType < BaseObject
implements MemberInterface
graphql_name 'GroupMember'
description 'Represents a Group Member'
description 'Represents a Group Membership'
field :group, Types::GroupType, null: true,
description: 'Group that a User is a member of',
......
......@@ -4,6 +4,9 @@ module Types
module MemberInterface
include BaseInterface
field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the member'
field :access_level, Types::AccessLevelType, null: true,
description: 'GitLab::Access level'
......@@ -18,5 +21,22 @@ module MemberInterface
field :expires_at, Types::TimeType, null: true,
description: 'Date and time the membership expires'
field :user, Types::UserType, null: false,
description: 'User that is associated with the member object',
resolve: -> (obj, _args, _ctx) { Gitlab::Graphql::Loaders::BatchModelLoader.new(User, obj.user_id).find }
definition_methods do
def resolve_type(object, context)
case object
when GroupMember
Types::GroupMemberType
when ProjectMember
Types::ProjectMemberType
else
raise ::Gitlab::Graphql::Errors::BaseError, "Unknown member type #{object.class.name}"
end
end
end
end
end
......@@ -3,7 +3,7 @@
module Types
class ProjectMemberType < BaseObject
graphql_name 'ProjectMember'
description 'Represents a Project Member'
description 'Represents a Project Membership'
expose_permissions Types::PermissionTypes::Project
......@@ -11,13 +11,6 @@ class ProjectMemberType < BaseObject
authorize :read_project
field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the member'
field :user, Types::UserType, null: false,
description: 'User that is associated with the member object',
resolve: -> (obj, _args, _ctx) { Gitlab::Graphql::Loaders::BatchModelLoader.new(User, obj.user_id).find }
field :project, Types::ProjectType, null: true,
description: 'Project that User is a member of',
resolve: -> (obj, _args, _ctx) { Gitlab::Graphql::Loaders::BatchModelLoader.new(Project, obj.source_id).find }
......
......@@ -159,7 +159,7 @@ class ProjectType < BaseObject
resolver: Resolvers::ProjectMilestonesResolver
field :project_members,
Types::ProjectMemberType.connection_type,
Types::MemberInterface.connection_type,
description: 'Members of the project',
resolver: Resolvers::ProjectMembersResolver
......
......@@ -12,8 +12,8 @@ def environments_list_data
def environments_folder_list_view_data
{
"endpoint" => folder_project_environments_path(@project, @folder, format: :json),
"folder-name" => @folder,
"can-read-environment" => can?(current_user, :read_environment, @project).to_s
"folder_name" => @folder,
"can_read_environment" => can?(current_user, :read_environment, @project).to_s
}
end
......@@ -33,11 +33,11 @@ def metrics_data(project, environment)
def environment_logs_data(project, environment)
{
"environment-name": environment.name,
"environments-path": project_environments_path(project, format: :json),
"environment-id": environment.id,
"cluster-applications-documentation-path" => help_page_path('user/clusters/applications.md', anchor: 'elastic-stack'),
"clusters-path": project_clusters_path(project, format: :json)
"environment_name": environment.name,
"environments_path": project_environments_path(project, format: :json),
"environment_id": environment.id,
"cluster_applications_documentation_path" => help_page_path('user/clusters/applications.md', anchor: 'elastic-stack'),
"clusters_path": project_clusters_path(project, format: :json)
}
end
......@@ -51,18 +51,18 @@ def project_metrics_data(project)
return {} unless project
{
'settings-path' => edit_project_service_path(project, 'prometheus'),
'clusters-path' => project_clusters_path(project),
'dashboards-endpoint' => project_performance_monitoring_dashboards_path(project, format: :json),
'default-branch' => project.default_branch,
'project-path' => project_path(project),
'tags-path' => project_tags_path(project),
'external-dashboard-url' => project.metrics_setting_external_dashboard_url,
'custom-metrics-path' => project_prometheus_metrics_path(project),
'validate-query-path' => validate_query_project_prometheus_metrics_path(project),
'custom-metrics-available' => "#{custom_metrics_available?(project)}",
'prometheus-alerts-available' => "#{can?(current_user, :read_prometheus_alerts, project)}",
'dashboard-timezone' => project.metrics_setting_dashboard_timezone.to_s.upcase
'settings_path' => edit_project_service_path(project, 'prometheus'),
'clusters_path' => project_clusters_path(project),
'dashboards_endpoint' => project_performance_monitoring_dashboards_path(project, format: :json),
'default_branch' => project.default_branch,
'project_path' => project_path(project),
'tags_path' => project_tags_path(project),
'external_dashboard_url' => project.metrics_setting_external_dashboard_url,
'custom_metrics_path' => project_prometheus_metrics_path(project),
'validate_query_path' => validate_query_project_prometheus_metrics_path(project),
'custom_metrics_available' => "#{custom_metrics_available?(project)}",
'prometheus_alerts_available' => "#{can?(current_user, :read_prometheus_alerts, project)}",
'dashboard_timezone' => project.metrics_setting_dashboard_timezone.to_s.upcase
}
end
......@@ -70,11 +70,11 @@ def environment_metrics_data(environment, project = nil)
return {} unless environment
{
'metrics-dashboard-base-path' => metrics_dashboard_base_path(environment, project),
'current-environment-name' => environment.name,
'has-metrics' => "#{environment.has_metrics?}",
'prometheus-status' => "#{environment.prometheus_status}",
'environment-state' => "#{environment.state}"
'metrics_dashboard_base_path' => metrics_dashboard_base_path(environment, project),
'current_environment_name' => environment.name,
'has_metrics' => "#{environment.has_metrics?}",
'prometheus_status' => "#{environment.prometheus_status}",
'environment_state' => "#{environment.state}"
}
end
......@@ -93,26 +93,26 @@ def project_and_environment_metrics_data(project, environment)
return {} unless project && environment
{
'metrics-endpoint' => additional_metrics_project_environment_path(project, environment, format: :json),
'dashboard-endpoint' => metrics_dashboard_project_environment_path(project, environment, format: :json),
'deployments-endpoint' => project_environment_deployments_path(project, environment, format: :json),
'alerts-endpoint' => project_prometheus_alerts_path(project, environment_id: environment.id, format: :json),
'operations-settings-path' => project_settings_operations_path(project),
'can-access-operations-settings' => can?(current_user, :admin_operations, project).to_s,
'panel-preview-endpoint' => project_metrics_dashboards_builder_path(project, format: :json)
'metrics_endpoint' => additional_metrics_project_environment_path(project, environment, format: :json),
'dashboard_endpoint' => metrics_dashboard_project_environment_path(project, environment, format: :json),
'deployments_endpoint' => project_environment_deployments_path(project, environment, format: :json),
'alerts_endpoint' => project_prometheus_alerts_path(project, environment_id: environment.id, format: :json),
'operations_settings_path' => project_settings_operations_path(project),
'can_access_operations_settings' => can?(current_user, :admin_operations, project).to_s,
'panel_preview_endpoint' => project_metrics_dashboards_builder_path(project, format: :json)
}
end
def static_metrics_data
{
'documentation-path' => help_page_path('administration/monitoring/prometheus/index.md'),
'add-dashboard-documentation-path' => help_page_path('operations/metrics/dashboards/index.md', anchor: 'add-a-new-dashboard-to-your-project'),
'empty-getting-started-svg-path' => image_path('illustrations/monitoring/getting_started.svg'),
'empty-loading-svg-path' => image_path('illustrations/monitoring/loading.svg'),
'empty-no-data-svg-path' => image_path('illustrations/monitoring/no_data.svg'),
'empty-no-data-small-svg-path' => image_path('illustrations/chart-empty-state-small.svg'),
'empty-unable-to-connect-svg-path' => image_path('illustrations/monitoring/unable_to_connect.svg'),
'custom-dashboard-base-path' => Gitlab::Metrics::Dashboard::RepoDashboardFinder::DASHBOARD_ROOT
'documentation_path' => help_page_path('administration/monitoring/prometheus/index.md'),
'add_dashboard_documentation_path' => help_page_path('operations/metrics/dashboards/index.md', anchor: 'add-a-new-dashboard-to-your-project'),
'empty_getting_started_svg_path' => image_path('illustrations/monitoring/getting_started.svg'),
'empty_loading_svg_path' => image_path('illustrations/monitoring/loading.svg'),
'empty_no_data_svg_path' => image_path('illustrations/monitoring/no_data.svg'),
'empty_no_data_small_svg_path' => image_path('illustrations/chart-empty-state-small.svg'),
'empty_unable_to_connect_svg_path' => image_path('illustrations/monitoring/unable_to_connect.svg'),
'custom_dashboard_base_path' => Gitlab::Metrics::Dashboard::RepoDashboardFinder::DASHBOARD_ROOT
}
end
end
......
......@@ -105,7 +105,6 @@ def merge_request_diff
after_create :ensure_merge_request_diff
after_update :clear_memoized_shas
after_update :clear_memoized_source_branch_exists
after_update :reload_diff_if_branch_changed
after_commit :ensure_metrics, on: [:create, :update], unless: :importing?
after_commit :expire_etag_cache, unless: :importing?
......@@ -871,10 +870,6 @@ def clear_memoized_shas
clear_memoization(:target_branch_head)
end
def clear_memoized_source_branch_exists
clear_memoization(:source_branch_exists)
end
def reload_diff_if_branch_changed
if (saved_change_to_source_branch? || saved_change_to_target_branch?) &&
(source_branch_head && target_branch_head)
......@@ -1126,11 +1121,9 @@ def target_project_namespace
end
def source_branch_exists?
strong_memoize(:source_branch_exists) do
next false unless self.source_project
return false unless self.source_project
self.source_project.repository.branch_exists?(self.source_branch)
end
self.source_project.repository.branch_exists?(self.source_branch)
end
def target_branch_exists?
......
---
title: GlButton migrations for pipeline security tab
merge_request: 39651
author:
type: performance
---
title: Fix composer 404 issues with http auth
merge_request: 38641
author:
type: fixed
---
title: Change show more button to be a table row so to remove manual CSS styling
merge_request: 39788
author:
type: changed
---
title: Fix example within file_hooks documentation
merge_request: 40071
author: Roger Meier
type: fixed
---
title: Include also inherited project members in GraphQL API
merge_request: 39444
author:
type: fixed
---
name: personal_snippet_reference_filters
introduced_by_url:
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/38571
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/235155
group: group::editor
type: development
default_enabled: false
\ No newline at end of file
default_enabled: false
......@@ -1093,6 +1093,11 @@ production: &base
# Default is '.gitlab_workhorse_secret' relative to Rails.root (i.e. root of the GitLab app).
# secret_file: /home/git/gitlab/.gitlab_workhorse_secret
gitlab_kas:
# File that contains the secret key for verifying access for gitlab-kas.
# Default is '.gitlab_kas_secret' relative to Rails.root (i.e. root of the GitLab app).
# secret_file: /home/git/gitlab/.gitlab_kas_secret
## GitLab Elasticsearch settings
elasticsearch:
indexer_path: /home/git/gitlab-elasticsearch-indexer/
......
......@@ -634,6 +634,12 @@
Settings['workhorse'] ||= Settingslogic.new({})
Settings.workhorse['secret_file'] ||= Rails.root.join('.gitlab_workhorse_secret')
#
# GitLab KAS
#
Settings['gitlab_kas'] ||= Settingslogic.new({})
Settings.gitlab_kas['secret_file'] ||= Rails.root.join('.gitlab_kas_secret')
#
# Repositories
#
......
......@@ -71,9 +71,9 @@ Below is an example that will only response on the event `project_create` and
will inform the admins from the GitLab instance that a new project has been created.
```ruby
#!/opt/gitlab/embedded/bin/ruby
# By using the embedded ruby version we eliminate the possibility that our chosen language
# would be unavailable from
#!/opt/gitlab/embedded/bin/ruby
require 'json'
require 'mail'
......
......@@ -59,6 +59,23 @@ There are no plans to deprecate the REST API. To reduce the technical burden of
supporting two APIs in parallel, they should share implementations as much as
possible.
### Deprecation process
Fields marked for removal from the GitLab GraphQL API are first **deprecated** but still available
for at least six releases, and then **removed entirely**.
Removals occur at X.0 and X.6 releases.
For example, a field can be marked as deprecated (but still usable) in %12.7, but can be used until its removal in %13.6.
When marked as deprecated, an alternative should be provided if there is one.
That gives consumers of the GraphQL API a minimum of six months to update their GraphQL queries.
The process is as follows:
1. The field is listed as deprecated in [GraphQL API Reference](reference/index.md).
1. Removals are announced at least one release prior in the Deprecation Warnings section of the
release post (at or prior to X.11 and X.5 releases).
1. Fields meeting criteria are removed in X.0 or X.6.
## Available queries
The GraphQL API includes the following queries at the root level:
......
......@@ -1655,6 +1655,41 @@ type ClusterAgent {
updatedAt: Time
}
"""
Autogenerated input type of ClusterAgentDelete
"""
input ClusterAgentDeleteInput {
"""
A unique identifier for the client performing the mutation.
"""
clientMutationId: String
"""
Global id of the cluster agent that will be deleted
"""
id: ClustersAgentID!
}
"""
Autogenerated return type of ClusterAgentDelete
"""
type ClusterAgentDeletePayload {
"""
A unique identifier for the client performing the mutation.
"""
clientMutationId: String
"""
Errors encountered during execution of the mutation.
"""
errors: [String!]!
}
"""
Identifier of Clusters::Agent
"""
scalar ClustersAgentID
type Commit {
"""
Author of the commit
......@@ -6658,7 +6693,7 @@ type Group {
}
"""
Represents a Group Member
Represents a Group Membership
"""
type GroupMember implements MemberInterface {
"""
......@@ -6686,11 +6721,21 @@ type GroupMember implements MemberInterface {
"""
group: Group
"""
ID of the member
"""
id: ID!
"""