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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
Member

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

wadethestealth commented Nov 7, 2019

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

@smashwilson

This comment has been minimized.

Copy link
Member Author

smashwilson commented Nov 7, 2019

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 added 21 commits Nov 2, 2019
@smashwilson smashwilson force-pushed the aw/github-blank-slates branch from 20d96ec to 0781b23 Nov 8, 2019
@wadethestealth

This comment has been minimized.

Copy link
Contributor

wadethestealth commented Nov 8, 2019

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

smashwilson added 2 commits Nov 8, 2019
@smashwilson

This comment has been minimized.

Copy link
Member Author

smashwilson commented Nov 8, 2019

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 Nov 8, 2019
@smashwilson smashwilson merged commit bacd74e into master Nov 8, 2019
8 checks passed
8 checks passed
atom.github Build #20191108.8 succeeded
Details
atom.github (Lint) Lint succeeded
Details
atom.github (Linux) Linux succeeded
Details
atom.github (MacOS) MacOS succeeded
Details
atom.github (Snapshot) Snapshot succeeded
Details
atom.github (Windows) Windows succeeded
Details
codecov/patch 100% of diff hit (target 93.26%)
Details
codecov/project 93.28% (+0.01%) compared to 2d0b976
Details
@smashwilson smashwilson deleted the aw/github-blank-slates branch Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can鈥檛 perform that action at this time.