Upload
avik-das
View
99
Download
1
Embed Size (px)
Citation preview
How to close an issue
Vida Engineering
product-manager commented 5 minutes ago
When a user scrolls to the top of their feed on a given team, the app should automatically load the previous set of messages. This will require the server to support pagination on the MessageResource, and for all the clients to support retrieving the next page of messages when scrolling to the top of a feed.
Users should be able to load older messages #1000
product-manager opened this issue 5 minutes ago • 0 comments
webserver
Open
1. Break out large tickets into small tasks
engineer commented 2 minutes ago
Re #1000
Need to be able to call /api/v3/message/?before=2016-01-28 for example. The response should have a “next” link.
Support pagination in MessageResource #1001
engineer opened this issue 2 minutes ago • 0 comments
webserver
link to another webserver issue
Open
engineer commented 6 minutes ago
Re vidahealth/webserver#1000
The messages API endpoint returns a “next” link. Retrieve the contents of that link when the user scrolls to the top of a feed.
Get “next” page of messages when at top of page #300
engineer opened this issue 6 minutes ago • 0 comments
via_ios
link to an issue in another repo
Open
This was referenced 7 minutes ago
Support pagination in MessageResource #1001Get “next” page of messages when at top of page via_ios#300
Open
Open
This was referenced 7 minutes ago
Support pagination in MessageResource #1001Get “next” page of messages when at top of page via_ios#300
Open
Open
use references to link related tickets together!
This was referenced 7 minutes ago
Support pagination in MessageResource #1001Get “next” page of messages when at top of page via_ios#300
Open
Open
https://help.github.com/articles/autolinked-references-and-urls/#issues-and-pull-requests
use references to link related tickets together!
2. Create a feature branch
$
$ cd via_ios
$ cd via_ios$ git pull
$ cd via_ios$ git pull
Be sure to update your master before branching. You don’t want to build on top of old code.
$ cd via_ios$ git pull$ git checkout -b 300-load-more-messages
$ cd via_ios$ git pull$ git checkout -b 300-load-more-messages
Common practice is to use the ticket number in the branch name.
3. Write some code
+// Is this the right method?!+- (void)didScrollToYPosition:(CGFloat)yPosition+{+ // NOPE! Didn't work!+}
+// Is this the right method?!+//- (void)didScrollToYPosition:(CGFloat)yPosition+//{+// // NOPE! Didn't work!+//}
+// Is this the right method?!+//- (void)didScrollToYPosition:(CGFloat)yPosition+//{+// // NOPE! Didn't work!+//}
- (void)existingMethod {-#warning TODO load older messages+ // new code+// misaligned+// typos - ned fixng // existing code
+// Is this the right method?!+//- (void)didScrollToYPosition:(CGFloat)yPosition+//{+// // NOPE! Didn't work!+//}
- (void)existingMethod {-#warning TODO load older messages+ // new code+// misaligned+// typos - ned fixng // existing code
Remove unneeded code/comments
- (void)existingMethod {-#warning TODO load older messages+ // new code+// misaligned+// typos - ned fixng // existing code
- (void)existingMethod {-#warning TODO load older messages+ // new code+// misaligned+// typos - ned fixng // existing code
Fix any typos. Check alignment. Run any
linters/auto-formatters, and generally check for code
cleanliness.
- (void)existingMethod {-#warning TODO load older messages+ // new code+// misaligned+// typos - ned fixng // existing code
Fix any typos. Check alignment. Run any
linters/auto-formatters, and generally check for code
cleanliness.
The more of this you do ahead of time, the less
time a reviewer has to look out for small issues.
- (void)existingMethod {-#warning TODO load older messages+ // new code+ // misaligned+ // typos - need fixing // existing code
4. Publish your code
$
$ git diff
Check the final diff one last time. A clean commit is a reviewable commit!
$ git diff - (void)existingMethod {-#warning TODO load older messages+ // new code+ // misaligned+ // typos - need fixing // existing code
$ git diff - (void)existingMethod {-#warning TODO load older messages+ // new code+ // misaligned+ // typos - need fixing // existing code
$ git add .
$ git diff - (void)existingMethod {-#warning TODO load older messages+ // new code+ // misaligned+ // typos - need fixing // existing code
$ git add .$ git commit -m "message"
$ git diff - (void)existingMethod {-#warning TODO load older messages+ // new code+ // misaligned+ // typos - need fixing // existing code
$ git add .$ git commit -m "message"
A commit message is an art-
form. Don’t rush it!
$ git diff - (void)existingMethod {-#warning TODO load older messages+ // new code+ // misaligned+ // typos - need fixing // existing code
$ git add .$ git commit -m "message"$ git commit
Fix #300: load more messages at top of feed, calls out to new server endpoint.
Fix #300: load more messages at top of feed, calls out to new server endpoint.
Call out what ticket you’re c
losing. If
there are multiple commits n
eeded to
close the ticket, add this on
the last of
those commits.
Fix #300: load more messages at top of feed, calls out to new server endpoint.
Keep the first line concise. Can’t fit the gist of your change in one line? Maybe your commit is too large!
Fix #300: load more messages at top of feedCalls out to new server endpoint.
Fix #300: load more messages at top of feed
Calls out to new server endpoint. It turned out that there was already an existing method that tracked when the user scrolled to the top of the feed, and I was able to hook into that.
Depends on vidahealth/webserver#1001.
Fix #300: load more messages at top of feed
Calls out to new server endpoint. It turned out that there was alreadyan existing method that tracked when the user scrolled to the top of thefeed, and I was able to hook into that.
Depends on vidahealth/webserver#1001.
Fix #300: load more messages at top of feed
Calls out to new server endpoint. It turned out that there was alreadyan existing method that tracked when the user scrolled to the top of thefeed, and I was able to hook into that.
Depends on vidahealth/webserver#1001.Explain what your change is and why you implemented it the way you did. Leave to the diff to explain how.
http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
http://chris.beams.io/posts/git-commit/
https://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message
$ git diff - (void)existingMethod {-#warning TODO load older messages+ // new code+ // misaligned+ // typos - need fixing // existing code
$ git add .$ git commit -m "message"$ git commit$
$ git diff - (void)existingMethod {-#warning TODO load older messages+ // new code+ // misaligned+ // typos - need fixing // existing code
$ git add .$ git commit -m "message"$ git commit$
This is a good time to rebase your
branch. Did you break up your changes
into easily-digestible chunks?
$ git diff - (void)existingMethod {-#warning TODO load older messages+ // new code+ // misaligned+ // typos - need fixing // existing code
$ git add .$ git commit -m "message"$ git commit$
This is a good time to rebase your
branch. Did you break up your changes
into easily-digestible chunks?
“git rebase -i” is your friend.
$ git diff - (void)existingMethod {-#warning TODO load older messages+ // new code+ // misaligned+ // typos - need fixing // existing code
$ git add .$ git commit -m "message"$ git commit$ git push -u origin 300-load-more-messages
$ git diff - (void)existingMethod {-#warning TODO load older messages+ // new code+ // misaligned+ // typos - need fixing // existing code
$ git add .$ git commit -m "message"$ git commit$ git push -u origin 300-load-more-messages
If you use “-u” the first time, you won’t have to specify the remote and branch name next time.
5. Create a pull request
300-load-more-messages (less than a minute ago)
Your recently pushed branches:
engineer commented 6 minutes ago
Load more messages at top of feed #301
Open engineer wants to merge 1 commit into master from 300-load-more-messages
engineer commented 6 minutes ago
Fixes #300.
Load more messages at top of feed #301
Open engineer wants to merge 1 commit into master from 300-load-more-messages
Your PR might have multiple
commits, so it’s good to call out
the issue being fixed at the
beginning of your description.
engineer commented 6 minutes ago
Fixes #300. Requires running against the server code in vidahealth/webserver#1002.
I tested this by creating a few pages worth of messages for my test user, then scrolling to the top of the feed again and again.
Load more messages at top of feed #301
Open engineer wants to merge 1 commit into master from 300-load-more-messages
Provide context for your reviewer, as well as demonstrate you did the legwork of verifying your own change.
engineer commented 6 minutes ago
Fixes #300. Requires running against the server code in vidahealth/webserver#1002.
I tested this by creating a few pages worth of messages for my test user, then scrolling to the top of the feed again and again.
@other-dev: Can you take a look?
Load more messages at top of feed #301
Open engineer wants to merge 1 commit into master from 300-load-more-messages
other-dev was assigned by engineer 5 minutes ago
engineer commented 6 minutes ago
Fixes #300. Requires running against the server code in vidahealth/webserver#1002.
I tested this by creating a few pages worth of messages for my test user, then scrolling to the top of the feed again and again.
@other-dev: Can you take a look?
Load more messages at top of feed #301
Open engineer wants to merge 1 commit into master from 300-load-more-messages
other-dev was assigned by engineer 5 minutes ago
Identify a partner to work with
you on this PR.
Use @mentions and assignment
to make it clear who it is.
continuous-integration/travis-ci/pr — The Travis CI build could not complete... Details
continuous-integration/travis-ci/pr — The Travis CI build could not complete... Details
Click here, figure out the problem and fix it. If it’s not obvious or straightforward to fix, leave a comment saying so.
continuous-integration/travis-ci/pr — The Travis CI build passed Details
If all the discussion can move to a PR, close the ticket so the discussion isn’t split into two.
engineer commented 6 minutes ago
Closing in favor of #301.
Get “next” page of messages when at top of page #300
engineer opened this issue 2 days ago • 4 commentsClosed
6. Address feedback
other-dev added a note 20 minutes ago
@engineer: Shouldn’t we guard against an infinite re-request loop if the load more request fails?
other-dev commented on the diff 20 minutes ago
+ // top of screen, load older messages
+ [VASynchronizer loadMessagesWithCompletion:nil];
Via/VAFeedViewController.m View full changes
523
524
other-dev added a note 20 minutes ago
@engineer: Shouldn’t we guard against an infinite re-request loop if the load more request fails?
engineer added a note 10 minutes ago
There’s no need. This method is only called once, when the scrolling is complete, so a failed request won’t re-trigger it.
other-dev commented on the diff 20 minutes ago
+ // top of screen, load older messages
+ [VASynchronizer loadMessagesWithCompletion:nil];
Via/VAFeedViewController.m View full changes
523
524
other-dev added a note 20 minutes ago
@engineer: Shouldn’t we guard against an infinite re-request loop if the load more request fails?
engineer added a note 10 minutes ago
There’s no need. This method is only called once, when the scrolling is complete, so a failed request won’t re-trigger it.
other-dev commented on the diff 20 minutes ago
+ // top of screen, load older messages
+ [VASynchronizer loadMessagesWithCompletion:nil];
Via/VAFeedViewController.m View full changes
523
524
If the reviewer took the time to comment on your code, take the time to acknowledge it, even if you aren’t changing anything.
It’s your code.
It’s your code.Defend it.
other-dev added a note 18 minutes ago
@engineer: I’m a little confused on this. Is it always going to be a load more call? What about the initial call to get messages?
other-dev commented on the diff 18 minutes ago
+- (void)loadMessagesWithCompletion:(void (^)())cb
+ BOOL isLoadMore = YES;
Via/VAFeedViewController.m View full changes
147
148
other-dev added a note 18 minutes ago
@engineer: I’m a little confused on this. Is it always going to be a load more call? What about the initial call to get messages?
engineer added a note 9 minutes ago
Great point! That one is a separate method, so let me rename this to loadMoreMessagesWithCompletion:.
other-dev commented on the diff 18 minutes ago
+- (void)loadMessagesWithCompletion:(void (^)())cb
+ BOOL isLoadMore = YES;
Via/VAFeedViewController.m View full changes
147
148
It’s your code.Defend it.
It’s your code.Defend it.
Take feedback graciously.
$ git diff-- (void)loadMessagesWithCompletion:(void (^)())cb
+- (void)loadMoreMessagesWithCompletion:(void (^)())cb
$ git diff-- (void)loadMessagesWithCompletion:(void (^)())cb
+- (void)loadMoreMessagesWithCompletion:(void (^)())cb
Add new commits. Don’t rebase onto publicly-
accessible commits.
$ git diff-- (void)loadMessagesWithCompletion:(void (^)())cb
+- (void)loadMoreMessagesWithCompletion:(void (^)())cb
$ git add .
$ git commit
$ git push
$ git diff-- (void)loadMessagesWithCompletion:(void (^)())cb
+- (void)loadMoreMessagesWithCompletion:(void (^)())cb
$ git add .
$ git commit
$ git push
You used “-u” the first time you pushed, didn’t you?
engineer added some commits 3 minutes ago
Fix travis build
Address review comments
engineer added some commits 3 minutes ago
Fix travis build
Address review comments
engineer added some commits 3 minutes ago
Rename load more messages method
Update feed scrolling test for load more
Use descriptive commit messages
that make sense in isolation,
since they appear in “git log”
without the context of the PR.
engineer commented 4 minutes ago
@other-dev: Thanks for the feedback. I updated the PR, can you take another look please?
It’s your code.Defend it.
Take feedback graciously.
It’s your code.Defend it.
Take feedback graciously.Engage in the review process.
7. Merge it to master
other-dev commented 12 minutes ago
@engineer: LGTM. it!
engineer deleted the 300-load-more-messages branch 5 minutes ago
This was referenced 3 days ago
Support pagination in MessageResource #1001Get “next” page of messages when at top of page via_ios#300
Closed
Closed
Get “next” page of messages when at top of page android#702 Closed
Users should be able to load older messages #1000
product-manager opened this issue 4 days ago • 4 commentsClosed
engineer commented 4 minutes ago
All parts (server + both clients) are finished. This feature is complete.
Go ahead and clean up any other related issues that weren’t linked from the PR. Example: once both the Android and iOS portions are finished, close the master webserver ticket.
Users should be able to load older messages #1000
product-manager opened this issue 4 days ago • 4 commentsClosed
engineer commented 4 minutes ago
All parts (server + both clients) are finished. This feature is complete.