Skip to content

Commit

Permalink
Merge pull request #12357 from saraycp/use-merge-request-iid
Browse files Browse the repository at this point in the history
Use the correct field for the merge request number
  • Loading branch information
krauselukas committed Mar 25, 2022
2 parents a7cd353 + 55f8eda commit 229514a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/api/app/components/workflow_run_row_component.rb
@@ -1,7 +1,7 @@
class WorkflowRunRowComponent < ApplicationComponent
SOURCE_NAME_PAYLOAD_MAPPING = {
'pull_request' => ['pull_request', 'number'],
'Merge Request Hook' => ['object_attributes', 'id'],
'Merge Request Hook' => ['object_attributes', 'iid'],
'push' => ['head_commit', 'id'],
'Push Hook' => ['commits', 0, 'id']
}.freeze
Expand Down
6 changes: 3 additions & 3 deletions src/api/spec/components/workflow_run_header_component_spec.rb
Expand Up @@ -174,7 +174,7 @@
"url": "http://example.com/gitlabhq/gitlab-test.git"
},
"object_attributes":{
"id": 99,
"iid": 1,
"url": "http://example.com/diaspora/merge_requests/1"
}
}
Expand Down Expand Up @@ -209,7 +209,7 @@
<<~END_OF_REQUEST
{
"object_attributes":{
"id": 99,
"iid": 1,
"url": "http://example.com/diaspora/merge_requests/1",
"action": "unapproved"
},
Expand All @@ -227,7 +227,7 @@
end

it 'shows a link to the MR' do
expect(rendered_component).to have_link('#99', href: 'http://example.com/diaspora/merge_requests/1')
expect(rendered_component).to have_link('#1', href: 'http://example.com/diaspora/merge_requests/1')
end
end

Expand Down
4 changes: 2 additions & 2 deletions src/api/spec/components/workflow_run_row_component_spec.rb
Expand Up @@ -169,7 +169,7 @@
"url": "http://example.com/gitlabhq/gitlab-test.git"
},
"object_attributes": {
"id": 99,
"iid": 1,
"url": "http://example.com/diaspora/merge_requests/1",
"action": "open"
}
Expand Down Expand Up @@ -202,7 +202,7 @@
end

it 'shows a link to the pull request' do
expect(rendered_component).to have_link('#99', href: 'http://example.com/diaspora/merge_requests/1')
expect(rendered_component).to have_link('#1', href: 'http://example.com/diaspora/merge_requests/1')
end

['close', 'merge', 'open', 'reopen', 'update'].each do |action|
Expand Down

0 comments on commit 229514a

Please sign in to comment.