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

Nudge users unable to push a workflow file to re-authenticate #8357

Merged
merged 20 commits into from Oct 4, 2019

Conversation

niik
Copy link
Member

@niik niik commented Sep 27, 2019

Overview

#8340 takes care of requesting the new workflows scope which lets us push workflow files. That PR is contained and safe but isn't as helpful to users as it could be, requiring users to parse the error message from dotcom, find their way to the Desktop issue tracker and figure out that they need to sign out and sign back in again.

Description

This PR detects when a push was rejected due to a missing workflow scope and lets the user choose to grant Desktop the added scope.

2019-09-27 14-42-00 2019-09-27 14_46_12

I see #8340 as the bare minimum we need to provide users with an out and this as the icing on the cake actually providing a decent experience. As such #8340 is high priority for the next release whereas this can be considered a nice-to-have (would you agree with that @billygriffin).

For testing steps see here

Release notes

Notes: [Improved] Request additional permissions when unable to push workflow file.

@niik niik added this to Needs to be Prioritized in PR Priority via automation Sep 27, 2019
@billygriffin
Copy link
Contributor

I love this @niik! I was worried about how we'd inform people, and this feels like the perfect time to do so.

As such #8340 is high priority for the next release whereas this can be considered a nice-to-have (would you agree with that @billygriffin).

That's exactly where I'm at - definitely don't think we need to rush this in, especially since it's more complex and I'd like to give it a bit of time on beta.

@niik niik moved this from Needs to be Prioritized to ⭐️ PR Reviewable Priority ⭐️ in PR Priority Sep 27, 2019
@niik niik moved this from ⭐️ PR Reviewable Priority ⭐️ to PR Draft in PR Priority Sep 27, 2019
@niik niik marked this pull request as ready for review October 3, 2019 07:32
@niik niik added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Oct 3, 2019
@niik niik moved this from PR Draft to ⭐️ PR Reviewable Priority ⭐️ in PR Priority Oct 3, 2019
@kuychaco kuychaco added this to In progress PRs in Desktop 2.2.2 Release via automation Oct 3, 2019
@kuychaco kuychaco moved this from In progress PRs to Awaiting review in Desktop 2.2.2 Release Oct 3, 2019
Copy link
Contributor

@kuychaco kuychaco left a comment

Choose a reason for hiding this comment

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

This looks great @niik! Such a nice UX, our users will definitely be thankful 🦃

Just noticed one blocking change (indicated by a ⚠️), plus some kudos for cleanup ✨, suggestions for minor improvements 💡, and questions for clarification ❓

app/src/ui/dispatcher/error-handlers.ts Outdated Show resolved Hide resolved
app/src/ui/dispatcher/error-handlers.ts Outdated Show resolved Hide resolved
app/src/ui/dispatcher/error-handlers.ts Show resolved Hide resolved
app/src/ui/dispatcher/error-handlers.ts Show resolved Hide resolved
app/src/ui/dispatcher/error-handlers.ts Outdated Show resolved Hide resolved
app/src/ui/dispatcher/dispatcher.ts Show resolved Hide resolved
app/src/lib/stores/accounts-store.ts Outdated Show resolved Hide resolved
app/src/lib/stores/accounts-store.ts Show resolved Hide resolved
app/src/ui/dispatcher/error-handlers.ts Outdated Show resolved Hide resolved
PR Priority automation moved this from ⭐️ PR Reviewable Priority ⭐️ to Review in progress Oct 4, 2019
Desktop 2.2.2 Release automation moved this from Awaiting review to Review in progress Oct 4, 2019
niik and others added 4 commits October 4, 2019 07:41
Co-Authored-By: Katrina Uychaco <katrina@github.com>
Co-Authored-By: Katrina Uychaco <katrina@github.com>
Co-Authored-By: Katrina Uychaco <katrina@github.com>
@tierninho
Copy link
Contributor

I am curious how to get a rejected push due to a missing workflow scope? Please advise on any testing notes. Thanks.

PR Priority automation moved this from Review in progress to Awaiting Merge Oct 4, 2019
Copy link
Contributor

@kuychaco kuychaco left a comment

Choose a reason for hiding this comment

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

Tested locally and this looks ✨✨✨

:shipit:

@tierninho for reference here were the steps I took for testing:

  1. In Dotcom settings revoke access for OAuth token for Desktop-dev
    1. Settings > Applications > Authorized OAuth Apps > The GitHub Desktop Development App > Revoke access
  2. Check out the latest release prior to introducing the workflow scope (git checkout release-2.1.3)
  3. yarn, yarn build:dev, yarn start
  4. Clear local storage (Dev tools > Application > Local Storage/file:// > right-click “Clear”) and refresh window to start from scratch at login page
  5. Ensure other GitHub Desktop instances are closed
  6. Sign in to github.com via browser, authorize Desktop
  7. Check in Dotcom settings to ensure that “Update github action workflows” does NOT appear under “Permissions”
  8. Quit Desktop-dev
  9. Checkout branch for this pr (git checkout if-this-then-that)
  10. yarn, yarn build:dev, yarn start
  11. Open repo with workflow file, edit and commit
  12. Push and see prompt asking to update permissions
  13. Click “Grant” and see successful push
  14. Check in Dotcom settings to ensure that “Update github action workflows” DOES appear under “Permissions”
  15. 🎉

rejectedPath.indexOf('workflow') >= 0
)
) {
if (!pathIsLikelyWorkflowFile) {
Copy link
Contributor

@kuychaco kuychaco Oct 4, 2019

Choose a reason for hiding this comment

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

Beautiful! 😍

@kuychaco kuychaco merged commit c0ed92a into development Oct 4, 2019
PR Priority automation moved this from Awaiting Merge to Done Oct 4, 2019
Desktop 2.2.2 Release automation moved this from Review in progress to PRs for next Beta Oct 4, 2019
@kuychaco kuychaco deleted the if-this-then-that branch October 4, 2019 23:02
@ghost ghost mentioned this pull request Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
No open projects
Desktop 2.2.2 Release
  
PRs for next Beta
Development

Successfully merging this pull request may close these issues.

None yet

4 participants