Commit 69a7774c authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'cablett-remove-deprecated-fields' into 'master'

GraphQL: Remove old deprecated fields from docs and API

See merge request gitlab-org/gitlab!44866
parents a0815832 9c103924
......@@ -44,12 +44,5 @@ module Types
null: true,
description: 'Pipelines of the commit ordered latest first',
resolver: Resolvers::CommitPipelinesResolver
field :latest_pipeline,
type: Types::Ci::PipelineType,
null: true,
deprecated: { reason: 'Use `pipelines`', milestone: '12.5' },
description: 'Latest pipeline of the commit',
resolver: Resolvers::CommitPipelinesResolver.last
end
end
......@@ -16,13 +16,5 @@ module Types
description: 'Timestamp of the issue\'s creation'
field :updated_at, Types::TimeType, null: false,
description: 'Timestamp of the issue\'s last activity'
field :token, GraphQL::STRING_TYPE, null: false,
deprecated: { reason: 'Plain text token has been masked for security reasons', milestone: '12.7' },
description: 'API token for the Grafana integration'
def token
object.masked_token
end
end
end
......@@ -98,11 +98,6 @@ module Types
field :task_completion_status, Types::TaskCompletionStatus, null: false,
description: 'Task completion status of the issue'
field :designs, Types::DesignManagement::DesignCollectionType, null: true,
method: :design_collection,
deprecated: { reason: 'Use `designCollection`', milestone: '12.2' },
description: 'The designs associated with this issue'
field :design_collection, Types::DesignManagement::DesignCollectionType, null: true,
description: 'Collection of design images associated with this issue'
......
......@@ -88,9 +88,6 @@ module Types
description: 'Rebase commit SHA of the merge request'
field :rebase_in_progress, GraphQL::BOOLEAN_TYPE, method: :rebase_in_progress?, null: false, calls_gitaly: true,
description: 'Indicates if there is a rebase currently in progress for the merge request'
field :merge_commit_message, GraphQL::STRING_TYPE, method: :default_merge_commit_message, null: true,
deprecated: { reason: 'Use `defaultMergeCommitMessage`', milestone: '11.8' },
description: 'Default merge commit message of the merge request'
field :default_merge_commit_message, GraphQL::STRING_TYPE, null: true,
description: 'Default merge commit message of the merge request'
field :merge_ongoing, GraphQL::BOOLEAN_TYPE, method: :merge_ongoing?, null: false,
......
......@@ -2848,26 +2848,6 @@ type Commit {
"""
id: ID!
"""
Latest pipeline of the commit. Deprecated in 12.5: Use `pipelines`
"""
latestPipeline(
"""
Filter pipelines by the ref they are run for
"""
ref: String
"""
Filter pipelines by the sha of the commit they are run for
"""
sha: String
"""
Filter pipelines by their status
"""
status: PipelineStatusEnum
): Pipeline @deprecated(reason: "Use `pipelines`. Deprecated in 12.5")
"""
Raw commit message
"""
......@@ -7745,11 +7725,6 @@ type EpicIssue implements CurrentUserTodos & Noteable {
"""
designCollection: DesignCollection
"""
The designs associated with this issue. Deprecated in 12.2: Use `designCollection`
"""
designs: DesignCollection @deprecated(reason: "Use `designCollection`. Deprecated in 12.2")
"""
Indicates discussion is locked on the issue
"""
......@@ -8554,11 +8529,6 @@ type GrafanaIntegration {
"""
id: ID!
"""
API token for the Grafana integration. Deprecated in 12.7: Plain text token has been masked for security reasons
"""
token: String! @deprecated(reason: "Plain text token has been masked for security reasons. Deprecated in 12.7")
"""
Timestamp of the issue's last activity
"""
......@@ -10372,11 +10342,6 @@ type Issue implements CurrentUserTodos & Noteable {
"""
designCollection: DesignCollection
"""
The designs associated with this issue. Deprecated in 12.2: Use `designCollection`
"""
designs: DesignCollection @deprecated(reason: "Use `designCollection`. Deprecated in 12.2")
"""
Indicates discussion is locked on the issue
"""
......@@ -12490,11 +12455,6 @@ type MergeRequest implements CurrentUserTodos & Noteable {
last: Int
): LabelConnection
"""
Default merge commit message of the merge request. Deprecated in 11.8: Use `defaultMergeCommitMessage`
"""
mergeCommitMessage: String @deprecated(reason: "Use `defaultMergeCommitMessage`. Deprecated in 11.8")
"""
SHA of the merge request commit (set once merged)
"""
......@@ -21322,11 +21282,6 @@ input Timeframe {
}
type Timelog {
"""
Timestamp of when the time tracked was spent at. Deprecated in 12.10: Use `spentAt`
"""
date: Time! @deprecated(reason: "Use `spentAt`. Deprecated in 12.10")
"""
The issue that logged time was added to
"""
......
......@@ -7792,49 +7792,6 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "latestPipeline",
"description": "Latest pipeline of the commit. Deprecated in 12.5: Use `pipelines`",
"args": [
{
"name": "status",
"description": "Filter pipelines by their status",
"type": {
"kind": "ENUM",
"name": "PipelineStatusEnum",
"ofType": null
},
"defaultValue": null
},
{
"name": "ref",
"description": "Filter pipelines by the ref they are run for",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
},
{
"name": "sha",
"description": "Filter pipelines by the sha of the commit they are run for",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
}
],
"type": {
"kind": "OBJECT",
"name": "Pipeline",
"ofType": null
},
"isDeprecated": true,
"deprecationReason": "Use `pipelines`. Deprecated in 12.5"
},
{
"name": "message",
"description": "Raw commit message",
......@@ -21468,20 +21425,6 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "designs",
"description": "The designs associated with this issue. Deprecated in 12.2: Use `designCollection`",
"args": [
],
"type": {
"kind": "OBJECT",
"name": "DesignCollection",
"ofType": null
},
"isDeprecated": true,
"deprecationReason": "Use `designCollection`. Deprecated in 12.2"
},
{
"name": "discussionLocked",
"description": "Indicates discussion is locked on the issue",
......@@ -23703,24 +23646,6 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "token",
"description": "API token for the Grafana integration. Deprecated in 12.7: Plain text token has been masked for security reasons",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": true,
"deprecationReason": "Plain text token has been masked for security reasons. Deprecated in 12.7"
},
{
"name": "updatedAt",
"description": "Timestamp of the issue's last activity",
......@@ -28369,20 +28294,6 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "designs",
"description": "The designs associated with this issue. Deprecated in 12.2: Use `designCollection`",
"args": [
],
"type": {
"kind": "OBJECT",
"name": "DesignCollection",
"ofType": null
},
"isDeprecated": true,
"deprecationReason": "Use `designCollection`. Deprecated in 12.2"
},
{
"name": "discussionLocked",
"description": "Indicates discussion is locked on the issue",
......@@ -34204,20 +34115,6 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "mergeCommitMessage",
"description": "Default merge commit message of the merge request. Deprecated in 11.8: Use `defaultMergeCommitMessage`",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": true,
"deprecationReason": "Use `defaultMergeCommitMessage`. Deprecated in 11.8"
},
{
"name": "mergeCommitSha",
"description": "SHA of the merge request commit (set once merged)",
......@@ -61924,24 +61821,6 @@
"name": "Timelog",
"description": null,
"fields": [
{
"name": "date",
"description": "Timestamp of when the time tracked was spent at. Deprecated in 12.10: Use `spentAt`",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Time",
"ofType": null
}
},
"isDeprecated": true,
"deprecationReason": "Use `spentAt`. Deprecated in 12.10"
},
{
"name": "issue",
"description": "The issue that logged time was added to",
......@@ -472,7 +472,6 @@ Represents the code coverage summary for a project.
| `description` | String | Description of the commit message |
| `descriptionHtml` | String | The GitLab Flavored Markdown rendering of `description` |
| `id` | ID! | ID (global ID) of the commit |
| `latestPipeline` **{warning-solid}** | Pipeline | **Deprecated:** Use `pipelines`. Deprecated in 12.5 |
| `message` | String | Raw commit message |
| `pipelines` | PipelineConnection | Pipelines of the commit ordered latest first |
| `sha` | String! | SHA1 ID of the commit |
......@@ -1290,7 +1289,6 @@ Relationship between an epic and an issue.
| `description` | String | Description of the issue |
| `descriptionHtml` | String | The GitLab Flavored Markdown rendering of `description` |
| `designCollection` | DesignCollection | Collection of design images associated with this issue |
| `designs` **{warning-solid}** | DesignCollection | **Deprecated:** Use `designCollection`. Deprecated in 12.2 |
| `discussionLocked` | Boolean! | Indicates discussion is locked on the issue |
| `discussions` | DiscussionConnection! | All discussions on this noteable |
| `downvotes` | Int! | Number of downvotes the issue has received |
......@@ -1400,7 +1398,6 @@ Autogenerated return type of EpicTreeReorder.
| `enabled` | Boolean! | Indicates whether Grafana integration is enabled |
| `grafanaUrl` | String! | URL for the Grafana host for the Grafana integration |
| `id` | ID! | Internal ID of the Grafana integration |
| `token` **{warning-solid}** | String! | **Deprecated:** Plain text token has been masked for security reasons. Deprecated in 12.7 |
| `updatedAt` | Time! | Timestamp of the issue's last activity |
### Group
......@@ -1579,7 +1576,6 @@ Represents a recorded measurement (object count) for the Admins.
| `description` | String | Description of the issue |
| `descriptionHtml` | String | The GitLab Flavored Markdown rendering of `description` |
| `designCollection` | DesignCollection | Collection of design images associated with this issue |
| `designs` **{warning-solid}** | DesignCollection | **Deprecated:** Use `designCollection`. Deprecated in 12.2 |
| `discussionLocked` | Boolean! | Indicates discussion is locked on the issue |
| `discussions` | DiscussionConnection! | All discussions on this noteable |
| `downvotes` | Int! | Number of downvotes the issue has received |
......@@ -1900,7 +1896,6 @@ Autogenerated return type of MarkAsSpamSnippet.
| `iid` | String! | Internal ID of the merge request |
| `inProgressMergeCommitSha` | String | Commit SHA of the merge request if merge is in progress |
| `labels` | LabelConnection | Labels of the merge request |
| `mergeCommitMessage` **{warning-solid}** | String | **Deprecated:** Use `defaultMergeCommitMessage`. Deprecated in 11.8 |
| `mergeCommitSha` | String | SHA of the merge request commit (set once merged) |
| `mergeError` | String | Error message due to a merge error |
| `mergeOngoing` | Boolean! | Indicates if a merge is currently occurring |
......@@ -3167,7 +3162,6 @@ Represents a historically accurate report about the timebox.
| Field | Type | Description |
| ----- | ---- | ----------- |
| `date` **{warning-solid}** | Time! | **Deprecated:** Use `spentAt`. Deprecated in 12.10 |
| `issue` | Issue | The issue that logged time was added to |
| `note` | Note | The note where the quick action to add the logged time was executed |
| `spentAt` | Time | Timestamp of when the time tracked was spent at |
......
......@@ -6,13 +6,6 @@ module Types
authorize :read_group_timelogs
field :date,
Types::TimeType,
null: false,
method: :spent_at,
deprecated: { reason: 'Use `spentAt`', milestone: '12.10' },
description: 'Timestamp of when the time tracked was spent at'
field :spent_at,
Types::TimeType,
null: true,
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe GitlabSchema.types['Timelog'] do
let(:fields) { %i[date spent_at time_spent user issue note] }
let(:fields) { %i[spent_at time_spent user issue note] }
it { expect(described_class.graphql_name).to eq('Timelog') }
it { expect(described_class).to have_graphql_fields(fields) }
......
......@@ -36,9 +36,8 @@ RSpec.describe 'Timelogs through GroupQuery' do
expect(graphql_data['group']['groupTimelogsEnabled']).to be_truthy
end
it 'contains correct data' do
it 'contains correct data', :aggregate_failures do
username = timelog_array.map {|data| data['user']['username'] }
date = timelog_array.map { |data| data['date'].to_time }
spent_at = timelog_array.map { |data| data['spentAt'].to_time }
time_spent = timelog_array.map { |data| data['timeSpent'] }
issue_title = timelog_array.map {|data| data['issue']['title'] }
......@@ -46,7 +45,6 @@ RSpec.describe 'Timelogs through GroupQuery' do
epic_title = timelog_array.map {|data| data['issue']['epic']['title'] }
expect(username).to eq([user.username])
expect(date.first).to be_like_time(timelog1.spent_at)
expect(spent_at.first).to be_like_time(timelog1.spent_at)
expect(time_spent).to eq([timelog1.time_spent])
expect(issue_title).to eq([issue.title])
......@@ -121,7 +119,6 @@ RSpec.describe 'Timelogs through GroupQuery' do
def query(timelog_params = params)
timelog_nodes = <<~NODE
nodes {
date
spentAt
timeSpent
user {
......
......@@ -10,7 +10,7 @@ RSpec.describe GitlabSchema.types['Commit'] do
it 'contains attributes related to commit' do
expect(described_class).to have_graphql_fields(
:id, :sha, :title, :description, :description_html, :message, :title_html, :authored_date,
:author_name, :author_gravatar, :author, :web_url, :web_path, :latest_pipeline,
:author_name, :author_gravatar, :author, :web_url, :web_path,
:pipelines, :signature_html
)
end
......
......@@ -7,7 +7,6 @@ RSpec.describe GitlabSchema.types['GrafanaIntegration'] do
%i[
id
grafana_url
token
enabled
created_at
updated_at
......
......@@ -17,7 +17,7 @@ RSpec.describe GitlabSchema.types['Issue'] do
fields = %i[id iid title description state reference author assignees updated_by participants labels milestone due_date
confidential discussion_locked upvotes downvotes user_notes_count user_discussions_count web_path web_url relative_position
emails_disabled subscribed time_estimate total_time_spent human_time_estimate human_total_time_spent closed_at created_at updated_at task_completion_status
designs design_collection alert_management_alert severity current_user_todos moved moved_to]
design_collection alert_management_alert severity current_user_todos moved moved_to]
fields.each do |field_name|
expect(described_class).to have_graphql_field(field_name)
......
......@@ -21,7 +21,7 @@ RSpec.describe GitlabSchema.types['MergeRequest'] do
diff_refs diff_stats diff_stats_summary
force_remove_source_branch merge_status in_progress_merge_commit_sha
merge_error allow_collaboration should_be_rebased rebase_commit_sha
rebase_in_progress merge_commit_message default_merge_commit_message
rebase_in_progress default_merge_commit_message
merge_ongoing mergeable_discussions_state web_url
source_branch_exists target_branch_exists
upvotes downvotes head_pipeline pipelines task_completion_status
......
......@@ -45,7 +45,6 @@ RSpec.describe 'Getting Grafana Integration' do
it_behaves_like 'a working graphql query'
specify { expect(integration_data['token']).to eql grafana_integration.masked_token }
specify { expect(integration_data['grafanaUrl']).to eql grafana_integration.grafana_url }
specify do
......
......@@ -30,7 +30,7 @@ RSpec.describe 'Getting designs related to an issue' do
post_graphql(query(note_fields), current_user: nil)
designs_data = graphql_data['project']['issue']['designs']['designs']
designs_data = graphql_data['project']['issue']['designCollection']['designs']
design_data = designs_data['nodes'].first
note_data = design_data['notes']['nodes'].first
......@@ -56,7 +56,7 @@ RSpec.describe 'Getting designs related to an issue' do
'issue',
{ iid: design.issue.iid.to_s },
query_graphql_field(
'designs', {}, design_node
'designCollection', {}, design_node
)
)
)
......
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