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

Add author association to review summaries and thread comments #2085

merged 10 commits into from Apr 24, 2019


Copy link

@kuychaco kuychaco commented Apr 18, 2019

Please be sure to read the contributor's guide to the GitHub package before submitting any pull requests.


  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • Suggestion: You can use checklists to keep track of progress for the sections on metrics, tests, documentation, and user research.

Description of the Change

Our trusty Community and Safety team pointed out that displaying "first time contributor" badges encourages people to be kind to new folks, etc.

This PR introduces authorAssociation information provided by the GitHub GraphQL API to indicate the author's relationship to the repository (member, owner, collaborator, contributor, first-time contributor, first-timer, none). See API docs for more information.

Badges for author association are displayed on review summary comments as well as review thread comments.

See #2056 for reference.




Review threads:


Alternate Designs

None were considered.


Folks have more context about the author of the comments and can therefore adjust their responses accordingly. For example, responses to comments made by "First-time contributors" warrant extra thought and attention, to ensure that we are welcoming new contributors and effectively growing our communities --

Possible Drawbacks

There is limited space in comment headers. An additional badge adds some visual noise, and if the panel width isn't large enough, the badge appears on a separate line:


Applicable Issues





Added unit tests to ensure that text shows up correctly for each author association value (member, owner, collaborator, contributor, first-time contributor, first-timer, none). Did this for both review summary comments and thread comments.



Release Notes

Add author association badges to GitHub review comments.

User Experience Research (Optional)


TODO: make summary badges drop to new line (as is the case for thread comments)


@kuychaco kuychaco self-assigned this Apr 18, 2019
@kuychaco kuychaco added this to In progress in Sprint : 4 April 2019 - 8 May 2019 : v0.29.0 via automation Apr 18, 2019
Copy link

@codecov codecov bot commented Apr 18, 2019

Codecov Report

Merging #2085 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2085      +/-   ##
+ Coverage   92.55%   92.55%   +<.01%     
  Files         207      207              
  Lines       12016    12021       +5     
  Branches     1745     1746       +1     
+ Hits        11121    11126       +5     
  Misses        895      895
Impacted Files Coverage Δ
...ainers/accumulators/review-comments-accumulator.js 100% <ø> (ø) ⬆️
...iners/accumulators/review-summaries-accumulator.js 100% <ø> (ø) ⬆️
lib/views/reviews-view.js 83.23% <100%> (+0.51%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f98abf3...4a8615e. Read the comment docs.

Copy link

@annthurium annthurium left a comment

looks good!! Thanks for taking this on.

@@ -113,6 +113,59 @@ describe('ReviewsView', function() {
assert.lengthOf(wrapper.find('details.github-Review'), 2);

it('displays an author association badge for review summaries', function() {
const {summaries, commentThreads} = aggregatedReviewsBuilder()
.addReviewSummary(r =>'MEMBER'))
Copy link

@annthurium annthurium Apr 19, 2019

Thanks for being thorough and testing all the associations!

I really want you to not have to type all these things out manually. I wish it was possible to do something like...

const {summaries, commentThreads} = aggregatedReviewsBuilder();
let idx = 0;
Object.entries(authorAssociationText).forEach(([key, value]) => {
  addReviewSummary(r =>;
  idx ++;

I don't think we can actually use the builders that way though.

I mean, you could create a new review and summary for each association and then test those. Since you already put in the effort to manually type all these out, not sure it's worth the time to optimize.

styles/review.less Show resolved Hide resolved

Co-Authored-By: Tilde Ann Thurium <>
@kuychaco kuychaco marked this pull request as ready for review Apr 24, 2019
Copy link

@vanessayuenn vanessayuenn left a comment

Thanks for tackling this!

@kuychaco kuychaco merged commit 4ef8aac into master Apr 24, 2019
14 checks passed
Sprint : 4 April 2019 - 8 May 2019 : v0.29.0 automation moved this from In progress to Merged Apr 24, 2019
@kuychaco kuychaco deleted the ku-add-author-association branch Apr 24, 2019
@smashwilson smashwilson mentioned this pull request May 8, 2019
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
No open projects
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants