Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

UserStore handles GitHub remotes that no longer exist #1869

Merged
merged 2 commits into from
Jan 2, 2019

Conversation

smashwilson
Copy link
Contributor

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

Break from the user accumulation loop in UserStore when the GraphQL response includes a null Repository.

Alternate Designs

When you have no GitHub remotes at all, we currently fall back to your local git history to populate the UserStore. Given that we now have the possibility that your GitHub remote could no longer exist, it may make sense to fall back to that in the instance that no valid GitHub remotes are found any more. I opted not to go that route in this take to keep the change small and minimize risk.

Benefits

A stacktrace on package activation no longer occurs.

Possible Drawbacks

If you delete all GitHub repositories referenced by your git remotes - or add a bunch of fake ones - your UserStore will stay empty.

Applicable Issues

Fixes #1867.

Metrics

N/A

Tests

I've added a unit test to capture the null-Repository case to verify the fix.

Documentation

N/A

Release Notes

  • The GitHub package no longer logs an exception when a remote has been deleted on github.com.

User Experience Research (Optional)

N/A

@codecov
Copy link

codecov bot commented Jan 2, 2019

Codecov Report

Merging #1869 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1869   +/-   ##
=======================================
  Coverage   91.14%   91.14%           
=======================================
  Files         196      196           
  Lines       10745    10745           
  Branches     1575     1575           
=======================================
  Hits         9794     9794           
  Misses        951      951
Impacted Files Coverage Δ
lib/models/user-store.js 99.19% <100%> (+0.8%) ⬆️
lib/models/operation-states.js 89.58% <0%> (-2.09%) ⬇️

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 94b8d95...fe93f9b. Read the comment docs.

@smashwilson smashwilson requested a review from a team January 2, 2019 18:38
Copy link

@annthurium annthurium left a comment

Choose a reason for hiding this comment

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

Thanks @smashwilson for fixing this!

@smashwilson smashwilson merged commit f2299d9 into master Jan 2, 2019
@smashwilson smashwilson deleted the aw/null-repository branch January 2, 2019 19:18
This was referenced Jan 2, 2019
smashwilson added a commit that referenced this pull request Jan 4, 2019
UserStore handles GitHub remotes that no longer exist
@smashwilson smashwilson mentioned this pull request Jan 4, 2019
5 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot read property 'mentionableUsers' of null
2 participants