code-review icon indicating copy to clipboard operation
code-review copied to clipboard

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

Open Honeypot95 opened this issue 3 years ago • 9 comments

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):

  • Ubuntu 20.04
  • Emacs 28.0.50, compiled from source, with Doom Emacs 21.12.30-alpha, Doom Core 3.0.0-alpha

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.

Honeypot95 avatar Dec 21 '21 12:12 Honeypot95

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?

wandersoncferreira avatar Dec 21 '21 14:12 wandersoncferreira

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?

Honeypot95 avatar Dec 21 '21 14:12 Honeypot95

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.

wandersoncferreira avatar Dec 21 '21 15:12 wandersoncferreira

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

Honeypot95 avatar Dec 21 '21 20:12 Honeypot95

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.

Honeypot95 avatar Dec 21 '21 20:12 Honeypot95

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.

wandersoncferreira avatar Dec 21 '21 20:12 wandersoncferreira

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 avatar Sep 07 '22 13:09 saolaolsson

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.

saolaolsson avatar Sep 07 '22 13:09 saolaolsson

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 [email protected]^code-review password XXXXXXXXXXX

outinspace avatar Dec 07 '22 22:12 outinspace