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

Blank states for GitHub tab #2329

Merged
merged 26 commits into from
Nov 8, 2019
Merged

Blank states for GitHub tab #2329

merged 26 commits into from
Nov 8, 2019

Conversation

smashwilson
Copy link
Contributor

@smashwilson smashwilson commented Nov 6, 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

Implement the "blank" states of the GitHub tab when:

  • No repositories are open.
  • The current project is not initialized as a git repository.
  • The current repository has no remotes on GitHub.

I'm doing this by keying off of the active Repository's state in GitHubTabView, and launching the dialogs introduced in #2222.

Remaining work:

  • "Initialize and publish" fails with the message "Unable to determine the desired default branch from the repository".
  • "Publish on GitHub" does not push your default branch - it leaves the newly created repository empty.
  • Metrics
  • Test coverage

Screenshots

Situation GitHub panel state
No project roots no projects
Uninitialized uninitialized
No remotes on GitHub no remotes

Alternate Designs

See the feature request.

Benefits

Users will no longer be presented with a blank, featureless tab if they open the GitHub tab without any repositories open (😬). The existing error view -- when the current repository has no remotes -- is improved with an action you can take, to publish it.

Possible Drawbacks

We still don't handle Enterprise, which means that you could have a remote pointing to an Enterprise instance and we'll still tell you we don't have any GitHub remotes. Accurate, but frustrating.

Applicable Issues

Feature request: #2111.

Metrics

  • create-github-repository event when a repository is created simultaneously locally and on GitHub.
  • publish-github-repository event when an existing local repository is pushed to a newly created GitHub repository.
  • init-publish-github-repository event when a non-git project folder is initialized and published to a newly created GitHub repository at the same time.
  • clone-repository event when a repository is cloned with the clone dialog.

Tests

Standard unit test coverage.

Documentation

Flight manual documentation of the new path to the Clone dialog: atom/flight-manual.atom.io#573

Release Notes

  • Opening the GitHub tab without an active repository with a GitHub remote offers you the ability to publish or create a new repository.

User Experience Research (Optional)

N/A

@codecov
Copy link

codecov bot commented Nov 6, 2019

Codecov Report

Merging #2329 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2329      +/-   ##
==========================================
+ Coverage   93.26%   93.28%   +0.01%     
==========================================
  Files         230      231       +1     
  Lines       12949    12979      +30     
  Branches     1849     1851       +2     
==========================================
+ Hits        12077    12107      +30     
  Misses        872      872
Impacted Files Coverage Δ
lib/items/github-tab-item.js 96% <ø> (ø) ⬆️
lib/controllers/remote-controller.js 100% <ø> (ø) ⬆️
lib/controllers/issueish-searches-controller.js 80.95% <ø> (ø) ⬆️
lib/containers/comment-decorations-container.js 100% <ø> (ø) ⬆️
lib/controllers/root-controller.js 83.78% <ø> (ø) ⬆️
lib/github-package.js 69.26% <100%> (+0.12%) ⬆️
lib/controllers/github-tab-controller.js 100% <100%> (ø) ⬆️
lib/models/refresher.js 100% <100%> (ø)
lib/views/create-dialog.js 100% <100%> (ø) ⬆️
lib/prop-types.js 100% <100%> (ø) ⬆️
... and 7 more

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 2d0b976...86a8dd2. Read the comment docs.

@wadethestealth
Copy link
Contributor

How did you go about drilling props? Is there a tool I can use on my PRs?

@smashwilson
Copy link
Contributor Author

Nah. Sadly, it's all manual.

The fix there is to migrate to using hooks, which allow us to gracefully consume multiple contexts in the same component. But that effort is waiting for either (i) Enzyme to support hooks in its shallow renderer, or (ii) a gradual rework of the test suite to use mount() instead. See #1437 for some discussion and links to draft implementations of alternatives that we've explored in the past.

@smashwilson smashwilson force-pushed the aw/github-blank-slates branch from 20d96ec to 0781b23 Compare November 8, 2019 15:47
@wadethestealth
Copy link
Contributor

Why is it your PR has codecov? Is this a draft only feature?

@smashwilson
Copy link
Contributor Author

Why is it your PR has codecov? Is this a draft only feature?

It's because of the way we're using Azure DevOps and its CodeCov reporter. For some reason, we only get coverage data and the coverage change comment when we have both "push" builds and "pull request" builds. When you make pull requests from a fork, only the "pull request" build runs.

If I can work it out, I can try to tackle that as part of #2298.

@smashwilson smashwilson marked this pull request as ready for review November 8, 2019 19:15
@smashwilson smashwilson merged commit bacd74e into master Nov 8, 2019
@smashwilson smashwilson deleted the aw/github-blank-slates branch November 8, 2019 19:15
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.

2 participants