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

Refactor repoIndex collection into a DB model #61

Merged
merged 9 commits into from
Jul 12, 2017
Merged

Conversation

haishanh
Copy link
Contributor

@haishanh haishanh commented Jun 15, 2017

still WIP - DO NOT MERGE

Let me know if you want to collaborate, cause I may squash and force push commits.


[EDITED]

Ready to merge.

In this PR:

  • A new model RepoFileEntry is created to save individual file entry
  • Prop tipCommitSha is added to model RepoIndex to track the tip commit of the branch
  • A new endpoint /api/repository/updated-collections is added, which will only response modified/removed entries
  • Frontend will poll the above API every 8 secs
  • Minor code style change(I like semicolon in JS!), I may pretty print all JS files in the future.

@@ -39,6 +40,13 @@ export default class Header extends Component {

componentDidMount() {
this.loadBasicRepoData()
setInterval(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's better to put this setInterval after fetchLatestIndex() is done, as fetchLatestIndex() would also involving getting the latest index.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@woodpig07 Nice point! will do.

@@ -1,7 +1,16 @@
import GithubAPI from 'github-api'
import _ from 'lodash'
import Bluebird from 'bluebird'
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you started using Bluebird, maybe it's better to replace all the native Promise with Bluebird in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's my next step. Will leave it as it is now in this PR.

@haishanh haishanh merged commit d4ba433 into dev-client Jul 12, 2017
@haishanh haishanh deleted the index-fix branch July 12, 2017 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants