-
Notifications
You must be signed in to change notification settings - Fork 146
Conversation
Hi! FYI, the commit from @jack-chapman is now merged on |
Latest master has been merged, and still awaiting a courageous enterprise user to test the PR lol. |
I don't use Github Enterprise sorry :( |
Sorry sorry, I'll give it a go. Moving fast I see :) |
@kodaman2 getting
I am able to authenticate to the GHE server with my token though
|
Not sure what's going on here... thought i might have found the issue, where the username was missing in the octokit authentication call, but so far no dice. I've tried...
Nada |
Ok I think I got to the bottom of this, hopefully lol. As it looks octokit/rest documentation site is only for version 16+ and you can't filter for older versions hence why this is not working, there has been tons of changes some which include parameter names and function names. I downloaded octokit/rest 14.0.8 the version code-notes is using and looked at the source code, and got a bit lucky that version had an example for github enterprise, thought I am not sure if only oauth auth works or token so I wrote two js scripts to see which one works or if both do. https://github.com/kodaman2/octokit-api-test
Also just for added compatibility even if the above scripts work, I think I might suggest upgrading octokit/rest. So please test latest octokit version
If neither of those yield any results a good idea might be to do vscode live share, and do a little remote debugging. |
As a side note this is how much the interface changed from 14 to 16, that's why baseUrl wasn't working 😃, if latest.js works, I'll submit another PR to upgrade octokit version: v14.0.8: export interface Options {
timeout?: number;
host?: string;
pathPrefix?: string;
protocol?: string;
port?: number;
proxy?: string;
ca?: string;
headers?: {[header: string]: any};
requestMedia?: string;
rejectUnauthorized?: boolean;
family?: number;
} v16.32.0: export interface Options {
auth?:
| string
| { username: string; password: string; on2fa: () => Promise<string> }
| { clientId: string; clientSecret: string }
| { (): string | Promise<string> };
userAgent?: string;
previews?: string[];
baseUrl?: string;
log?: {
debug?: (message: string, info?: object) => void;
info?: (message: string, info?: object) => void;
warn?: (message: string, info?: object) => void;
error?: (message: string, info?: object) => void;
};
request?: {
agent?: http.Agent;
timeout?: number;
};
timeout?: number; // Deprecated
headers?: { [header: string]: any }; // Deprecated
agent?: http.Agent; // Deprecated
[option: string]: any;
} @lauthieb octokit/rest version 14.0.8 is nearly 2 years old with quite a few deprecated functions, given that it is only used for gists, do you want to stick with 14.0.8 or upgrade to the latest? |
@kodaman2 latest worked. The other two did not |
ok, awesome, I'll work on upgrading octokit/rest then, and re-editing the request on this repo for ghe. That's good progress! |
@flashadvocate could you retry revert octokit/rest for those two.
|
Results running both
|
ok, well nvm I'll go ahead and update the package, is probably for the better anyways. Thanks for the results, I'll let you know when I integrate it on the app. |
No problem, thanks for the work. VueJS and electron seem to be a nice combination :) |
No worries, I actually use gists quite a lot so I thought it was just to contribute to this repo. |
Latest commit:
@flashadvocate tell me something good : ) I am hoping we are close to completion on this PR
|
@kodaman2 congrats. You've got a working implementation there ;) |
@flashadvocate awesome! thanks for the update. @lauthieb I believe this is ready for review, and merge. If you want to double check and make sure I didn't miss any octokit.gists calls but I believe I covered all my basis. : ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BIG THANKS @kodaman2 for your work on this PR :O
Thanks a lot @flashadvocate for your help on testing it.
Just a few changes please. Feel free to challenge my suggestions.
src/renderer/components/modals/settings-modal/SettingsModal.html
Outdated
Show resolved
Hide resolved
@lauthieb code changes requested have been fixed, was able to resolved all. Let me know what you think on the Octokit constructor fix, and I am open to suggestions I haven't been doing javascript for too long but code looks a lot cleaner and maintainable. Good tip on pulling version from @flashadvocate functionality should work the same but please test to make sure, 8bf62f8 |
Ok, hopefully I understood the last change request. |
Seems to be working nicely as of the latest commit to this PR (tested up to fa256e4) |
Cool thanks! it never hurts to check, would hate to merge it and then not work lol. A few more reviews and we should be good for merging. ; ) |
Hi @kodaman2, it's almost done :D @flashadvocate can you test this Pull Request also please? This is my branch : |
Ghe token refactoring
@lauthieb Merged, @flashadvocate you can test on my branch bd8b2da |
@lauthieb how exactly do these changes work? I am just wondering, to be honest javascript constructors are super weird to my python/java eyes lol. Will need to read upon ES6 a bit more.
|
First, you have a destructuring for settings when I get |
Thanks for the explanation. Makes sense, looks pretty lean too! |
Working great as of bd8b2da |
Merged! |
Thanks guys for this work. |
* ghe-token-test * fix-conflicts * input-password * updated-octokit-rest * placeholder-update * fix-request-01 * fix-win-lint * fix-request-02 * refactor: octokit object creation
Any chance for a release? |
Hi @flashadvocate, I will do that on Saturday. |
Here is the new release 1.2.3 of Code Notes : https://github.com/lauthieb/code-notes/releases/tag/1.2.3 🎉 |
* ghe-token-test * fix-conflicts * input-password * updated-octokit-rest * placeholder-update * fix-request-01 * fix-win-lint * fix-request-02 * refactor: octokit object creation
* ghe-token-test * fix-conflicts * input-password * updated-octokit-rest * placeholder-update * fix-request-01 * fix-win-lint * fix-request-02 * refactor: octokit object creation
This is an enhancement as per #75, it adds an input text box for GHE Url that goes to the store settings. If there is a URL in this text box, then octokit uses the custom URL given for authentication.
@flashadvocate please download/clone this commit https://github.com/kodaman2/code-notes/tree/ghe-token:
I am having hard time finding documentation on the correct url for ghe please try the below, I assume it should be secured http requests:
Then add your personal token, and let me know how it goes, and which if any url worked.