Commit 152d17d6 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'nfriend-rename-open-links-to-opened' into 'master'

Rename `open*` release links to `opened*` in GraphQL endpoint

See merge request gitlab-org/gitlab!46497
parents fb7dc6c3 e0b5221a
...@@ -15,22 +15,22 @@ module Types ...@@ -15,22 +15,22 @@ module Types
field :edit_url, GraphQL::STRING_TYPE, null: true, field :edit_url, GraphQL::STRING_TYPE, null: true,
description: "HTTP URL of the release's edit page", description: "HTTP URL of the release's edit page",
authorize: :update_release authorize: :update_release
field :open_merge_requests_url, GraphQL::STRING_TYPE, null: true, field :opened_merge_requests_url, GraphQL::STRING_TYPE, null: true,
description: 'HTTP URL of the merge request page, filtered by this release and `state=open`' description: 'HTTP URL of the merge request page, filtered by this release and `state=open`'
field :merged_merge_requests_url, GraphQL::STRING_TYPE, null: true, field :merged_merge_requests_url, GraphQL::STRING_TYPE, null: true,
description: 'HTTP URL of the merge request page , filtered by this release and `state=merged`' description: 'HTTP URL of the merge request page , filtered by this release and `state=merged`'
field :closed_merge_requests_url, GraphQL::STRING_TYPE, null: true, field :closed_merge_requests_url, GraphQL::STRING_TYPE, null: true,
description: 'HTTP URL of the merge request page , filtered by this release and `state=closed`' description: 'HTTP URL of the merge request page , filtered by this release and `state=closed`'
field :open_issues_url, GraphQL::STRING_TYPE, null: true, field :opened_issues_url, GraphQL::STRING_TYPE, null: true,
description: 'HTTP URL of the issues page, filtered by this release and `state=open`' description: 'HTTP URL of the issues page, filtered by this release and `state=open`'
field :closed_issues_url, GraphQL::STRING_TYPE, null: true, field :closed_issues_url, GraphQL::STRING_TYPE, null: true,
description: 'HTTP URL of the issues page, filtered by this release and `state=closed`' description: 'HTTP URL of the issues page, filtered by this release and `state=closed`'
field :merge_requests_url, GraphQL::STRING_TYPE, null: true, method: :open_merge_requests_url, field :merge_requests_url, GraphQL::STRING_TYPE, null: true, method: :opened_merge_requests_url,
description: 'HTTP URL of the merge request page filtered by this release', description: 'HTTP URL of the merge request page filtered by this release',
deprecated: { reason: 'Use `open_merge_requests_url`', milestone: '13.6' } deprecated: { reason: 'Use `openedMergeRequestsUrl`', milestone: '13.6' }
field :issues_url, GraphQL::STRING_TYPE, null: true, method: :open_issues_url, field :issues_url, GraphQL::STRING_TYPE, null: true, method: :opened_issues_url,
description: 'HTTP URL of the issues page filtered by this release', description: 'HTTP URL of the issues page filtered by this release',
deprecated: { reason: 'Use `open_issues_url`', milestone: '13.6' } deprecated: { reason: 'Use `openedIssuesUrl`', milestone: '13.6' }
end end
end end
...@@ -23,7 +23,7 @@ class ReleasePresenter < Gitlab::View::Presenter::Delegated ...@@ -23,7 +23,7 @@ class ReleasePresenter < Gitlab::View::Presenter::Delegated
project_release_url(project, release) project_release_url(project, release)
end end
def open_merge_requests_url def opened_merge_requests_url
return unless release_mr_issue_urls_available? return unless release_mr_issue_urls_available?
project_merge_requests_url(project, params_for_issues_and_mrs) project_merge_requests_url(project, params_for_issues_and_mrs)
...@@ -41,7 +41,7 @@ class ReleasePresenter < Gitlab::View::Presenter::Delegated ...@@ -41,7 +41,7 @@ class ReleasePresenter < Gitlab::View::Presenter::Delegated
project_merge_requests_url(project, params_for_issues_and_mrs(state: 'closed')) project_merge_requests_url(project, params_for_issues_and_mrs(state: 'closed'))
end end
def open_issues_url def opened_issues_url
return unless release_mr_issue_urls_available? return unless release_mr_issue_urls_available?
project_issues_url(project, params_for_issues_and_mrs) project_issues_url(project, params_for_issues_and_mrs)
......
...@@ -17273,14 +17273,14 @@ type ReleaseLinks { ...@@ -17273,14 +17273,14 @@ type ReleaseLinks {
editUrl: String editUrl: String
""" """
HTTP URL of the issues page filtered by this release. Deprecated in 13.6: Use `open_issues_url` HTTP URL of the issues page filtered by this release. Deprecated in 13.6: Use `openedIssuesUrl`
""" """
issuesUrl: String @deprecated(reason: "Use `open_issues_url`. Deprecated in 13.6") issuesUrl: String @deprecated(reason: "Use `openedIssuesUrl`. Deprecated in 13.6")
""" """
HTTP URL of the merge request page filtered by this release. Deprecated in 13.6: Use `open_merge_requests_url` HTTP URL of the merge request page filtered by this release. Deprecated in 13.6: Use `openedMergeRequestsUrl`
""" """
mergeRequestsUrl: String @deprecated(reason: "Use `open_merge_requests_url`. Deprecated in 13.6") mergeRequestsUrl: String @deprecated(reason: "Use `openedMergeRequestsUrl`. Deprecated in 13.6")
""" """
HTTP URL of the merge request page , filtered by this release and `state=merged` HTTP URL of the merge request page , filtered by this release and `state=merged`
...@@ -17290,12 +17290,12 @@ type ReleaseLinks { ...@@ -17290,12 +17290,12 @@ type ReleaseLinks {
""" """
HTTP URL of the issues page, filtered by this release and `state=open` HTTP URL of the issues page, filtered by this release and `state=open`
""" """
openIssuesUrl: String openedIssuesUrl: String
""" """
HTTP URL of the merge request page, filtered by this release and `state=open` HTTP URL of the merge request page, filtered by this release and `state=open`
""" """
openMergeRequestsUrl: String openedMergeRequestsUrl: String
""" """
HTTP URL of the release HTTP URL of the release
......
...@@ -49821,7 +49821,7 @@ ...@@ -49821,7 +49821,7 @@
}, },
{ {
"name": "issuesUrl", "name": "issuesUrl",
"description": "HTTP URL of the issues page filtered by this release. Deprecated in 13.6: Use `open_issues_url`", "description": "HTTP URL of the issues page filtered by this release. Deprecated in 13.6: Use `openedIssuesUrl`",
"args": [ "args": [
], ],
...@@ -49831,11 +49831,11 @@ ...@@ -49831,11 +49831,11 @@
"ofType": null "ofType": null
}, },
"isDeprecated": true, "isDeprecated": true,
"deprecationReason": "Use `open_issues_url`. Deprecated in 13.6" "deprecationReason": "Use `openedIssuesUrl`. Deprecated in 13.6"
}, },
{ {
"name": "mergeRequestsUrl", "name": "mergeRequestsUrl",
"description": "HTTP URL of the merge request page filtered by this release. Deprecated in 13.6: Use `open_merge_requests_url`", "description": "HTTP URL of the merge request page filtered by this release. Deprecated in 13.6: Use `openedMergeRequestsUrl`",
"args": [ "args": [
], ],
...@@ -49845,7 +49845,7 @@ ...@@ -49845,7 +49845,7 @@
"ofType": null "ofType": null
}, },
"isDeprecated": true, "isDeprecated": true,
"deprecationReason": "Use `open_merge_requests_url`. Deprecated in 13.6" "deprecationReason": "Use `openedMergeRequestsUrl`. Deprecated in 13.6"
}, },
{ {
"name": "mergedMergeRequestsUrl", "name": "mergedMergeRequestsUrl",
...@@ -49862,7 +49862,7 @@ ...@@ -49862,7 +49862,7 @@
"deprecationReason": null "deprecationReason": null
}, },
{ {
"name": "openIssuesUrl", "name": "openedIssuesUrl",
"description": "HTTP URL of the issues page, filtered by this release and `state=open`", "description": "HTTP URL of the issues page, filtered by this release and `state=open`",
"args": [ "args": [
...@@ -49876,7 +49876,7 @@ ...@@ -49876,7 +49876,7 @@
"deprecationReason": null "deprecationReason": null
}, },
{ {
"name": "openMergeRequestsUrl", "name": "openedMergeRequestsUrl",
"description": "HTTP URL of the merge request page, filtered by this release and `state=open`", "description": "HTTP URL of the merge request page, filtered by this release and `state=open`",
"args": [ "args": [
...@@ -2304,11 +2304,11 @@ Evidence for a release. ...@@ -2304,11 +2304,11 @@ Evidence for a release.
| `closedIssuesUrl` | String | HTTP URL of the issues page, filtered by this release and `state=closed` | | `closedIssuesUrl` | String | HTTP URL of the issues page, filtered by this release and `state=closed` |
| `closedMergeRequestsUrl` | String | HTTP URL of the merge request page , filtered by this release and `state=closed` | | `closedMergeRequestsUrl` | String | HTTP URL of the merge request page , filtered by this release and `state=closed` |
| `editUrl` | String | HTTP URL of the release's edit page | | `editUrl` | String | HTTP URL of the release's edit page |
| `issuesUrl` **{warning-solid}** | String | **Deprecated:** Use `open_issues_url`. Deprecated in 13.6 | | `issuesUrl` **{warning-solid}** | String | **Deprecated:** Use `openedIssuesUrl`. Deprecated in 13.6 |
| `mergeRequestsUrl` **{warning-solid}** | String | **Deprecated:** Use `open_merge_requests_url`. Deprecated in 13.6 | | `mergeRequestsUrl` **{warning-solid}** | String | **Deprecated:** Use `openedMergeRequestsUrl`. Deprecated in 13.6 |
| `mergedMergeRequestsUrl` | String | HTTP URL of the merge request page , filtered by this release and `state=merged` | | `mergedMergeRequestsUrl` | String | HTTP URL of the merge request page , filtered by this release and `state=merged` |
| `openIssuesUrl` | String | HTTP URL of the issues page, filtered by this release and `state=open` | | `openedIssuesUrl` | String | HTTP URL of the issues page, filtered by this release and `state=open` |
| `openMergeRequestsUrl` | String | HTTP URL of the merge request page, filtered by this release and `state=open` | | `openedMergeRequestsUrl` | String | HTTP URL of the merge request page, filtered by this release and `state=open` |
| `selfUrl` | String | HTTP URL of the release | | `selfUrl` | String | HTTP URL of the release |
### ReleaseSource ### ReleaseSource
......
...@@ -30,8 +30,8 @@ module API ...@@ -30,8 +30,8 @@ module API
expose :evidences, using: Entities::Releases::Evidence, expose_nil: false, if: ->(_, _) { can_download_code? } expose :evidences, using: Entities::Releases::Evidence, expose_nil: false, if: ->(_, _) { can_download_code? }
expose :_links do expose :_links do
expose :self_url, as: :self, expose_nil: false expose :self_url, as: :self, expose_nil: false
expose :open_merge_requests_url, as: :merge_requests_url, expose_nil: false expose :opened_merge_requests_url, as: :merge_requests_url, expose_nil: false
expose :open_issues_url, as: :issues_url, expose_nil: false expose :opened_issues_url, as: :issues_url, expose_nil: false
expose :edit_url, expose_nil: false expose :edit_url, expose_nil: false
end end
......
...@@ -8,10 +8,10 @@ RSpec.describe GitlabSchema.types['ReleaseLinks'] do ...@@ -8,10 +8,10 @@ RSpec.describe GitlabSchema.types['ReleaseLinks'] do
it 'has the expected fields' do it 'has the expected fields' do
expected_fields = %w[ expected_fields = %w[
selfUrl selfUrl
openMergeRequestsUrl openedMergeRequestsUrl
mergedMergeRequestsUrl mergedMergeRequestsUrl
closedMergeRequestsUrl closedMergeRequestsUrl
openIssuesUrl openedIssuesUrl
closedIssuesUrl closedIssuesUrl
editUrl editUrl
mergeRequestsUrl mergeRequestsUrl
......
...@@ -64,8 +64,8 @@ RSpec.describe ReleasePresenter do ...@@ -64,8 +64,8 @@ RSpec.describe ReleasePresenter do
end end
end end
describe '#open_merge_requests_url' do describe '#opened_merge_requests_url' do
subject { presenter.open_merge_requests_url } subject { presenter.opened_merge_requests_url }
it 'returns merge requests url with state=open' do it 'returns merge requests url with state=open' do
is_expected.to eq(project_merge_requests_url(project, opened_url_params)) is_expected.to eq(project_merge_requests_url(project, opened_url_params))
...@@ -112,8 +112,8 @@ RSpec.describe ReleasePresenter do ...@@ -112,8 +112,8 @@ RSpec.describe ReleasePresenter do
end end
end end
describe '#open_issues_url' do describe '#opened_issues_url' do
subject { presenter.open_issues_url } subject { presenter.opened_issues_url }
it 'returns issues url with state=open' do it 'returns issues url with state=open' do
is_expected.to eq(project_issues_url(project, opened_url_params)) is_expected.to eq(project_issues_url(project, opened_url_params))
......
...@@ -184,10 +184,10 @@ RSpec.describe 'Query.project(fullPath).release(tagName)' do ...@@ -184,10 +184,10 @@ RSpec.describe 'Query.project(fullPath).release(tagName)' do
let(:release_fields) do let(:release_fields) do
query_graphql_field(:links, nil, %{ query_graphql_field(:links, nil, %{
selfUrl selfUrl
openMergeRequestsUrl openedMergeRequestsUrl
mergedMergeRequestsUrl mergedMergeRequestsUrl
closedMergeRequestsUrl closedMergeRequestsUrl
openIssuesUrl openedIssuesUrl
closedIssuesUrl closedIssuesUrl
mergeRequestsUrl mergeRequestsUrl
issuesUrl issuesUrl
...@@ -199,10 +199,10 @@ RSpec.describe 'Query.project(fullPath).release(tagName)' do ...@@ -199,10 +199,10 @@ RSpec.describe 'Query.project(fullPath).release(tagName)' do
expect(data).to eq( expect(data).to eq(
'selfUrl' => project_release_url(project, release), 'selfUrl' => project_release_url(project, release),
'openMergeRequestsUrl' => project_merge_requests_url(project, opened_url_params), 'openedMergeRequestsUrl' => project_merge_requests_url(project, opened_url_params),
'mergedMergeRequestsUrl' => project_merge_requests_url(project, merged_url_params), 'mergedMergeRequestsUrl' => project_merge_requests_url(project, merged_url_params),
'closedMergeRequestsUrl' => project_merge_requests_url(project, closed_url_params), 'closedMergeRequestsUrl' => project_merge_requests_url(project, closed_url_params),
'openIssuesUrl' => project_issues_url(project, opened_url_params), 'openedIssuesUrl' => project_issues_url(project, opened_url_params),
'closedIssuesUrl' => project_issues_url(project, closed_url_params), 'closedIssuesUrl' => project_issues_url(project, closed_url_params),
'mergeRequestsUrl' => project_merge_requests_url(project, opened_url_params), 'mergeRequestsUrl' => project_merge_requests_url(project, opened_url_params),
'issuesUrl' => project_issues_url(project, opened_url_params) 'issuesUrl' => project_issues_url(project, opened_url_params)
......
...@@ -42,10 +42,10 @@ RSpec.describe 'Query.project(fullPath).releases()' do ...@@ -42,10 +42,10 @@ RSpec.describe 'Query.project(fullPath).releases()' do
} }
links { links {
selfUrl selfUrl
openMergeRequestsUrl openedMergeRequestsUrl
mergedMergeRequestsUrl mergedMergeRequestsUrl
closedMergeRequestsUrl closedMergeRequestsUrl
openIssuesUrl openedIssuesUrl
closedIssuesUrl closedIssuesUrl
mergeRequestsUrl mergeRequestsUrl
issuesUrl issuesUrl
...@@ -111,10 +111,10 @@ RSpec.describe 'Query.project(fullPath).releases()' do ...@@ -111,10 +111,10 @@ RSpec.describe 'Query.project(fullPath).releases()' do
}, },
'links' => { 'links' => {
'selfUrl' => project_release_url(project, release), 'selfUrl' => project_release_url(project, release),
'openMergeRequestsUrl' => project_merge_requests_url(project, opened_url_params), 'openedMergeRequestsUrl' => project_merge_requests_url(project, opened_url_params),
'mergedMergeRequestsUrl' => project_merge_requests_url(project, merged_url_params), 'mergedMergeRequestsUrl' => project_merge_requests_url(project, merged_url_params),
'closedMergeRequestsUrl' => project_merge_requests_url(project, closed_url_params), 'closedMergeRequestsUrl' => project_merge_requests_url(project, closed_url_params),
'openIssuesUrl' => project_issues_url(project, opened_url_params), 'openedIssuesUrl' => project_issues_url(project, opened_url_params),
'closedIssuesUrl' => project_issues_url(project, closed_url_params), 'closedIssuesUrl' => project_issues_url(project, closed_url_params),
'mergeRequestsUrl' => project_merge_requests_url(project, opened_url_params), 'mergeRequestsUrl' => project_merge_requests_url(project, opened_url_params),
'issuesUrl' => project_issues_url(project, opened_url_params) 'issuesUrl' => project_issues_url(project, opened_url_params)
......
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