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

Fix a decode error with BitBucket server #553

Merged
merged 14 commits into from
Mar 2, 2023

Conversation

pepix
Copy link

@pepix pepix commented Dec 27, 2022

Issue

I faced a decode error when I run $ danger-swift pr <pr_url> for a certain pull request in GitBucket Server.
As my investigation, it seems they don't return public field if that repository is forked by someone.
After I made it optional, it works.

error

ERROR: Failed to parse JSON: keyNotFound(CodingKeys(stringValue: "public", intValue: nil), Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "danger", intValue: nil), CodingKeys(stringValue: "bitbucket_server", intValue: nil), CodingKeys(stringValue: "pr", intValue: nil), CodingKeys(stringValue: "fromRef", intValue: nil), CodingKeys(stringValue: "repository", intValue: nil), CodingKeys(stringValue: "project", intValue: nil)], debugDescription: "No value associated with key CodingKeys(stringValue: "public", intValue: nil) ("public").", underlyingError: nil))

ERROR: Dangerfile eval failed at Dangerfile.swift
ERROR: Could not get the results JSON file at /var/folders/__/clhhlm6d5fg7__h0syj9vmtw0000gv/T/danger-response.json

@pepix pepix force-pushed the fix-bitbucket-server-decode-error branch from b5d1359 to d7c3007 Compare December 27, 2022 23:57
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!
Could you please add a test for this? (not a blocker)

@pepix pepix force-pushed the fix-bitbucket-server-decode-error branch 2 times, most recently from a929fc9 to c7b284f Compare December 29, 2022 08:14
@pepix pepix force-pushed the fix-bitbucket-server-decode-error branch from c7b284f to 87916ae Compare December 29, 2022 09:51
@pepix
Copy link
Author

pepix commented Dec 29, 2022

I can't find why CI failed though got no errors locally..

@pepix
Copy link
Author

pepix commented Jan 5, 2023

Posted issue since I found an issue on CI pipeline #556

@f-meloni
Copy link
Member

f-meloni commented Mar 2, 2023

I have made few changes to reduce the noise made from swiftlint and swiftformat, I will merge this so that it can make it in the release and work on swiftlint as a separated issue.

@f-meloni f-meloni merged commit 9094871 into danger:master Mar 2, 2023
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.

3 participants