Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1de7d11e
Commit
1de7d11e
authored
Mar 02, 2021
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a changelog entry
parent
59cb9301
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
ee/changelogs/unreleased/321101-dont-wipe-payloadAttributeMappings-when-omitted.yml
...21101-dont-wipe-payloadAttributeMappings-when-omitted.yml
+5
-0
ee/spec/requests/api/graphql/mutations/alert_management/http_integration/update_spec.rb
...utations/alert_management/http_integration/update_spec.rb
+23
-2
No files found.
ee/changelogs/unreleased/321101-dont-wipe-payloadAttributeMappings-when-omitted.yml
0 → 100644
View file @
1de7d11e
---
title
:
Prevents HttpIntegration.payload_attribute_mapping from being reset when it was not a part of a GraphQL mutation input.
merge_request
:
55511
author
:
type
:
fixed
ee/spec/requests/api/graphql/mutations/alert_management/http_integration/update_spec.rb
View file @
1de7d11e
...
...
@@ -48,10 +48,11 @@ RSpec.describe 'Updating an existing HTTP Integration' do
let
(
:mutation_response
)
{
graphql_mutation_response
(
:http_integration_update
)
}
shared_examples
'ignoring the custom mapping'
do
it
'updates integration without the custom mapping params'
do
it
'updates integration without the custom mapping params'
,
:aggregate_failures
do
post_graphql_mutation
(
mutation
,
current_user:
current_user
)
expect
(
response
).
to
have_gitlab_http_status
(
:success
)
integration
.
reload
expect
(
integration
.
payload_example
).
to
eq
({})
expect
(
integration
.
payload_attribute_mapping
).
to
eq
({})
end
...
...
@@ -67,6 +68,26 @@ RSpec.describe 'Updating an existing HTTP Integration' do
it_behaves_like
'validating the payload_example'
it_behaves_like
'validating the payload_attribute_mappings'
it
'updates the custom mapping params'
,
:aggregate_failures
do
post_graphql_mutation
(
mutation
,
current_user:
current_user
)
expect
(
response
).
to
have_gitlab_http_status
(
:success
)
integration
.
reload
expect
(
integration
.
payload_example
).
to
eq
(
Gitlab
::
Json
.
parse
(
payload_example
))
expect
(
integration
.
payload_attribute_mapping
).
to
eq
(
'start_time'
=>
{
'label'
=>
'Start time'
,
'path'
=>
%w[started_at]
,
'type'
=>
'datetime'
},
'title'
=>
{
'label'
=>
nil
,
'path'
=>
%w[alert name]
,
'type'
=>
'string'
}
)
end
context
'when the custom mappings attributes are not part of the mutation variables'
do
let_it_be
(
:payload_example
)
do
{
'alert'
=>
{
'name'
=>
'Test alert'
,
'desc'
=>
'Description'
}
}
...
...
@@ -100,7 +121,7 @@ RSpec.describe 'Updating an existing HTTP Integration' do
end
end
it
'does not reset
s
the custom mapping attributes'
,
:aggregate_failures
do
it
'does not reset the custom mapping attributes'
,
:aggregate_failures
do
post_graphql_mutation
(
mutation
,
current_user:
current_user
)
integration_response
=
mutation_response
[
'integration'
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment