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

feat: Finish implementing project creation on backend (#21) #38

Merged
merged 6 commits into from
Jan 6, 2020

Conversation

ermshiperete
Copy link
Collaborator

@ermshiperete ermshiperete commented Dec 2, 2019

This change finishes the implementation of creating a project on the backend (#21).

This change also implements extracting the keyboard id from the keyboard_info file (part of #10).


This change is Reviewable

@darcywong00 darcywong00 added this to the P8S5 milestone Dec 4, 2019
@ermshiperete ermshiperete added the enhancement New feature or request label Dec 4, 2019
@ermshiperete ermshiperete self-assigned this Dec 4, 2019
Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see some "why" or "reason for existence" comments on some of the functions because there's a lot of code and a bit of context can really help understanding :)

It might be good to factor out all the URL strings embedded into a single location.

README.md Outdated
@@ -32,6 +32,15 @@ In the `*.env` file replace the values for `CLIENT_ID` and `CLIENT_SECRET` with
_Client Secret_ that GitHub displays for the app. You should also replace the value for
`SESSION_SECRET` with a random value.

If you want to run all e2e tests, you'll have to create a test user on GitHub. Fork
[kdotester1/khmer_angkor](https://github.com/kdotester1/khmer_angkor) to your test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should create a repo on @keymanapp with a good 'testing' name such as "test_kdo_khmer_angkor" and use that rather than relying on another repo that may run into maintenance and access issues in the future?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Can you fork kdotester1/test_kdo_khmer_angkor and keymanapptest/test_kdo_keyboards into @keymanapp?

let githubService: GithubService;

async function deleteKeyboardsRepo(): Promise<void> {
await httpService.delete(`https://api.github.com/repos/${user}/keyboards`, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a dangerous test. Do we need to reinforce that this test must not be run with the developer's real GH account?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the keyboards repo renamed test_kdo_keyboards this should be save now.

- rename repos used in e2e tests
- add some comments
- some cleanup of unused code
@ermshiperete
Copy link
Collaborator Author

I'd like to see some "why" or "reason for existence" comments on some of the functions because there's a lot of code and a bit of context can really help understanding :)

Can you point out the methods where this would be good?

@mcdurdin
Copy link
Member

mcdurdin commented Dec 7, 2019

Can you point out the methods where this would be good?

For example, waitForRepoToExist. I can see what the code is doing but some context would be helpful. I like to see a one line description of the function because when someone else comes into the code, the 'why' is the hardest part. The code you've written is generally clear and easy to understand so there's no issue with the implementation (although I have to ask if it is right that waitForRepoToExist function really could ping GitHub 300 times in 5 minutes? That could cause trouble with rate limiting? Perhaps back-off might be advisable...)

@mcdurdin
Copy link
Member

mcdurdin commented Dec 7, 2019

Okay, I've done the review but currently having trouble getting the test environment to run on my machine. Not sure if I am missing something in the setup (noting also that README.md between the root and frontend folders are perhaps slightly inconsistent)

@mcdurdin
Copy link
Member

mcdurdin commented Dec 8, 2019

Okay, got the dev environment running. It seems to be mostly working, so far.

Testing notes

Workflow issue if forking repo late

  1. I forked the repo after loading the KDO home page. This led to an issue where KDO did not show my keyboard. Instead, I was shown a spinner with a link "I don't see my keyboard project".

image

  1. I then forked the repo:

image

  1. and clicked the link. This led to a blank screen (just the top banner visible):

image

  1. The second time I tried to repro this, I got the following:

image

This may correspond to a warning in the log:

(node:17644) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 disconnect listeners added to [MemoryStore]. Use emitter.setMaxListeners() to increase limit
(node:17644) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 connect listeners added to [MemoryStore]. Use emitter.setMaxListeners() to increase limit
  1. So refreshing the page didn't help; I had to logout and login again, to see the repo:

image

  1. Once we get here, I click on the link and am presented with a blank screen but then I think that's as far as it goes in this PR, right?

UX

It may be a little early to be worrying about this but the grid layout with small boxes for repo names (see above) are a little awkward. May be better to use a list layout for this.

@ermshiperete
Copy link
Collaborator Author

Once we get here, I click on the link and am presented with a blank screen but then I think that's as far as it goes in this PR, right?

yes, this PR only changes things in the backend, so everything you experienced is expected (with the exception of the "Too many requests" (#41)).

It may be a little early to be worrying about this but the grid layout with small boxes for repo names (see above) are a little awkward. May be better to use a list layout for this.

I created #40 for that.

@mcdurdin mcdurdin modified the milestones: P8S5, P8S6 Dec 14, 2019
@mcdurdin mcdurdin modified the milestones: P8S6, P8S7 Jan 1, 2020
@ermshiperete ermshiperete merged commit 5388e29 into keymanapp:master Jan 6, 2020
@ermshiperete ermshiperete deleted the gitrepo branch January 6, 2020 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants