-
-
Notifications
You must be signed in to change notification settings - Fork 368
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 GitJSONDSL
and diffForFile
for BitBucket Server
#764
Conversation
@orta could you review, please? |
|
||
values = values.concat(data.values) | ||
nextPageStart = data.nextPageStart | ||
} while (nextPageStart !== null) |
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.
Collect all pages with changes
@@ -3,7 +3,7 @@ import { dangerSignaturePostfix } from "../../../runner/templates/bitbucketServe | |||
|
|||
describe("API testing - BitBucket Server", () => { | |||
let api: BitBucketServerAPI | |||
let jsonResult: any | |||
let jsonResult: () => any |
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.
Allowing to set jsonResult
as function
. For example for use jest.fn
nextPageStart: 1, | ||
values: ["1"], | ||
}) | ||
.mockReturnValueOnce({ |
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.
Simulate iteration by pages
OK, cool, yeah this looks good 👍 |
Great! Could you make new release, please? |
Yep, this came out in 6.1.4 |
Bitbucket Server API for
diff
sometimes returntruncated: true
in root of response.This means that Bitbucket Server don't provide full diff of all files.
In my practical with Danger, this breaks
modified_files
,created_files
anddeleted_files
.Bitbucket Server has another API, which returns list of changes in PR, without diff.
I replaced
diff
API withchanges
API for generationGitJSONDSL
.Also I reworked
diffForFile
to fix potential bug with Bitbucket Server, whendiff
API may return truncated results.