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
merged 10 commits into from Apr 24, 2019

Conversation

Projects
3 participants
@kuychaco
Copy link
Member

commented Apr 18, 2019

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

Requirements

  • 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.

Screenshot/Gif

Summaries:

Reviews__5_—___src_trepo

Review threads:

Reviews__5_—___src_trepo_and_Comparing_master___ku-add-author-association_·_atom_github

Alternate Designs

None were considered.

Benefits

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 -- https://github.blog/2017-07-25-making-it-easier-to-grow-communities-on-github/

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:

Reviews__5_—___src_trepo

Applicable Issues

#2056

Metrics

N/A

Tests

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.

Documentation

N/A

Release Notes

Add author association badges to GitHub review comments.

User Experience Research (Optional)

N/A

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

Reviews__5_—___src_trepo

@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

@codecov

This comment has been minimized.

Copy link

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.

@annthurium
Copy link
Contributor

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 => r.id(0).authorAssociation('MEMBER'))

This comment has been minimized.

Copy link
@annthurium

annthurium Apr 19, 2019

Contributor

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 => r.id(idx).authorAssociation(value));
  idx ++;
});
summaries.build();
comments.build();

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.

Show resolved Hide resolved styles/review.less
Make author association badge in review summary comment wrap to next …
…line

Co-Authored-By: Tilde Ann Thurium <annthurium@github.com>

@kuychaco kuychaco marked this pull request as ready for review Apr 24, 2019

@vanessayuenn
Copy link
Contributor

left a comment

Thanks for tackling this!

@kuychaco kuychaco merged commit 4ef8aac into master Apr 24, 2019

14 checks passed

atom.github Build #20190423.10 succeeded
Details
atom.github (Lint) Lint succeeded
Details
atom.github (Linux beta) Linux beta succeeded
Details
atom.github (Linux dev) Linux dev succeeded
Details
atom.github (Linux stable) Linux stable succeeded
Details
atom.github (MacOS beta) MacOS beta succeeded
Details
atom.github (MacOS dev) MacOS dev succeeded
Details
atom.github (MacOS stable) MacOS stable succeeded
Details
atom.github (Snapshot) Snapshot succeeded
Details
atom.github (Windows beta) Windows beta succeeded
Details
atom.github (Windows dev) Windows dev succeeded
Details
atom.github (Windows stable) Windows stable succeeded
Details
codecov/patch 100% of diff hit (target 92.55%)
Details
codecov/project 92.55% (+<.01%) compared to f98abf3
Details

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 referenced this pull request May 8, 2019

Closed

v0.29.0-0 QA Review #2129

11 of 11 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.