Skip to content
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

Hub-independence #79

Merged
merged 115 commits into from
May 14, 2017
Merged

Hub-independence #79

merged 115 commits into from
May 14, 2017

Conversation

vermiculus
Copy link
Owner

This is just about ready for release. There is some final testing to do (i.e., I'm just going to used it for a little while to see if it breaks), but everything should be quite stable in this branch now.

Feel free to take this opportunity to review the changes. If you come across any issue in this branch, leave a comment instead of opening up an actual issue.

Fixes #6, #15, #18, #19, #44, #58, and #75

Now, when you create issues, you'll see the labels available for the
repository instead of the previously hard-coded defaults!

Fix #6
I didn't realize this wasn't a built-in.  I'm surprised Emacs doesn't
come with such functionality as core C code.
This should avoid excessively pinging the API.
@vermiculus vermiculus added the enhancement idea for a new feature or refinement of existing functionality label May 13, 2017
@vermiculus vermiculus merged commit ed489e0 into master May 14, 2017
vermiculus added a commit that referenced this pull request May 14, 2017
Hub-independence

Fixes #6, #15, #18, #19, #44, #58, and #75
vermiculus added a commit that referenced this pull request May 14, 2017
Hub-independence

Fix #6
Fix #15
Fix #18
Fix #19
Fix #44
Fix #58
Fix #75
@jgkamat
Copy link
Contributor

jgkamat commented May 14, 2017

I seem to get an error on the new version (this is a repo with no CI):

Debugger entered--Lisp error: (void-function ghubp--process-params)
  ghubp--process-params(nil)
  ghubp-get-repos-owner-repo-commits-ref-status(((owner (login . "jgkamat")) (name . "dotfiles")) "master")
  eval((ghubp-get-repos-owner-repo-commits-ref-status (quote ((owner (login . "jgkamat")) (name . "dotfiles"))) "master"))
  magithub-cache(:ci-status (ghubp-get-repos-owner-repo-commits-ref-status (quote ((owner (login . "jgkamat")) (name . "dotfiles"))) "master") "Getting CI status for branch `master'...")
  magithub-ci-status("master")
  magithub-insert-ci-status-header()
  magithub-maybe-insert-ci-status-header()
  funcall(magithub-maybe-insert-ci-status-header)
  mapc(funcall (magit-insert-upstream-branch-header magit-insert-push-branch-header magit-insert-tags-header magithub-maybe-insert-ci-status-header))
  magit-insert-remaining-headers()
  run-hooks(magit-insert-section-hook)
  magit-insert-head-branch-header()
  magit-insert-headers((magithub-maybe-report-offline-mode magit-insert-error-header magit-insert-diff-filter-header magit-insert-head-branch-header magit-insert-upstream-branch-header magit-insert-push-branch-header magit-insert-tags-header magithub-maybe-insert-ci-status-header))
  magit-insert-status-headers()
  run-hooks(magit-status-sections-hook)
  magit-status-refresh-buffer()
  apply(magit-status-refresh-buffer nil)
  magit-refresh-buffer()
  magit-mode-setup-internal(magit-status-mode nil)
  magit-mode-setup(magit-status-mode)
  magit-status-internal("/home/jay/dotfiles/")
  magit-status(nil)
  funcall-interactively(magit-status nil)
  #<subr call-interactively>(magit-status nil nil)
  ad-Advice-call-interactively(#<subr call-interactively> magit-status nil nil)
  apply(ad-Advice-call-interactively #<subr call-interactively> (magit-status nil nil))
  call-interactively(magit-status nil nil)
  command-execute(magit-status)

I can't seem to find that function being invoked though, that might just be something wrong with the way I installed it?

@vermiculus
Copy link
Owner Author

@jgkamat What version of ghub+ do you have?

@jgkamat
Copy link
Contributor

jgkamat commented May 14, 2017

I was running a ghub+ version from stable, I've just upgraded it to normal melpa (ghub+-20170513.1653), but I still seem to be having the issue. Are there any other packages I need to make sure I have up to date? (Also, I'm using the (defun magithub--api-available-p () t) hack, because I think I'm still getting the ping bug 😢, but that's a seperate issue...

@vermiculus
Copy link
Owner Author

I did neglect to update the package-versions before I pushed to master, so it's possible package.el didn't update ghub+ if it didn't think it had to (fixed in b9878f7). Can you try installing ghub+ manually?

@vermiculus
Copy link
Owner Author

As for the ping bug, do you want to hop on gitter sometime to hash it out?

@jgkamat
Copy link
Contributor

jgkamat commented May 14, 2017

I'll hop on gitter now, I'll see you there. I'll work on installing ghub+ manually too :P

vermiculus added a commit that referenced this pull request May 14, 2017
Try to fix some issues dicussed in #79
@jgkamat
Copy link
Contributor

jgkamat commented May 14, 2017

On updating to the newest version of ghub+, I'm getting this error. It seems to be a problem with getting some tokens or something? (I'm pasting it here to avoid cluttering the gitter):

Debugger entered--Lisp error: (args-out-of-range "" 0 -1)
  ghub--username()
  ghub--token()
  #[1282 "<MAYBE A TOKEN?>" [url-request-extra-headers url-request-method url-request-data ghub-base-url url-http-end-of-headers url-http-response-status "?" ghub--url-encode-params json-encode-list ("Content-Type" . "application/json") ghub--token "Authorization" "token " url-retrieve-synchronously nil mail-fetch-field "Link" rassoc "rel=\"next\"" mapcar #[257 "\300�\301\"\207" [split-string "; "] 4 "\n\n(fn ELT)"] split-string "," string-match "[?&]page=\\([^&>]+\\)" match-string 1 ghub--read-response 100 2 301 signal ghub-301 400 ghub-400 404 ghub-404 422 ghub-422 ghub-http-error ghub--request page cl-delete :key car ghub-unpaginate] 19 "\n\n(fn METHOD RESOURCE &optional PARAMS DATA NOERROR)"]("GET" "/repos/jgkamat/dotfiles/commits/master/status" nil nil nil)
  apply(#[1282 "<MAYBE A TOKEN?>" [url-request-extra-headers url-request-method url-request-data ghub-base-url url-http-end-of-headers url-http-response-status "?" ghub--url-encode-params json-encode-list ("Content-Type" . "application/json") ghub--token "Authorization" "token " url-retrieve-synchronously nil mail-fetch-field "Link" rassoc "rel=\"next\"" mapcar #[257 "\300�\301\"\207" [split-string "; "] 4 "\n\n(fn ELT)"] split-string "," string-match "[?&]page=\\([^&>]+\\)" match-string 1 ghub--read-response 100 2 301 signal ghub-301 400 ghub-400 404 ghub-404 422 ghub-422 ghub-http-error ghub--request page cl-delete :key car ghub-unpaginate] 19 "\n\n(fn METHOD RESOURCE &optional PARAMS DATA NOERROR)"] ("GET" "/repos/jgkamat/dotfiles/commits/master/status" nil nil nil))
  #[(oldfun &rest args) "<MAYBE A TOKEN?>" [magithub-debug-mode args oldfun dry-api message "ghub-request(%S)" apply] 3](#[1282 "<MAYBE A TOKEN?>" [url-request-extra-headers url-request-method url-request-data ghub-base-url url-http-end-of-headers url-http-response-status "?" ghub--url-encode-params json-encode-list ("Content-Type" . "application/json") ghub--token "Authorization" "token " url-retrieve-synchronously nil mail-fetch-field "Link" rassoc "rel=\"next\"" mapcar #[257 "<some weird chars>" [split-string "; "] 4 "\n\n(fn ELT)"] split-string "," string-match "[?&]page=\\([^&>]+\\)" match-string 1 ghub--read-response 100 2 301 signal ghub-301 400 ghub-400 404 ghub-404 422 ghub-422 ghub-http-error ghub--request page cl-delete :key car ghub-unpaginate] 19 "\n\n(fn METHOD RESOURCE &optional PARAMS DATA NOERROR)"] "GET" "/repos/jgkamat/dotfiles/commits/master/status" nil nil nil)
  apply(#[(oldfun &rest args) "<some weird chars>" [magithub-debug-mode args oldfun dry-api message "ghub-request(%S)" apply] 3] #[1282 "<MAYBE A TOKEN?>" [url-request-extra-headers url-request-method url-request-data ghub-base-url url-http-end-of-headers url-http-response-status "?" ghub--url-encode-params json-encode-list ("Content-Type" . "application/json") ghub--token "Authorization" "token " url-retrieve-synchronously nil mail-fetch-field "Link" rassoc "rel=\"next\"" mapcar #[257 "<some weird chars>" [split-string "; "] 4 "\n\n(fn ELT)"] split-string "," string-match "[?&]page=\\([^&>]+\\)" match-string 1 ghub--read-response 100 2 301 signal ghub-301 400 ghub-400 404 ghub-404 422 ghub-422 ghub-http-error ghub--request page cl-delete :key car ghub-unpaginate] 19 "\n\n(fn METHOD RESOURCE &optional PARAMS DATA NOERROR)"] ("GET" "/repos/jgkamat/dotfiles/commits/master/status" nil nil nil))
  ghub--request("GET" "/repos/jgkamat/dotfiles/commits/master/status" nil nil nil)
  ghub-get("/repos/jgkamat/dotfiles/commits/master/status" nil nil)
  apply(ghub-get "/repos/jgkamat/dotfiles/commits/master/status" (nil nil))
  (ghubp--post-process (apply (function ghub-get) (let ((alist (list (cons (quote repo) repo) (cons (quote ref) ref)))) (let ((\.repo\.owner\.login (cdr (assq ... ...))) (\.repo\.name (cdr (assq ... ...))) (\.ref (cdr (assq ... alist)))) (concat "/repos/" (apiwrap--encode-url \.repo\.owner\.login) "/" (apiwrap--encode-url \.repo\.name) "/commits/" (apiwrap--encode-url \.ref) "/status"))) (if (keywordp data) (list (ghubp--pre-process-params (apiwrap-plist->alist (cons data params)))) (list (ghubp--pre-process-params (apiwrap-plist->alist params)) data))))
  ghubp-get-repos-owner-repo-commits-ref-status(((owner (login . "jgkamat")) (name . "dotfiles")) "master")
  eval((ghubp-get-repos-owner-repo-commits-ref-status (quote ((owner (login . "jgkamat")) (name . "dotfiles"))) "master"))
  magithub-cache(:ci-status (ghubp-get-repos-owner-repo-commits-ref-status (quote ((owner (login . "jgkamat")) (name . "dotfiles"))) "master") "Getting CI status for branch `master'...")
  magithub-ci-status("master")
  magithub-insert-ci-status-header()
  magithub-maybe-insert-ci-status-header()
  funcall(magithub-maybe-insert-ci-status-header)
  mapc(funcall (magit-insert-upstream-branch-header magit-insert-push-branch-header magit-insert-tags-header magithub-maybe-insert-ci-status-header))
  magit-insert-remaining-headers()
  run-hooks(magit-insert-section-hook)
  magit-insert-head-branch-header()
  magit-insert-headers((magithub-maybe-report-offline-mode magit-insert-error-header magit-insert-diff-filter-header magit-insert-head-branch-header magit-insert-upstream-branch-header magit-insert-push-branch-header magit-insert-tags-header magithub-maybe-insert-ci-status-header))
  magit-insert-status-headers()
  run-hooks(magit-status-sections-hook)
  magit-status-refresh-buffer()
  apply(magit-status-refresh-buffer nil)
  magit-refresh-buffer()
  magit-mode-setup-internal(magit-status-mode nil)
  magit-mode-setup(magit-status-mode)
  magit-status-internal("/home/jay/dotfiles/emacs/.emacs.d/lisp/")
  magit-status(nil)
  funcall-interactively(magit-status nil)
  #<subr call-interactively>(magit-status nil nil)
  ad-Advice-call-interactively(#<subr call-interactively> magit-status nil nil)
  apply(ad-Advice-call-interactively #<subr call-interactively> (magit-status nil nil))
  call-interactively(magit-status nil nil)
  command-execute(magit-status)

It looks like it's trying to get something from the gh api, failing at getting it, and not handling that (as far as I know), but I have no idea what that could be... I haven't done anything like adding an API key (no instructions in the readme), let me know if I need to do anything like that.

@vermiculus
Copy link
Owner Author

As discussed on gitter (and reproduced here for other readers), this is because you haven't authenticated ghub yet. Instructions have been linked to on the README 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement idea for a new feature or refinement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants