-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Fixing Bitbucket cloud optional user issue #355
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR :)
Can you please add a test for this change and an entry on the CHANGELOG?
Sources/Danger/BitBucketCloud.swift
Outdated
@@ -55,7 +55,7 @@ extension BitBucketCloud { | |||
public let role: Role | |||
|
|||
/// The user who participated in this PR | |||
public let user: User | |||
public let user: User? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this can be optional, if is a participant it needs a user
Sources/Danger/BitBucketCloud.swift
Outdated
@@ -227,7 +227,7 @@ extension BitBucketCloud { | |||
public let updatedOn: Date | |||
|
|||
/// The user that created the comment | |||
public let user: User | |||
public let user: User? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, you can not make a comment if you don't have a User
- if is a participant it needs a user - comment always has user
@f-meloni Thanks for your review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ace!
I don’t know the answer, but I think you always have at least the raw value for the author |
When do you expect to have a new release? |
I think I can make a release today evening |
Awesome, Thank you :) |
referencing, Issue #28 , Bitbucket cloud always fails with 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
This PR introduces optional user variable in case the commit email isn't assigned to a bitbucket user