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

Support Private Repos In Organizations #114

Closed
dmin7b5 opened this issue Jul 30, 2017 · 17 comments
Closed

Support Private Repos In Organizations #114

dmin7b5 opened this issue Jul 30, 2017 · 17 comments
Labels
bug describes a defect in supported/advertised functionality

Comments

@dmin7b5
Copy link

dmin7b5 commented Jul 30, 2017

I've tried using orgname/reponame but I get an invalid name error. And I'm not sure how I would indicate I want a private repo created. In hub I use: hub create orgname/reponame -p -d "Repo Description"

@vermiculus
Copy link
Owner

Can you provide the exact error text?

@dmin7b5
Copy link
Author

dmin7b5 commented Jul 31, 2017

when prompted with: Repository name: myusername/orgname/reponame + I get, "invalid name". Not sure what syntax to use for a private repo on an org.

@vermiculus
Copy link
Owner

Should it not just be orgname/reponame?

Sorry, I'm not that familiar with organizations.

@dmin7b5
Copy link
Author

dmin7b5 commented Jul 31, 2017

Sorry, yes...if you try to delete the myusername part that is pre-populated in the prompt, you get an error saying, "Text is read-only".

@vermiculus
Copy link
Owner

Ahh... I gotcha now. I'll see what I can do for this. Probably before we prompt, we should get a list of all accounts to which the user has push access -- then use that for the prompt.

@vermiculus vermiculus added the bug describes a defect in supported/advertised functionality label Jul 31, 2017
@dmin7b5
Copy link
Author

dmin7b5 commented Jul 31, 2017

ya that would be great, or If we could change that text and do something like orgname/reponame -p (and any other valid hub flags) that would be awesome.

@vermiculus
Copy link
Owner

I'll see what I can do about creating private repositories. The interface for homepage/description might be a little more complicated.

@dmin7b5
Copy link
Author

dmin7b5 commented Jul 31, 2017

Thanks for looking at this...I love what you are doing with magithub. I really enjoy not having to constantly toggle to iterm and back to emacs...you rock!

vermiculus added a commit that referenced this issue Aug 2, 2017
Requires the `read:org' scope for the GitHub token.

Related: #114
vermiculus added a commit that referenced this issue Aug 2, 2017
@vermiculus
Copy link
Owner

@dmin7b5 Can you try out the develop branch? I'm not a member of any organizations so I can't rightly test to see if my changes really work 😉

@dmin7b5
Copy link
Author

dmin7b5 commented Aug 2, 2017

INSTALL
Ok, I was able to add your branch to Spacemacs by doing the following:

#Edit init.el
dotspacemacs-additional-packages '((magithub :fetcher github :repo "vermiculus/magithub" :branch "develop"))

(defun dotspacemacs/user-config ()
(require 'magithub)

TESTING
I then used a local git repo with one file and one commit and hit "H" and was prompted with:

STEP 1
Account:
magithub-create
gitusername
org1
org2
org3

I chose org1 and hit enter

STEP 2
Next prompted with:

Will this be a private repository? (y or n)

I typed "y" and was prompted with:

STEP 3
Repository name: org1/

I typed in a repo name and hit enter

STEP 4
Prompted with:

Description (optional):

I hit enter and got the following error msg:

Symbol's function definition is void: \,@

Hope that helps.

@vermiculus
Copy link
Owner

Alrighty, try again. I tested with creating a private repo myself and everything seems to be in order; just the org stuff remains untested.

Note you'll need the most recent version of ghub+.

@dmin7b5
Copy link
Author

dmin7b5 commented Aug 3, 2017

So I was able to push to an org with a private repo successfully. Some things to note though. I had to add (magithub-feature-autoinject t) to my user-config section of init.el because I kept getting this message popping up in between steps: "Magithub features not configured (pull-request-merge pull-request-checkout) ; see variable ‘magithub-features’ to turn off this message". Once I added that and restarted Spacemacs it went away.

After hitting "u" in the final step to push everything up, I get the message, "API not responding quickly, go offline? (y or n)". I kept hitting "n" and after about 4 of those messages it went away and I could see the commit had worked.

Just an fyi on what versions of stuff I'm using: Emacs (spacemacs) 25.2 with latest pkgs, hub version 2.3.0-pre10.

Thanks for getting this working, it's awesome!

@vermiculus
Copy link
Owner

API offline stuff related to #107.

Re magithub-feature-autoinject; see the README.

I'm glad stuff is working for you!

@dmin7b5
Copy link
Author

dmin7b5 commented Aug 3, 2017

Thanks for the links. Yeah, I'm using gpg so that's why the message is popping up. I've been testing it and your code is working every time. The only odd thing now is that after everything is completed, the last line after the commit info says: "CI: Pending (it seems checks have not yet begun)".

@vermiculus
Copy link
Owner

@dmin7b5 That's to be expected; it takes time for GitHub to notify the CI of the push and for the CI to start the checks. That time is way longer than it takes us to ask for the statuses of the ref we just pushed, so the response comes back null.

I'm unsure of how to handle this without being annoying -- the only thing I can think of is to have some sort of idle-timer hook that'll refresh CI-status, but that'll kick off a full magit-refresh which would probably interrupt any other staging/committing work being done.

@dmin7b5
Copy link
Author

dmin7b5 commented Aug 3, 2017

Good point. Perhaps being more explicit with the notification would suffice, "CI: Pending (awaiting host notification to allow the CI checking process to begin)"

@vermiculus
Copy link
Owner

vermiculus commented Aug 3, 2017

@dmin7b5 When the header is being calculated, though, we can't tell between the following possibilities:

  • GitHub hasn't sent a notification to CI
  • CI hasn't responded to the notification
  • CI hasn't created the build ticket and inserted it into the queue
  • CI hasn't gotten to the ticket in the queue
  • CI hasn't started the build
  • CI hasn't sent GitHub a notification of the build-start
  • GitHub hasn't processed this notification

Trying to be too specific here isn't the answer -- if anything, the message should be more generic.

This conversation might be better suited to a new issue, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug describes a defect in supported/advertised functionality
Projects
None yet
Development

No branches or pull requests

2 participants