Commit e0399247 authored by Nic O'Sullivan's avatar Nic O'Sullivan Committed by Mikołaj Wawrzyniak

Use Bitbucket repo description over project description when importing

When importing a repo from Bitbucket Server the repo representation was
pulling the GitLab project description from the Bitbucket project not
the repo. A Bitbucket project is similar to a GitLab group, so the
Bitbucket project description isn't the necessarily the right thing to
use. Following the Bitbucket Server API docs https://docs.atlassian.com
/bitbucket-server/rest/7.19.2/bitbucket-rest.html#idp181 the repo
representation should just pull from the root of the raw response.

Changelog: fixed
parent da9865d9
......@@ -30,7 +30,7 @@ module BitbucketServer
end
def description
project['description']
raw['description']
end
def full_name
......
......@@ -9,6 +9,7 @@ RSpec.describe BitbucketServer::Representation::Repo do
"slug": "rouge",
"id": 1,
"name": "rouge",
"description": "Rogue Repo",
"scmId": "git",
"state": "AVAILABLE",
"statusMessage": "Available",
......@@ -17,7 +18,7 @@ RSpec.describe BitbucketServer::Representation::Repo do
"key": "TEST",
"id": 1,
"name": "test",
"description": "Test",
"description": "Test Project",
"public": false,
"type": "NORMAL",
"links": {
......@@ -73,7 +74,7 @@ RSpec.describe BitbucketServer::Representation::Repo do
end
describe '#description' do
it { expect(subject.description).to eq('Test') }
it { expect(subject.description).to eq('Rogue Repo') }
end
describe '#full_name' do
......
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