Commit dfc52765 authored by Fabio Pitino's avatar Fabio Pitino

Merge branch 'sh-add-user-ip-pvs' into 'master'

Add user IP data to external pipeline validation service

See merge request gitlab-org/gitlab!62438
parents 512838e7 410b7bce
...@@ -74,7 +74,9 @@ required number of seconds. ...@@ -74,7 +74,9 @@ required number of seconds.
"id": { "type": "integer" }, "id": { "type": "integer" },
"username": { "type": "string" }, "username": { "type": "string" },
"email": { "type": "string" }, "email": { "type": "string" },
"created_at": { "type": ["string", "null"], "format": "date-time" } "created_at": { "type": ["string", "null"], "format": "date-time" },
"current_sign_in_ip": { "type": ["string", "null"] },
"last_sign_in_ip": { "type": ["string", "null"] }
} }
}, },
"pipeline": { "pipeline": {
......
...@@ -89,7 +89,9 @@ module Gitlab ...@@ -89,7 +89,9 @@ module Gitlab
id: current_user.id, id: current_user.id,
username: current_user.username, username: current_user.username,
email: current_user.email, email: current_user.email,
created_at: current_user.created_at&.iso8601 created_at: current_user.created_at&.iso8601,
current_sign_in_ip: current_user.current_sign_in_ip,
last_sign_in_ip: current_user.last_sign_in_ip
}, },
pipeline: { pipeline: {
sha: pipeline.sha, sha: pipeline.sha,
......
...@@ -32,7 +32,9 @@ ...@@ -32,7 +32,9 @@
"id": { "type": "integer" }, "id": { "type": "integer" },
"username": { "type": "string" }, "username": { "type": "string" },
"email": { "type": "string" }, "email": { "type": "string" },
"created_at": { "type": ["string", "null"], "format": "date-time" } "created_at": { "type": ["string", "null"], "format": "date-time" },
"current_sign_in_ip": { "type": ["string", "null"] },
"last_sign_in_ip": { "type": ["string", "null"] }
} }
}, },
"pipeline": { "pipeline": {
......
...@@ -4,7 +4,7 @@ require 'spec_helper' ...@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Gitlab::Ci::Pipeline::Chain::Validate::External do RSpec.describe Gitlab::Ci::Pipeline::Chain::Validate::External do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user, :with_sign_ins) }
let(:pipeline) { build(:ci_empty_pipeline, user: user, project: project) } let(:pipeline) { build(:ci_empty_pipeline, user: user, project: project) }
let!(:step) { described_class.new(pipeline, command) } let!(:step) { described_class.new(pipeline, command) }
......
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