Skip to content

Commit 086017c

Browse files
authored
Merge pull request #548 from oscarcv/master
Gitlab Error in merge request with estimate or spent time
2 parents bddac4e + 440ef2f commit 086017c

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
## Master
1515

16+
- Gitlab Error in merge request with estimate or spent time [@oscarcv][] - [#548](https://github.com/danger/swift/pull/548)
17+
1618
## 3.15.0
1719

1820
- Parse GitHub commit verification [@f-meloni][] - [#547](https://github.com/danger/swift/pull/547)

Sources/Danger/GitLabDSL.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ public extension GitLab {
110110
case totalTimeSpent = "total_time_spent"
111111
}
112112

113-
public let humanTimeEstimate: Int?
114-
public let humanTimeSpent: Int?
113+
public let humanTimeEstimate: String?
114+
public let humanTimeSpent: String?
115115
public let timeEstimate: Int
116116
public let totalTimeSpent: Int
117117
}

Sources/DangerFixtures/DangerDSLResources/DangerDSLGitLab.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ public let DSLGitLabJSON = """
122122
"reference": "!182",
123123
"web_url": "https://gitlab.com/danger-systems/danger.systems/merge_requests/182",
124124
"time_stats": {
125-
"time_estimate": 0,
126-
"total_time_spent": 0,
127-
"human_time_estimate": null,
128-
"human_total_time_spent": null
125+
"time_estimate": 12600,
126+
"total_time_spent": 12600,
127+
"human_time_estimate": "3h 30m",
128+
"human_total_time_spent": "3h 30m",
129129
},
130130
"squash": false,
131131
"subscribed": false,

Tests/DangerTests/GitLabTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ final class GitLabTests: XCTestCase {
1414
state: .active,
1515
username: "f-meloni",
1616
webUrl: "https://gitlab.com/f-meloni")
17-
let expectedTimeStats = GitLab.MergeRequest.TimeStats(humanTimeEstimate: nil,
18-
humanTimeSpent: nil,
19-
timeEstimate: 0,
20-
totalTimeSpent: 0)
17+
let expectedTimeStats = GitLab.MergeRequest.TimeStats(humanTimeEstimate: "3h 30m",
18+
humanTimeSpent: "3h 30m",
19+
timeEstimate: 12600,
20+
totalTimeSpent: 12600)
2121
let orta = GitLab.User(avatarUrl: "https://secure.gravatar.com/avatar/f116cb3be23153ec08b94e8bd4dbcfeb?s=80&d=identicon",
2222
id: 377_669,
2323
name: "Orta",

0 commit comments

Comments
 (0)