wandersoncferreira / code-review

Code Reviews in Emacs
https://wandersoncferreira.github.io/code-review/
GNU General Public License v3.0
463 stars 51 forks source link

deferred errors when using `code-review-start` with bitbucket pull request. #158

Open Honeypot95 opened 2 years ago

Honeypot95 commented 2 years ago

Describe the bug When trying code-review-start, the mini-buffers says Fetch diff PR..., and after it completes, it fails with deferred error : (wrong-type-argument sequencep number-or-marker-p)

To Reproduce Install the package. M-x code-review-start bitbucket pull request as argument

Expected behavior Some transient menu to open (I have never used the package before).

Desktop (please complete the following information):

Additional context I tried debugging with the usual debug-on-entry and toggle-debug-on-error, but they seem not to work for deferred errors.

wandersoncferreira commented 2 years ago

Thanks for reporting @Honeypot95 . Are you using code-review unpinned in Doom? Your Bitbucket is the Cloud version or Server? Could you check the code-review-log-file path and see what was printed in the log file?

Honeypot95 commented 2 years ago

Hi! my code-review is not unpinned in Doom, my Bitbucket is the Cloud version, and the contents of the code-review-log-file are:


Tue Dec 21 14:06:25 2021 - code-review--build-buffer - (wrong-type-argument number-or-marker-p nil)

Tue Dec 21 14:07:43 2021 - code-review--build-buffer - (wrong-type-argument number-or-marker-p nil)

Tue Dec 21 14:11:07 2021 - code-review--build-buffer - (wrong-type-argument number-or-marker-p nil)

Tue Dec 21 14:13:36 2021 - code-review--build-buffer - (wrong-type-argument number-or-marker-p nil)

Tue Dec 21 14:15:14 2021 - code-review--build-buffer - (wrong-type-argument number-or-marker-p nil)

Tue Dec 21 14:19:55 2021 - code-review--build-buffer - (wrong-type-argument number-or-marker-p nil)

Tue Dec 21 14:21:38 2021 - code-review--build-buffer - (wrong-type-argument number-or-marker-p nil)

Tue Dec 21 14:24:10 2021 - code-review--build-buffer - (wrong-type-argument number-or-marker-p nil)

Tue Dec 21 14:25:28 2021 - code-review--build-buffer - (wrong-type-argument number-or-marker-p nil)

Tue Dec 21 14:26:28 2021 - code-review--build-buffer - (wrong-type-argument number-or-marker-p nil)

Just to be sure, the Cloud version of Bitbucket is the one hosted by Bitbucket themselves, right?

wandersoncferreira commented 2 years ago

Just to be sure, the Cloud version of Bitbucket is the one hosted by Bitbucket themselves, right?

Yes.

The log is unexpected to me, the following error. I just installed a clean default Doom to see this error:


Tue Dec 21 12:27:14 2021 - code-review--auth-token-set? - nil <->((cl-no-applicable-method code-review-diff-deferred nil) (cl-no-applicable-method code-review-infos-deferred nil) (cl-no-applicable-method code-review-infos-deferred nil t))

Tue Dec 21 12:27:14 2021 - code-review--build-buffer - (error "Unknown backend obj created.  Look at ‘code-review-log-file’ and report the bug upstream")

Could you check using this URL https://bitbucket.org/wcferreira/proj_fraldas/pull-requests/1 this is my public repo that I am using to test the integration.

Honeypot95 commented 2 years ago

It seems to work with yours. Do you think it may be an authentication problem? How could I investigate further?

Honeypot95 commented 2 years ago

I just tried another pull request from mine, and it seems to work. I think it fails when there is a very large pull request (the one that I tried first), which makes me think there may be a subtle bug somewhere. I will try to investigate further, but I don't have much elisp skill.

wandersoncferreira commented 2 years ago

Interesting, I noticed some weird results coming back from Bitbucket APIs, for example if I provide pagelen=300 to get the comments from a PR I receive an error, then pagelen=100 makes everything work just fine. Computers :/

I will add more safe guard checks around the results of the Bitbucket API so we can make debug expeditions easier.

saolaolsson commented 2 years ago

Interesting, I noticed some weird results coming back from Bitbucket APIs, for example if I provide pagelen=300 to get the comments from a PR I receive an error, then pagelen=100 makes everything work just fine. Computers :/

That limit is documented (currently) under "Paginated Pull Request Comments" at https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-get

saolaolsson commented 2 years ago

Not exactly the same error message but I get Wed Sep 7 15:26:50 2022 - code-review--build-buffer - (wrong-type-argument listp wrong-type-argument) in the log file when trying to open the test repo PR mentioned above (and the same for other repos I've tested) with package version 20220629.1215.

outinspace commented 1 year ago

I am also getting a similar error: Fetch diff PR...20% "RESULT:(wrong-type-argument listp (message . Login failed due to incorrect login credentials or method. For information on authentication methods for Bitbucket Cloud APIs, visit: https://developer.atlassian.com/cloud/bitbucket/rest/intro/#authentication If you are unsure of which login details or login method to use, visit: https://support.atlassian.com/bitbucket-cloud/docs/log-into-or-connect-to-bitbucket-cloud/)) " Fetch diff PR...40% deferred error : (wrong-type-argument sequencep listp)

My .authinfo.gpg looks like machine api.bitbucket.org/2.0 login nick.XXXX@XXXXXXXX.com^code-review password XXXXXXXXXXX