Pull : Add a Fallback for GetPullRequestDiff/Patch #399

Merged
techknowlogick merged 7 commits from 6543/go-sdk:pull_get-diff-patch_add-fallback into master 2020-09-07 03:18:28 +00:00
Owner

follow up of #398

and add TESTs

follow up of #398 and add TESTs
6543 added this to the v0.13.0 milestone 2020-09-04 19:56:11 +00:00
6543 added the
kind/enhancement
label 2020-09-04 19:56:11 +00:00
6543 added 2 commits 2020-09-04 19:56:17 +00:00
Add Tests
All checks were successful
continuous-integration/drone/pr Build is passing
48cfcab96f
6543 reviewed 2020-09-04 20:03:35 +00:00
Dismissed
@ -59,0 +61,4 @@
assert.Len(t, diff, 1310)
patch, err := c.GetPullRequestPatch(c.username, repoName, pullUpdateFile.Index)
assert.NoError(t, err)
assert.True(t, len(patch) > len(diff))
Author
Owner

INFO: since patch contain time infos (witch change each test) i cant check for exact lenth

INFO: since patch contain time infos (witch change each test) i cant check for exact lenth
Contributor

I legitimately wasn't sure how to write tests for this, so I promise if I've got more to contribute in the future, there will be tests. =)

I legitimately wasn't sure how to write tests for this, so I promise if I've got more to contribute in the future, there will be tests. =)
6543 added 1 commit 2020-09-04 20:06:44 +00:00
fix misspell
All checks were successful
continuous-integration/drone/pr Build is passing
5a40a0c60c
abayer reviewed 2020-09-04 20:06:59 +00:00
Dismissed
@ -222,2 +222,4 @@
}
// getPullRequestDiffOrPatch gets the patch or diff file as bytes for a PR
func (c *Client) getPullRequestDiffOrPatch(owner, repo, kind string, index int64) ([]byte, error) {
Contributor

Probably should be getPullRequestDiffOrPatch? =)

Probably should be `getPullRequestDiffOrPatch`? =)
Author
Owner

@abayer good first catch :)

@abayer good first catch :)
6543 marked this conversation as resolved
techknowlogick reviewed 2020-09-04 20:07:18 +00:00
Dismissed
@ -75,2 +75,4 @@
}
func (c *Client) getWebResponse(method, path string, body io.Reader) ([]byte, error) {
req, err := http.NewRequest(method, c.url+path, body)

should auth be included in this request?

should auth be included in this request?
Author
Owner

it would not work ... that's why https://github.com/go-gitea/gitea/pull/11751 was created

it would not work ... that's why https://github.com/go-gitea/gitea/pull/11751 was created
Author
Owner

so fallback only works by using the existing web endpoint wo do not need auth

so fallback only works by using the existing web endpoint wo do not need auth
techknowlogick marked this conversation as resolved
Author
Owner

@abayer if you are on linux

make test-instance create the test instance you can test against with make test

@abayer if you are on linux `make test-instance` create the test instance you can test against with `make test`
6543 added the
status/needs-reviews
label 2020-09-04 22:42:03 +00:00
zeripath approved these changes 2020-09-05 06:21:04 +00:00
Dismissed
6543 added 1 commit 2020-09-06 13:48:28 +00:00
CI.restart()
All checks were successful
continuous-integration/drone/pr Build is passing
11a04460a2
6543 added 1 commit 2020-09-06 17:34:18 +00:00
Merge branch 'master' into pull_get-diff-patch_add-fallback
All checks were successful
continuous-integration/drone/pr Build is passing
9177c79860
techknowlogick approved these changes 2020-09-07 03:10:50 +00:00
Dismissed
techknowlogick removed the
status/needs-reviews
label 2020-09-07 03:11:02 +00:00
techknowlogick added 1 commit 2020-09-07 03:11:49 +00:00
Merge branch 'master' into pull_get-diff-patch_add-fallback
All checks were successful
continuous-integration/drone/pr Build is passing
a1042ff208
techknowlogick merged commit 18f39029e9 into master 2020-09-07 03:18:00 +00:00
6543 deleted branch pull_get-diff-patch_add-fallback 2020-09-07 04:04:07 +00:00
Sign in to join this conversation.
No description provided.