summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCindy Pallares <cindy@gitlab.com>2019-08-05 17:27:59 -0500
committerCindy Pallares <cindy@gitlab.com>2019-08-08 17:52:42 -0500
commita06371cc0e3169976f4834724790c8c2f1fe3678 (patch)
treedd4e1514a7ab2ecbe6c8ed53bd01dba0ab5dfb5c
parente7a997aa25145bfd09ff07009e6a45957dd36b8d (diff)
downloadgitlab-ce-add-release-to-github-importer.tar.gz
Add a field for released_at to GH importeradd-release-to-github-importer
-rw-r--r--changelogs/unreleased/add-release-to-github-importer.yml5
-rw-r--r--lib/gitlab/github_import/importer/releases_importer.rb1
-rw-r--r--spec/lib/gitlab/github_import/importer/releases_importer_spec.rb7
3 files changed, 11 insertions, 2 deletions
diff --git a/changelogs/unreleased/add-release-to-github-importer.yml b/changelogs/unreleased/add-release-to-github-importer.yml
new file mode 100644
index 00000000000..d11e7c725f7
--- /dev/null
+++ b/changelogs/unreleased/add-release-to-github-importer.yml
@@ -0,0 +1,5 @@
+---
+title: Add a field for released_at to GH importer
+merge_request: 31496
+author:
+type: fixed
diff --git a/lib/gitlab/github_import/importer/releases_importer.rb b/lib/gitlab/github_import/importer/releases_importer.rb
index 0e7c9ee0d00..9d925581441 100644
--- a/lib/gitlab/github_import/importer/releases_importer.rb
+++ b/lib/gitlab/github_import/importer/releases_importer.rb
@@ -36,6 +36,7 @@ module Gitlab
description: description_for(release),
created_at: release.created_at,
updated_at: release.updated_at,
+ released_at: release.published_at,
project_id: project.id
}
end
diff --git a/spec/lib/gitlab/github_import/importer/releases_importer_spec.rb b/spec/lib/gitlab/github_import/importer/releases_importer_spec.rb
index 23ae026fb14..0e5419e6c5e 100644
--- a/spec/lib/gitlab/github_import/importer/releases_importer_spec.rb
+++ b/spec/lib/gitlab/github_import/importer/releases_importer_spec.rb
@@ -6,6 +6,7 @@ describe Gitlab::GithubImport::Importer::ReleasesImporter do
let(:importer) { described_class.new(project, client) }
let(:created_at) { Time.new(2017, 1, 1, 12, 00) }
let(:updated_at) { Time.new(2017, 1, 1, 12, 15) }
+ let(:released_at) { Time.new(2017, 1, 1, 12, 00) }
let(:release) do
double(
@@ -13,7 +14,8 @@ describe Gitlab::GithubImport::Importer::ReleasesImporter do
tag_name: '1.0',
body: 'This is my release',
created_at: created_at,
- updated_at: updated_at
+ updated_at: updated_at,
+ published_at: released_at
)
end
@@ -23,7 +25,8 @@ describe Gitlab::GithubImport::Importer::ReleasesImporter do
tag_name: '1.0',
description: 'This is my release',
created_at: created_at,
- updated_at: updated_at
+ updated_at: updated_at,
+ released_at: released_at
}
expect(importer).to receive(:build_releases).and_return([release_hash])