Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/types/project_type.rb')
-rw-r--r--app/graphql/types/project_type.rb175
1 files changed, 91 insertions, 84 deletions
diff --git a/app/graphql/types/project_type.rb b/app/graphql/types/project_type.rb
index f66d8926a9f..7205c615271 100644
--- a/app/graphql/types/project_type.rb
+++ b/app/graphql/types/project_type.rb
@@ -9,54 +9,58 @@ module Types
expose_permissions Types::PermissionTypes::Project
field :id, GraphQL::ID_TYPE, null: false,
- description: 'ID of the project'
+ description: 'ID of the project.'
field :full_path, GraphQL::ID_TYPE, null: false,
- description: 'Full path of the project'
+ description: 'Full path of the project.'
field :path, GraphQL::STRING_TYPE, null: false,
- description: 'Path of the project'
+ description: 'Path of the project.'
+
+ field :sast_ci_configuration, Types::CiConfiguration::Sast::Type, null: true,
+ calls_gitaly: true,
+ description: 'SAST CI configuration for the project.'
field :name_with_namespace, GraphQL::STRING_TYPE, null: false,
- description: 'Full name of the project with its namespace'
+ description: 'Full name of the project with its namespace.'
field :name, GraphQL::STRING_TYPE, null: false,
- description: 'Name of the project (without namespace)'
+ description: 'Name of the project (without namespace).'
field :description, GraphQL::STRING_TYPE, null: true,
- description: 'Short description of the project'
+ description: 'Short description of the project.'
markdown_field :description_html, null: true
field :tag_list, GraphQL::STRING_TYPE, null: true,
- description: 'List of project topics (not Git tags)'
+ description: 'List of project topics (not Git tags).'
field :ssh_url_to_repo, GraphQL::STRING_TYPE, null: true,
- description: 'URL to connect to the project via SSH'
+ description: 'URL to connect to the project via SSH.'
field :http_url_to_repo, GraphQL::STRING_TYPE, null: true,
- description: 'URL to connect to the project via HTTPS'
+ description: 'URL to connect to the project via HTTPS.'
field :web_url, GraphQL::STRING_TYPE, null: true,
- description: 'Web URL of the project'
+ description: 'Web URL of the project.'
field :star_count, GraphQL::INT_TYPE, null: false,
- description: 'Number of times the project has been starred'
+ description: 'Number of times the project has been starred.'
field :forks_count, GraphQL::INT_TYPE, null: false, calls_gitaly: true, # 4 times
- description: 'Number of times the project has been forked'
+ description: 'Number of times the project has been forked.'
field :created_at, Types::TimeType, null: true,
- description: 'Timestamp of the project creation'
+ description: 'Timestamp of the project creation.'
field :last_activity_at, Types::TimeType, null: true,
- description: 'Timestamp of the project last activity'
+ description: 'Timestamp of the project last activity.'
field :archived, GraphQL::BOOLEAN_TYPE, null: true,
- description: 'Indicates the archived status of the project'
+ description: 'Indicates the archived status of the project.'
field :visibility, GraphQL::STRING_TYPE, null: true,
- description: 'Visibility of the project'
+ description: 'Visibility of the project.'
field :container_registry_enabled, GraphQL::BOOLEAN_TYPE, null: true,
- description: 'Indicates if the project stores Docker container images in a container registry'
+ description: 'Indicates if the project stores Docker container images in a container registry.'
field :shared_runners_enabled, GraphQL::BOOLEAN_TYPE, null: true,
- description: 'Indicates if shared runners are enabled for the project'
+ description: 'Indicates if shared runners are enabled for the project.'
field :lfs_enabled, GraphQL::BOOLEAN_TYPE, null: true,
- description: 'Indicates if the project has Large File Storage (LFS) enabled'
+ description: 'Indicates if the project has Large File Storage (LFS) enabled.'
field :merge_requests_ff_only_enabled, GraphQL::BOOLEAN_TYPE, null: true,
description: 'Indicates if no merge commits should be created and all merges should instead be fast-forwarded, which means that merging is only allowed if the branch could be fast-forwarded.'
@@ -67,7 +71,7 @@ module Types
description: 'E-mail address of the service desk.'
field :avatar_url, GraphQL::STRING_TYPE, null: true, calls_gitaly: true,
- description: 'URL to avatar image file of the project'
+ description: 'URL to avatar image file of the project.'
%i[issues merge_requests wiki snippets].each do |feature|
field "#{feature}_enabled", GraphQL::BOOLEAN_TYPE, null: true,
@@ -79,240 +83,246 @@ module Types
end
field :jobs_enabled, GraphQL::BOOLEAN_TYPE, null: true,
- description: 'Indicates if CI/CD pipeline jobs are enabled for the current user'
+ description: 'Indicates if CI/CD pipeline jobs are enabled for the current user.'
field :public_jobs, GraphQL::BOOLEAN_TYPE, method: :public_builds, null: true,
- description: 'Indicates if there is public access to pipelines and job details of the project, including output logs and artifacts'
+ description: 'Indicates if there is public access to pipelines and job details of the project, including output logs and artifacts.'
field :open_issues_count, GraphQL::INT_TYPE, null: true,
- description: 'Number of open issues for the project'
+ description: 'Number of open issues for the project.'
field :import_status, GraphQL::STRING_TYPE, null: true,
- description: 'Status of import background job of the project'
+ description: 'Status of import background job of the project.'
field :jira_import_status, GraphQL::STRING_TYPE, null: true,
- description: 'Status of Jira import background job of the project'
+ description: 'Status of Jira import background job of the project.'
field :only_allow_merge_if_pipeline_succeeds, GraphQL::BOOLEAN_TYPE, null: true,
- description: 'Indicates if merge requests of the project can only be merged with successful jobs'
+ description: 'Indicates if merge requests of the project can only be merged with successful jobs.'
field :allow_merge_on_skipped_pipeline, GraphQL::BOOLEAN_TYPE, null: true,
- description: 'If `only_allow_merge_if_pipeline_succeeds` is true, indicates if merge requests of the project can also be merged with skipped jobs'
+ description: 'If `only_allow_merge_if_pipeline_succeeds` is true, indicates if merge requests of the project can also be merged with skipped jobs.'
field :request_access_enabled, GraphQL::BOOLEAN_TYPE, null: true,
- description: 'Indicates if users can request member access to the project'
+ description: 'Indicates if users can request member access to the project.'
field :only_allow_merge_if_all_discussions_are_resolved, GraphQL::BOOLEAN_TYPE, null: true,
- description: 'Indicates if merge requests of the project can only be merged when all the discussions are resolved'
+ description: 'Indicates if merge requests of the project can only be merged when all the discussions are resolved.'
field :printing_merge_request_link_enabled, GraphQL::BOOLEAN_TYPE, null: true,
- description: 'Indicates if a link to create or view a merge request should display after a push to Git repositories of the project from the command line'
+ description: 'Indicates if a link to create or view a merge request should display after a push to Git repositories of the project from the command line.'
field :remove_source_branch_after_merge, GraphQL::BOOLEAN_TYPE, null: true,
- description: 'Indicates if `Delete source branch` option should be enabled by default for all new merge requests of the project'
+ description: 'Indicates if `Delete source branch` option should be enabled by default for all new merge requests of the project.'
field :autoclose_referenced_issues, GraphQL::BOOLEAN_TYPE, null: true,
- description: 'Indicates if issues referenced by merge requests and commits within the default branch are closed automatically'
+ description: 'Indicates if issues referenced by merge requests and commits within the default branch are closed automatically.'
field :suggestion_commit_message, GraphQL::STRING_TYPE, null: true,
- description: 'The commit message used to apply merge request suggestions'
+ description: 'The commit message used to apply merge request suggestions.'
field :squash_read_only, GraphQL::BOOLEAN_TYPE, null: false, method: :squash_readonly?,
- description: 'Indicates if squash readonly is enabled'
+ description: 'Indicates if `squashReadOnly` is enabled.'
field :namespace, Types::NamespaceType, null: true,
- description: 'Namespace of the project'
+ description: 'Namespace of the project.'
field :group, Types::GroupType, null: true,
- description: 'Group of the project'
+ description: 'Group of the project.'
field :statistics, Types::ProjectStatisticsType,
null: true,
- description: 'Statistics of the project'
+ description: 'Statistics of the project.'
field :repository, Types::RepositoryType, null: true,
- description: 'Git repository of the project'
+ description: 'Git repository of the project.'
field :merge_requests,
Types::MergeRequestType.connection_type,
null: true,
- description: 'Merge requests of the project',
+ description: 'Merge requests of the project.',
extras: [:lookahead],
resolver: Resolvers::ProjectMergeRequestsResolver
field :merge_request,
Types::MergeRequestType,
null: true,
- description: 'A single merge request of the project',
+ description: 'A single merge request of the project.',
resolver: Resolvers::MergeRequestsResolver.single
field :issues,
Types::IssueType.connection_type,
null: true,
- description: 'Issues of the project',
+ description: 'Issues of the project.',
extras: [:lookahead],
resolver: Resolvers::IssuesResolver
field :issue_status_counts,
Types::IssueStatusCountsType,
null: true,
- description: 'Counts of issues by status for the project',
+ description: 'Counts of issues by status for the project.',
extras: [:lookahead],
resolver: Resolvers::IssueStatusCountsResolver
field :milestones, Types::MilestoneType.connection_type, null: true,
- description: 'Milestones of the project',
+ description: 'Milestones of the project.',
resolver: Resolvers::ProjectMilestonesResolver
field :project_members,
- description: 'Members of the project',
+ description: 'Members of the project.',
resolver: Resolvers::ProjectMembersResolver
field :environments,
Types::EnvironmentType.connection_type,
null: true,
- description: 'Environments of the project',
+ description: 'Environments of the project.',
resolver: Resolvers::EnvironmentsResolver
field :environment,
Types::EnvironmentType,
null: true,
- description: 'A single environment of the project',
+ description: 'A single environment of the project.',
resolver: Resolvers::EnvironmentsResolver.single
field :issue,
Types::IssueType,
null: true,
- description: 'A single issue of the project',
+ description: 'A single issue of the project.',
resolver: Resolvers::IssuesResolver.single
- field :packages, Types::Packages::PackageType.connection_type, null: true,
- description: 'Packages of the project',
+ field :packages,
+ description: 'Packages of the project.',
resolver: Resolvers::PackagesResolver
field :pipelines,
null: true,
- description: 'Build pipelines of the project',
+ description: 'Build pipelines of the project.',
extras: [:lookahead],
resolver: Resolvers::ProjectPipelinesResolver
field :pipeline,
Types::Ci::PipelineType,
null: true,
- description: 'Build pipeline of the project',
+ description: 'Build pipeline of the project.',
resolver: Resolvers::ProjectPipelineResolver
field :ci_cd_settings,
Types::Ci::CiCdSettingType,
null: true,
- description: 'CI/CD settings for the project'
+ description: 'CI/CD settings for the project.'
field :sentry_detailed_error,
Types::ErrorTracking::SentryDetailedErrorType,
null: true,
- description: 'Detailed version of a Sentry error on the project',
+ description: 'Detailed version of a Sentry error on the project.',
resolver: Resolvers::ErrorTracking::SentryDetailedErrorResolver
field :grafana_integration,
Types::GrafanaIntegrationType,
null: true,
- description: 'Grafana integration details for the project',
+ description: 'Grafana integration details for the project.',
resolver: Resolvers::Projects::GrafanaIntegrationResolver
field :snippets,
Types::SnippetType.connection_type,
null: true,
- description: 'Snippets of the project',
+ description: 'Snippets of the project.',
resolver: Resolvers::Projects::SnippetsResolver
field :sentry_errors,
Types::ErrorTracking::SentryErrorCollectionType,
null: true,
- description: 'Paginated collection of Sentry errors on the project',
+ description: 'Paginated collection of Sentry errors on the project.',
resolver: Resolvers::ErrorTracking::SentryErrorCollectionResolver
field :boards,
Types::BoardType.connection_type,
null: true,
- description: 'Boards of the project',
+ description: 'Boards of the project.',
max_page_size: 2000,
resolver: Resolvers::BoardsResolver
field :board,
Types::BoardType,
null: true,
- description: 'A single board of the project',
+ description: 'A single board of the project.',
resolver: Resolvers::BoardResolver
field :jira_imports,
Types::JiraImportType.connection_type,
null: true,
- description: 'Jira imports into the project'
+ description: 'Jira imports into the project.'
field :services,
Types::Projects::ServiceType.connection_type,
null: true,
- description: 'Project services',
+ description: 'Project services.',
resolver: Resolvers::Projects::ServicesResolver
field :alert_management_alerts,
Types::AlertManagement::AlertType.connection_type,
null: true,
- description: 'Alert Management alerts of the project',
+ description: 'Alert Management alerts of the project.',
extras: [:lookahead],
resolver: Resolvers::AlertManagement::AlertResolver
field :alert_management_alert,
Types::AlertManagement::AlertType,
null: true,
- description: 'A single Alert Management alert of the project',
+ description: 'A single Alert Management alert of the project.',
resolver: Resolvers::AlertManagement::AlertResolver.single
field :alert_management_alert_status_counts,
Types::AlertManagement::AlertStatusCountsType,
null: true,
- description: 'Counts of alerts by status for the project',
+ description: 'Counts of alerts by status for the project.',
resolver: Resolvers::AlertManagement::AlertStatusCountsResolver
field :alert_management_integrations,
Types::AlertManagement::IntegrationType.connection_type,
null: true,
- description: 'Integrations which can receive alerts for the project',
+ description: 'Integrations which can receive alerts for the project.',
resolver: Resolvers::AlertManagement::IntegrationsResolver
field :releases,
Types::ReleaseType.connection_type,
null: true,
- description: 'Releases of the project',
+ description: 'Releases of the project.',
resolver: Resolvers::ReleasesResolver
field :release,
Types::ReleaseType,
null: true,
- description: 'A single release of the project',
+ description: 'A single release of the project.',
resolver: Resolvers::ReleasesResolver.single,
authorize: :download_code
field :container_expiration_policy,
Types::ContainerExpirationPolicyType,
null: true,
- description: 'The container expiration policy of the project'
+ description: 'The container expiration policy of the project.'
field :container_repositories,
Types::ContainerRepositoryType.connection_type,
null: true,
- description: 'Container repositories of the project',
+ description: 'Container repositories of the project.',
resolver: Resolvers::ContainerRepositoriesResolver
field :container_repositories_count, GraphQL::INT_TYPE, null: false,
- description: 'Number of container repositories in the project'
+ description: 'Number of container repositories in the project.'
field :label,
Types::LabelType,
null: true,
- description: 'A label available on this project' do
+ description: 'A label available on this project.' do
argument :title, GraphQL::STRING_TYPE,
required: true,
- description: 'Title of the label'
+ description: 'Title of the label.'
end
+ field :terraform_state,
+ Types::Terraform::StateType,
+ null: true,
+ description: 'Find a single Terraform state by name.',
+ resolver: Resolvers::Terraform::StatesResolver.single
+
field :terraform_states,
Types::Terraform::StateType.connection_type,
null: true,
- description: 'Terraform states associated with the project',
+ description: 'Terraform states associated with the project.',
resolver: Resolvers::Terraform::StatesResolver
field :pipeline_analytics, Types::Ci::AnalyticsType, null: true,
- description: 'Pipeline analytics',
+ description: 'Pipeline analytics.',
resolver: Resolvers::ProjectPipelineStatisticsResolver
def label(title:)
@@ -327,17 +337,8 @@ module Types
field :labels,
Types::LabelType.connection_type,
null: true,
- description: 'Labels available on this project' do
- argument :search_term, GraphQL::STRING_TYPE,
- required: false,
- description: 'A search term to find labels with'
- end
-
- def labels(search_term: nil)
- LabelsFinder
- .new(current_user, project: project, search: search_term)
- .execute
- end
+ description: 'Labels available on this project.',
+ resolver: Resolvers::LabelsResolver
def avatar_url
object.avatar_url(only_path: false)
@@ -359,6 +360,12 @@ module Types
project.container_repositories.size
end
+ def sast_ci_configuration
+ return unless Ability.allowed?(current_user, :download_code, object)
+
+ ::Security::CiConfiguration::SastParserService.new(object).configuration
+ end
+
private
def project