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
4b4b1db6
Commit
4b4b1db6
authored
Apr 06, 2021
by
Kyle Wiebers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch '326106-correlation-id-to-validation-service' into 'master'"
This reverts merge request !58486
parent
251a396f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
20 deletions
+3
-20
changelogs/unreleased/326106-correlation-id-to-validation-service.yml
...nreleased/326106-correlation-id-to-validation-service.yml
+0
-5
lib/gitlab/ci/pipeline/chain/validate/external.rb
lib/gitlab/ci/pipeline/chain/validate/external.rb
+2
-4
spec/lib/gitlab/ci/pipeline/chain/validate/external_spec.rb
spec/lib/gitlab/ci/pipeline/chain/validate/external_spec.rb
+1
-11
No files found.
changelogs/unreleased/326106-correlation-id-to-validation-service.yml
deleted
100644 → 0
View file @
251a396f
---
title
:
Add correlation id in X-Request-ID for external pipeline validation
merge_request
:
58486
author
:
type
:
other
lib/gitlab/ci/pipeline/chain/validate/external.rb
View file @
4b4b1db6
...
...
@@ -69,10 +69,8 @@ module Gitlab
end
def
validate_service_request
headers
=
{
'X-Request-ID'
=>
Labkit
::
Correlation
::
CorrelationId
.
current_id
,
'X-Gitlab-Token'
=>
validation_service_token
}.
compact
headers
=
{}
headers
[
'X-Gitlab-Token'
]
=
validation_service_token
if
validation_service_token
Gitlab
::
HTTP
.
post
(
validation_service_url
,
timeout:
validation_service_timeout
,
...
...
spec/lib/gitlab/ci/pipeline/chain/validate/external_spec.rb
View file @
4b4b1db6
...
...
@@ -127,23 +127,13 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Validate::External do
it
'passes token in X-Gitlab-Token header'
do
expect
(
::
Gitlab
::
HTTP
).
to
receive
(
:post
)
do
|
_url
,
params
|
expect
(
params
[
:headers
]).
to
include
({
'X-Gitlab-Token'
=>
'123'
})
expect
(
params
[
:headers
]).
to
eq
({
'X-Gitlab-Token'
=>
'123'
})
end
perform!
end
end
it
'passes the correlation id in X-Request-ID header'
do
allow
(
Labkit
::
Correlation
::
CorrelationId
).
to
receive
(
:current_id
).
and_return
(
'correlation-id'
)
expect
(
::
Gitlab
::
HTTP
).
to
receive
(
:post
)
do
|
_url
,
params
|
expect
(
params
[
:headers
]).
to
include
({
'X-Request-ID'
=>
'correlation-id'
})
end
perform!
end
context
'when validation returns 200 OK'
do
before
do
stub_request
(
:post
,
validation_service_url
).
to_return
(
status:
200
,
body:
"{}"
)
...
...
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