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

Fixing Bitbucket cloud optional user issue #355

Merged
merged 9 commits into from
Jun 1, 2020
Merged

Fixing Bitbucket cloud optional user issue #355

merged 9 commits into from
Jun 1, 2020

Conversation

mahmoud-amer-m
Copy link
Contributor

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

Copy link
Member

@f-meloni f-meloni left a 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?

@@ -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?
Copy link
Member

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

@@ -227,7 +227,7 @@ extension BitBucketCloud {
public let updatedOn: Date

/// The user that created the comment
public let user: User
public let user: User?
Copy link
Member

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

@mahmoud-amer-m
Copy link
Contributor Author

mahmoud-amer-m commented May 31, 2020

@f-meloni Thanks for your review.
I did your comments but I've one question,
could the commit author itself be nil?
because if yes, I'll make author variable also as optional.

Copy link
Member

@f-meloni f-meloni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ace!

@f-meloni
Copy link
Member

f-meloni commented Jun 1, 2020

@f-meloni Thanks for your review.
I did your comments but I've one question,
could the commit author itself be nil?
because if yes, I'll make author variable also as optional.

I don’t know the answer, but I think you always have at least the raw value for the author

@f-meloni f-meloni merged commit 7f1b2dc into danger:master Jun 1, 2020
@mahmoud-amer-m
Copy link
Contributor Author

@f-meloni Thanks for your review.
I did your comments but I've one question,
could the commit author itself be nil?
because if yes, I'll make author variable also as optional.

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?

@f-meloni
Copy link
Member

f-meloni commented Jun 2, 2020

I think I can make a release today evening

@mahmoud-amer-m
Copy link
Contributor Author

I think I can make a release today evening

Awesome, Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants