Bitbucket cloud issue
- Dominant language
- Swift
- Stars
- 1.1k
- Forks
- 152
- Avg merge
- 9h 54m
- Merged PRs (30d)
- 2
Description
I'm trying to run DangerSwift on Bitbucket with Bitrise but DangerSwift command always fails with the following error:
`ERROR: Failed to parse JSON: keyNotFound(CodingKeys(stringValue: "user", intValue: nil), Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "danger", intValue: nil), CodingKeys(stringValue: "bitbucket_cloud", intValue: nil), CodingKeys(stringValue: "commits", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0), CodingKeys(stringValue: "author", intValue: nil)], debugDescription: "No value associated with key CodingKeys(stringValue: \"user\", intValue: nil) (\"user\").", underlyingError: nil))
ERROR: Dangerfile eval failed at Dangerfile.swift
ERROR: Could not get the results JSON file at /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/danger-response.json
`
However, It runs locally successfully.
Dangerfile.swift only contains the following code:
```
// swift-tools-version:5.3
import Danger
warn("A NEW PR NOW")
```
I expect that in BitBucketCloud.swift, Comment struct, user variable should be optional
```
extension BitBucketCloud {
public struct Comment: Decodable, Equatable {
public struct Inline: Decodable, Equatable {
public let from: Int?
public let to: Int? // swiftlint:disable:this identifier_name
public let path: String?
}
private enum CodingKeys: String, CodingKey {
case deleted
case content
case createdOn = "created_on"
case user
case updatedOn = "updated_on"
case type
case id // swiftlint:disable:this identifier_name
case inline
}
/// Content of the comment
public let content: Content
/// When the comment was created
public let createdOn: Date
/// Was the comment deleted?
public let deleted: Bool
public let id: Int // swiftlint:disable:this identifier_name
public let inline: Inline?
public let type: String
/// When the comment was updated
public let updatedOn: Date
/// The user that created the comment
public let user: User /// <------ HERE I THINK SHOULD BE OPTIONAL
}
}
```
Thanks in advance
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.