GH, FB data flow design

This commit is contained in:
Radek Stepan 2014-09-08 20:07:08 -07:00
parent 113f8891db
commit a4553a3450
2 changed files with 32 additions and 2 deletions

View File

@ -142,3 +142,32 @@ Only use repo name when we are adding the user to the repo, from there on use th
GET /repositories/:id GET /repositories/:id
When fetching the issues, we can constrain on a `milestone` and `state`. When fetching the issues, we can constrain on a `milestone` and `state`.
**Vulnerability**: if we share repos between users, one of them can write whatever change she wants and *spoil* the chart for others. Until we fix this, let us have a 1 repo to 1 user mapping.
##Design
###Adding a new user
- [ ] we get a `user` object from GH
- [ ] get a list of repos from FB by asking for our `user` root
- [ ] *a*: user is not there so let us create this root object
- [ ] *b*: user is there so we get back a list of repos
###Adding a new repo
- [ ] make a request to GH fetching a repo by `user/repo`
- [ ] *a*: GH gives us 404 - show a message to the user
- [ ] *b1*: we get back a repo object, so a write into our `user` root as a `set()` operation (overriding any existing entry if it exists)
- [ ] *b2*: in client register our repo to receive updates from FB and since it is new - it triggers a fetch from GH immediately
###Updating a repo
- [ ] listen for our `user`, `repo` changes from FB which actually will render new data
- [ ] our local repo object has an `age` information, if it reaches a threshold, trigger a fetch from GH
- [ ] *a*: GH gives us 404 - show a message to the user saying last `state` on the repo, e.g. last success 5 minutes ago, keep showing the *old* data if any
- [ ] *b*: GH gives us data, make an `update()` on FB saying `state` is `null` (OK) updating the `age` to time now
###Deleting a repo
- [ ] remove our `repo` under the `user`, no questions asked. All subscribers are switched off and views disposed of

View File

@ -61,6 +61,7 @@ charcoal, charriot
- [ ] points collector - give medals for 1st 3 spots in terms of velocity - [ ] points collector - give medals for 1st 3 spots in terms of velocity
- [ ] show past commits or due dates like in [this calendar](https://dribbble.com/shots/1736128-Meetups-Page?list=shots&sort=popular&timeframe=now&offset=5) - [ ] show past commits or due dates like in [this calendar](https://dribbble.com/shots/1736128-Meetups-Page?list=shots&sort=popular&timeframe=now&offset=5)
- [ ] allow people to submit suggestions via GitHub Issues - [ ] allow people to submit suggestions via GitHub Issues
- [ ] find a way where, as a group, we can share repo data by trusting the other repo members that use our platform
## Notes ## Notes