diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index c88e5d1c60205a867135876bfdb57260358316d8..3703d8e1560c182cb73ea79f8fc8b01ee43194c8 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -9513,6 +9513,30 @@ The edge type for [`CiStage`](#cistage). | <a id="cistageedgecursor"></a>`cursor` | [`String!`](#string) | A cursor for use in pagination. | | <a id="cistageedgenode"></a>`node` | [`CiStage`](#cistage) | The item at the end of the edge. | +#### `CiSubscriptionsProjectConnection` + +The connection type for [`CiSubscriptionsProject`](#cisubscriptionsproject). + +##### Fields + +| Name | Type | Description | +| ---- | ---- | ----------- | +| <a id="cisubscriptionsprojectconnectioncount"></a>`count` | [`Int!`](#int) | Total count of collection. | +| <a id="cisubscriptionsprojectconnectionedges"></a>`edges` | [`[CiSubscriptionsProjectEdge]`](#cisubscriptionsprojectedge) | A list of edges. | +| <a id="cisubscriptionsprojectconnectionnodes"></a>`nodes` | [`[CiSubscriptionsProject]`](#cisubscriptionsproject) | A list of nodes. | +| <a id="cisubscriptionsprojectconnectionpageinfo"></a>`pageInfo` | [`PageInfo!`](#pageinfo) | Information to aid in pagination. | + +#### `CiSubscriptionsProjectEdge` + +The edge type for [`CiSubscriptionsProject`](#cisubscriptionsproject). + +##### Fields + +| Name | Type | Description | +| ---- | ---- | ----------- | +| <a id="cisubscriptionsprojectedgecursor"></a>`cursor` | [`String!`](#string) | A cursor for use in pagination. | +| <a id="cisubscriptionsprojectedgenode"></a>`node` | [`CiSubscriptionsProject`](#cisubscriptionsproject) | The item at the end of the edge. | + #### `ClusterAgentActivityEventConnection` The connection type for [`ClusterAgentActivityEvent`](#clusteragentactivityevent). @@ -23718,6 +23742,8 @@ Represents vulnerability finding of a security report on the pipeline. | <a id="projectcicdsettings"></a>`ciCdSettings` | [`ProjectCiCdSetting`](#projectcicdsetting) | CI/CD settings for the project. | | <a id="projectciconfigpathordefault"></a>`ciConfigPathOrDefault` | [`String!`](#string) | Path of the CI configuration file. | | <a id="projectcijobtokenscope"></a>`ciJobTokenScope` | [`CiJobTokenScopeType`](#cijobtokenscopetype) | The CI Job Tokens scope of access. | +| <a id="projectcisubscribedprojects"></a>`ciSubscribedProjects` | [`CiSubscriptionsProjectConnection`](#cisubscriptionsprojectconnection) | Triggers a new pipeline in the downstream project when a pipeline successfullycompletes on the(upstream) project. (see [Connections](#connections)) | +| <a id="projectcisubscriptionsprojects"></a>`ciSubscriptionsProjects` | [`CiSubscriptionsProjectConnection`](#cisubscriptionsprojectconnection) | Triggers a new pipeline in the(downstream) project when a pipeline successfullycompletes on the upstream project. (see [Connections](#connections)) | | <a id="projectcodecoveragesummary"></a>`codeCoverageSummary` | [`CodeCoverageSummary`](#codecoveragesummary) | Code coverage summary associated with the project. | | <a id="projectcomplianceframeworks"></a>`complianceFrameworks` | [`ComplianceFrameworkConnection`](#complianceframeworkconnection) | Compliance frameworks associated with the project. (see [Connections](#connections)) | | <a id="projectcontainerexpirationpolicy"></a>`containerExpirationPolicy` | [`ContainerExpirationPolicy`](#containerexpirationpolicy) | Container expiration policy of the project. | diff --git a/ee/app/graphql/ee/types/project_type.rb b/ee/app/graphql/ee/types/project_type.rb index 9c7a1246fff24e1ce51c396f8e1719969df624d2..5388cc4a9860709a5bde44fa32b3fd761d48670c 100644 --- a/ee/app/graphql/ee/types/project_type.rb +++ b/ee/app/graphql/ee/types/project_type.rb @@ -307,6 +307,18 @@ module ProjectType null: true, description: 'Member roles available for the group.', resolver: ::Resolvers::MemberRoles::RolesResolver, alpha: { milestone: '16.5' } + + field :ci_subscriptions_projects, + type: ::Types::Ci::Subscriptions::ProjectType.connection_type, + method: :upstream_project_subscriptions, + description: 'Triggers a new pipeline in the(downstream) project when a pipeline successfully' \ + 'completes on the upstream project.' + + field :ci_subscribed_projects, + type: ::Types::Ci::Subscriptions::ProjectType.connection_type, + method: :downstream_project_subscriptions, + description: 'Triggers a new pipeline in the downstream project when a pipeline successfully' \ + 'completes on the(upstream) project.' end def tracking_key diff --git a/ee/app/graphql/types/ci/subscriptions/project_type.rb b/ee/app/graphql/types/ci/subscriptions/project_type.rb index 868e98235c97601e8b9066cbfd572a31f2a232a4..86e13f7a01ddc3a84586aced7143c4d5af28a79d 100644 --- a/ee/app/graphql/types/ci/subscriptions/project_type.rb +++ b/ee/app/graphql/types/ci/subscriptions/project_type.rb @@ -6,6 +6,8 @@ module Subscriptions class ProjectType < BaseObject graphql_name 'CiSubscriptionsProject' + connection_type_class Types::CountableConnectionType + authorize :read_project_subscription field :id, Types::GlobalIDType[::Ci::Subscriptions::Project], description: "Global ID of the subscription." diff --git a/ee/spec/graphql/types/project_type_spec.rb b/ee/spec/graphql/types/project_type_spec.rb index 07ee96412983f9ec32cbdb87e3f21832b3ab1e0c..809c7eea0d3c45eb26471899bf9b644172c5f02b 100644 --- a/ee/spec/graphql/types/project_type_spec.rb +++ b/ee/spec/graphql/types/project_type_spec.rb @@ -24,7 +24,7 @@ code_coverage_summary api_fuzzing_ci_configuration corpuses path_locks incident_management_escalation_policies incident_management_escalation_policy scan_execution_policies network_policies security_training_urls vulnerability_images only_allow_merge_if_all_status_checks_passed dependencies merge_requests_disable_committers_approval - ai_conversations has_jira_vulnerability_issue_creation_enabled + ai_conversations has_jira_vulnerability_issue_creation_enabled ci_subscriptions_projects ci_subscribed_projects ] expect(described_class).to include_graphql_fields(*expected_fields)