Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gitlab Error in merge request with estimate or spent time #548

Merged
merged 4 commits into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions Sources/Danger/GitLabDSL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions Tests/DangerTests/GitLabTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down