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

UserStore handles GitHub remotes that no longer exist #1869

Merged
merged 2 commits into from Jan 2, 2019

Conversation

2 participants
@smashwilson
Copy link
Member

smashwilson commented Jan 2, 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

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

smashwilson added some commits Jan 2, 2019

@codecov

This comment has been minimized.

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 atom/github-package Jan 2, 2019

@annthurium
Copy link
Contributor

annthurium left a comment

Thanks @smashwilson for fixing this!

@smashwilson smashwilson merged commit f2299d9 into master Jan 2, 2019

2 checks passed

codecov/patch 100% of diff hit (target 91.14%)
Details
codecov/project 91.14% (+0%) compared to 94b8d95
Details

@smashwilson smashwilson deleted the aw/null-repository branch Jan 2, 2019

@smashwilson smashwilson referenced this pull request Jan 2, 2019

Closed

v0.24.0-1 QA Review #1870

13 of 13 tasks complete

@smashwilson smashwilson moved this from In Progress 🔧 to Merged ☑️ in Stability Sprint : 20 November 2018 - 8 January 2019 : v0.24.0 Jan 3, 2019

@smashwilson smashwilson referenced this pull request Jan 3, 2019

Closed

v0.23-2 QA Review #1879

16 of 16 tasks complete

smashwilson added a commit that referenced this pull request Jan 4, 2019

Merge pull request #1869 from atom/aw/null-repository
UserStore handles GitHub remotes that no longer exist

@smashwilson smashwilson referenced this pull request Jan 4, 2019

Closed

v0.23.2-0 QA Review #1883

5 of 5 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment