wandersoncferreira / code-review

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

Hangs while fetching diff PR #196

Open jeffjewiss opened 2 years ago

jeffjewiss commented 2 years ago

Code review works great on most PRs for me. When I try to open code review on a PR from GitHub with changes to a package.json and/or package-lock.json (eg. created by dependabot) Emacs hangs with the message from code review "Fetching diff PR...80%".

Emacs never recovers from this state and I need to force quit it.

I can open a PR that has changes to a package-lock.json in magit and see the diff, but any of these types of PRs seem to crash code review.

Is there anything I can do to debug this to try and isolate the problem? Thanks!

ashton314 commented 2 years ago

I've got the same problem, only no package-lock.json file for me. Just an Elixir project. Might not be the files in question. It hangs for me at 80% as well.

ashton314 commented 2 years ago

Update: I've noticed this only happens when I try and open the PR from the magit buffer; if I open the specific PR with forge and then try opening the code-review, it works just fine.

Eirikantonsen commented 2 years ago

Update: I've noticed this only happens when I try and open the PR from the magit buffer; if I open the specific PR with forge and then try opening the code-review, it works just fine.

I have the same problem here, and this does not work for me. Always stuck fetching diff at 80%, even when just calling code-review-start directly.

wandersoncferreira commented 2 years ago

Thanks for the bug report, could you provide a public PR that we can reproduce this error?

necaris commented 2 years ago

@wandersoncferreira I'm running into the same issue, and can reproduce it with a somewhat-artificial PR at https://github.com/necaris/pyright/pull/6 .

Note that this hangs for me consistently (and pegs the CPU) on my work Mac:

❯ bin/doom info
> Executing 'doom info' with Emacs 27.2 at 2022-03-02 22:25:03
    generated    Mar 02, 2022 22:25:03
      system       MacOS 12.2.1 Darwin 21.3.0 arm64
      emacs        27.2 master fd9696b26 ~/.emacs.d/ -> ~/.emacs.d/
      doom         21.12.0-alpha grafted, HEAD -> master, origin/master, origin/HEAD 42e5763 2022-02-23 17:49:53 +0100 ~/.doom.d/ -> ~/.doom.d/
      shell        /opt/homebrew/bin/bash
      features     NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS MODULES THREADS JSON PDUMPER
      traits       batch envvar-file custom-file
      modules      :completion (company +childframe) (vertico +icons) :ui doom doom-dashboard doom-quit (emoji +ascii +github +unicode) hl-todo indent-guides modeline nav-flash ophints (popup +defaults) unicode window-select :editor (evil +everywhere) fold format parinfer :emacs (dired +icons) electric (ibuffer +icons) undo vc :term vterm :checkers syntax :tools docker editorconfig (eval +overlay) gist lookup lsp (magit +forge) (pass +auth) pdf rgb terraform :os macos :lang beancount (cc +lsp) clojure common-lisp data emacs-lisp (go +lsp) json (javascript +lsp) latex markdown ocaml (org +gnuplot +pretty +present) (python +lsp +pyright +conda) qt rest rst (rust +lsp) (scheme +guile +gambit) sh web yaml zig :email (mu4e +org +gmail) :app everywhere (rss +org) :config (default +bindings +smartparens)
      packages     (keychain-environment) (evil-string-inflection) (mu4e-views) (mu4e-alert :pin 91f0657c5b245a9de57aa38391221fb5d141d9bd) (spacemacs-theme) (kaolin-themes) (tree-sitter) (tree-sitter-langs) (shadowenv) (systemd :pin b6ae63a236605b1c5e1069f7d3afe06ae32a7bae) (ox-gfm :pin 99f93011b069e02b37c9660b8fcb45dab086a07f) (evil-escape :disable t) (org-pretty-table :recipe (:host github :repo Fuco1/org-pretty-table) :pin 87772a9469d91770f87bfa788580fca69b9e697a) (org-super-agenda :pin a5557ea4f51571ee9def3cd9a1ab1c38f1a27af7)

However, with my personal (x86_64 Linux) machine it freezes initially but succeeds eventually:

❯ bin/doom info
> Executing 'doom info' with Emacs 27.2 at 2022-03-02 22:27:44
    generated    Mar 02, 2022 22:27:44
      system       "Arch Linux" Linux 5.16.11-arch1-1 x86_64
      emacs        27.2 ~/.emacs.d/ -> ~/.emacs.d/
      doom         21.12.0-alpha HEAD -> master 42e5763 2022-02-23 17:49:53 +0100 ~/.doom.d/ -> ~/.doom.d/
      shell        /bin/bash
      features     XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP
      traits       batch envvar-file custom-file
      modules      :completion (company +childframe) (vertico +icons) :ui doom doom-dashboard doom-quit (emoji +ascii +github +unicode) hl-todo indent-guides modeline nav-flash ophints (popup +defaults) unicode window-select :editor (evil +everywhere) fold format parinfer :emacs (dired +icons) electric (ibuffer +icons) undo vc :term vterm :checkers syntax :tools docker editorconfig (eval +overlay) gist lookup lsp (magit +forge) (pass +auth) pdf rgb terraform :lang beancount (cc +lsp) clojure common-lisp data emacs-lisp (go +lsp) json (javascript +lsp) latex markdown ocaml (org +gnuplot +pretty +present) (python +lsp +pyright +conda) qt rest rst (rust +lsp) (scheme +guile +gambit) sh web yaml zig :email (mu4e +org +gmail) :app everywhere (rss +org) :config (default +bindings +smartparens)
      packages     (keychain-environment) (evil-string-inflection) (mu4e-views) (mu4e-alert :pin 91f0657c5b245a9de57aa38391221fb5d141d9bd) (spacemacs-theme) (kaolin-themes) (tree-sitter) (tree-sitter-langs) (shadowenv) (systemd :pin b6ae63a236605b1c5e1069f7d3afe06ae32a7bae) (ox-gfm :pin 99f93011b069e02b37c9660b8fcb45dab086a07f) (evil-escape :disable t) (org-pretty-table :recipe (:host github :repo Fuco1/org-pretty-table) :pin 87772a9469d91770f87bfa788580fca69b9e697a) (org-super-agenda :pin a5557ea4f51571ee9def3cd9a1ab1c38f1a27af7)
necaris commented 2 years ago

@jeffjewiss @ashton314 can you both confirm if you're on macOS and using emacs-mac from Homebrew? I think I've managed to track my ~crash~ hang down to issues with WKWebView when rendering the code review HTML -- see https://stackoverflow.com/questions/71277105/macos-app-crash-on-wkwebview-with-exc-breakpoint-on-m1

necaris commented 2 years ago

This might be the same as #193

jhelwig commented 2 years ago

@necaris I'm also running into this on an M1 MacBook Pro, using Emacs 28 from https://github.com/d12frosted/homebrew-emacs-plus/

necaris commented 2 years ago

I've run into it while using emacs-plus as well -- in both cases the stacktrace led right back to WKWebView :-( it looks as if this is the same issue as #193 ultimately.