diff --git a/CHANGELOG.md b/CHANGELOG.md index da3d08c5..c692136e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ ## Master +- Gitlab Error in merge request with estimate or spent time [@oscarcv][] - [#548](https://github.com/danger/swift/pull/548) + ## 3.15.0 - Parse GitHub commit verification [@f-meloni][] - [#547](https://github.com/danger/swift/pull/547) diff --git a/Sources/Danger/GitLabDSL.swift b/Sources/Danger/GitLabDSL.swift index f26ea4b0..c1c2a50c 100644 --- a/Sources/Danger/GitLabDSL.swift +++ b/Sources/Danger/GitLabDSL.swift @@ -110,8 +110,8 @@ public extension GitLab { case totalTimeSpent = "total_time_spent" } - public let humanTimeEstimate: Int? - public let humanTimeSpent: Int? + public let humanTimeEstimate: String? + public let humanTimeSpent: String? public let timeEstimate: Int public let totalTimeSpent: Int } diff --git a/Sources/DangerFixtures/DangerDSLResources/DangerDSLGitLab.swift b/Sources/DangerFixtures/DangerDSLResources/DangerDSLGitLab.swift index 0afc0402..496fb305 100644 --- a/Sources/DangerFixtures/DangerDSLResources/DangerDSLGitLab.swift +++ b/Sources/DangerFixtures/DangerDSLResources/DangerDSLGitLab.swift @@ -122,10 +122,10 @@ public let DSLGitLabJSON = """ "reference": "!182", "web_url": "https://gitlab.com/danger-systems/danger.systems/merge_requests/182", "time_stats": { - "time_estimate": 0, - "total_time_spent": 0, - "human_time_estimate": null, - "human_total_time_spent": null + "time_estimate": 12600, + "total_time_spent": 12600, + "human_time_estimate": "3h 30m", + "human_total_time_spent": "3h 30m", }, "squash": false, "subscribed": false, diff --git a/Tests/DangerTests/GitLabTests.swift b/Tests/DangerTests/GitLabTests.swift index 66dd55b9..1a1383f4 100644 --- a/Tests/DangerTests/GitLabTests.swift +++ b/Tests/DangerTests/GitLabTests.swift @@ -14,10 +14,10 @@ final class GitLabTests: XCTestCase { state: .active, username: "f-meloni", webUrl: "https://gitlab.com/f-meloni") - let expectedTimeStats = GitLab.MergeRequest.TimeStats(humanTimeEstimate: nil, - humanTimeSpent: nil, - timeEstimate: 0, - totalTimeSpent: 0) + let expectedTimeStats = GitLab.MergeRequest.TimeStats(humanTimeEstimate: "3h 30m", + humanTimeSpent: "3h 30m", + timeEstimate: 12600, + totalTimeSpent: 12600) let orta = GitLab.User(avatarUrl: "https://secure.gravatar.com/avatar/f116cb3be23153ec08b94e8bd4dbcfeb?s=80&d=identicon", id: 377_669, name: "Orta",