Commit eb4fe280 authored by Furkan Ayhan's avatar Furkan Ayhan Committed by Bob Van Landuyt

Add commit field to pipeline GraphQL type

parent 89d1ab2d
...@@ -125,6 +125,10 @@ module Types ...@@ -125,6 +125,10 @@ module Types
field :path, GraphQL::Types::String, null: true, field :path, GraphQL::Types::String, null: true,
description: "Relative path to the pipeline's page." description: "Relative path to the pipeline's page."
field :commit, Types::CommitType, null: true,
description: "Git commit of the pipeline.",
calls_gitaly: true
field :commit_path, GraphQL::Types::String, null: true, field :commit_path, GraphQL::Types::String, null: true,
description: 'Path to the commit that triggered the pipeline.' description: 'Path to the commit that triggered the pipeline.'
......
...@@ -14,12 +14,19 @@ module Types ...@@ -14,12 +14,19 @@ module Types
description: 'SHA1 ID of the commit.' description: 'SHA1 ID of the commit.'
field :short_id, type: GraphQL::Types::String, null: false, field :short_id, type: GraphQL::Types::String, null: false,
description: 'Short SHA1 ID of the commit.' description: 'Short SHA1 ID of the commit.'
field :title, type: GraphQL::Types::String, null: true, calls_gitaly: true, field :title, type: GraphQL::Types::String, null: true, calls_gitaly: true,
description: 'Title of the commit message.' description: 'Title of the commit message.'
markdown_field :title_html, null: true markdown_field :title_html, null: true
field :full_title, type: GraphQL::Types::String, null: true, calls_gitaly: true,
description: 'Full title of the commit message.'
markdown_field :full_title_html, null: true
field :description, type: GraphQL::Types::String, null: true, field :description, type: GraphQL::Types::String, null: true,
description: 'Description of the commit message.' description: 'Description of the commit message.'
markdown_field :description_html, null: true markdown_field :description_html, null: true
field :message, type: GraphQL::Types::String, null: true, field :message, type: GraphQL::Types::String, null: true,
description: 'Raw commit message.' description: 'Raw commit message.'
field :authored_date, type: Types::TimeType, null: true, field :authored_date, type: Types::TimeType, null: true,
......
...@@ -8740,6 +8740,8 @@ Represents a code quality degradation on the pipeline. ...@@ -8740,6 +8740,8 @@ Represents a code quality degradation on the pipeline.
| <a id="commitauthoreddate"></a>`authoredDate` | [`Time`](#time) | Timestamp of when the commit was authored. | | <a id="commitauthoreddate"></a>`authoredDate` | [`Time`](#time) | Timestamp of when the commit was authored. |
| <a id="commitdescription"></a>`description` | [`String`](#string) | Description of the commit message. | | <a id="commitdescription"></a>`description` | [`String`](#string) | Description of the commit message. |
| <a id="commitdescriptionhtml"></a>`descriptionHtml` | [`String`](#string) | The GitLab Flavored Markdown rendering of `description`. | | <a id="commitdescriptionhtml"></a>`descriptionHtml` | [`String`](#string) | The GitLab Flavored Markdown rendering of `description`. |
| <a id="commitfulltitle"></a>`fullTitle` | [`String`](#string) | Full title of the commit message. |
| <a id="commitfulltitlehtml"></a>`fullTitleHtml` | [`String`](#string) | The GitLab Flavored Markdown rendering of `full_title`. |
| <a id="commitid"></a>`id` | [`ID!`](#id) | ID (global ID) of the commit. | | <a id="commitid"></a>`id` | [`ID!`](#id) | ID (global ID) of the commit. |
| <a id="commitmessage"></a>`message` | [`String`](#string) | Raw commit message. | | <a id="commitmessage"></a>`message` | [`String`](#string) | Raw commit message. |
| <a id="commitsha"></a>`sha` | [`String!`](#string) | SHA1 ID of the commit. | | <a id="commitsha"></a>`sha` | [`String!`](#string) | SHA1 ID of the commit. |
...@@ -12433,6 +12435,7 @@ Represents a file or directory in the project repository that has been locked. ...@@ -12433,6 +12435,7 @@ Represents a file or directory in the project repository that has been locked.
| <a id="pipelinebeforesha"></a>`beforeSha` | [`String`](#string) | Base SHA of the source branch. | | <a id="pipelinebeforesha"></a>`beforeSha` | [`String`](#string) | Base SHA of the source branch. |
| <a id="pipelinecancelable"></a>`cancelable` | [`Boolean!`](#boolean) | Specifies if a pipeline can be canceled. | | <a id="pipelinecancelable"></a>`cancelable` | [`Boolean!`](#boolean) | Specifies if a pipeline can be canceled. |
| <a id="pipelinecodequalityreports"></a>`codeQualityReports` | [`CodeQualityDegradationConnection`](#codequalitydegradationconnection) | Code Quality degradations reported on the pipeline. (see [Connections](#connections)) | | <a id="pipelinecodequalityreports"></a>`codeQualityReports` | [`CodeQualityDegradationConnection`](#codequalitydegradationconnection) | Code Quality degradations reported on the pipeline. (see [Connections](#connections)) |
| <a id="pipelinecommit"></a>`commit` | [`Commit`](#commit) | Git commit of the pipeline. |
| <a id="pipelinecommitpath"></a>`commitPath` | [`String`](#string) | Path to the commit that triggered the pipeline. | | <a id="pipelinecommitpath"></a>`commitPath` | [`String`](#string) | Path to the commit that triggered the pipeline. |
| <a id="pipelinecommittedat"></a>`committedAt` | [`Time`](#time) | Timestamp of the pipeline's commit. | | <a id="pipelinecommittedat"></a>`committedAt` | [`Time`](#time) | Timestamp of the pipeline's commit. |
| <a id="pipelinecomplete"></a>`complete` | [`Boolean!`](#boolean) | Indicates if a pipeline is complete. | | <a id="pipelinecomplete"></a>`complete` | [`Boolean!`](#boolean) | Indicates if a pipeline is complete. |
......
...@@ -13,7 +13,7 @@ RSpec.describe Types::Ci::PipelineType do ...@@ -13,7 +13,7 @@ RSpec.describe Types::Ci::PipelineType do
duration queued_duration duration queued_duration
coverage created_at updated_at started_at finished_at committed_at coverage created_at updated_at started_at finished_at committed_at
stages user retryable cancelable jobs source_job job downstream stages user retryable cancelable jobs source_job job downstream
upstream path project active user_permissions warnings commit_path uses_needs upstream path project active user_permissions warnings commit commit_path uses_needs
test_report_summary test_suite ref test_report_summary test_suite ref
] ]
......
...@@ -9,7 +9,7 @@ RSpec.describe GitlabSchema.types['Commit'] do ...@@ -9,7 +9,7 @@ RSpec.describe GitlabSchema.types['Commit'] do
it 'contains attributes related to commit' do it 'contains attributes related to commit' do
expect(described_class).to have_graphql_fields( expect(described_class).to have_graphql_fields(
:id, :sha, :short_id, :title, :description, :description_html, :message, :title_html, :authored_date, :id, :sha, :short_id, :title, :full_title, :full_title_html, :description, :description_html, :message, :title_html, :authored_date,
:author_name, :author_gravatar, :author, :web_url, :web_path, :author_name, :author_gravatar, :author, :web_url, :web_path,
:pipelines, :signature_html :pipelines, :signature_html
) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment