/protected-repo

reproducing protected repo errer message

protected-repo

A repo to:

  • reproduce the error that occurs from someone trying to push to a branch to which they dont have acces
  • document the steps required to ☝️
  • list the problems we should fix over in desktop/desktop
  • serve as draft issue

draft issue

We should provide a friendlier experience when collaborating with others on a single repository

2018-04-19_23-42-51 994

the reason why this failed is in the error message, but it's not presented in a user friendly way. In the case of ☝️, the publish button should have been disabled. We can get these permissions from the repositories endpoint, so it should be possible to prevent this state from occuring.

tl;dr

  1. desktop should preempt this
  2. it's possible to push to a protected branch
  3. scary error messages

Interestingly, this repo requires signed commits and I did not sign the commits made by my evil-handle, yet that was not the reason why the push failed. Shouldn't unsigned commits take precedence?

Reproduction steps

assume steps not listed explicitly are things not to do (where it makes sense 🤷‍♂️)

main handle - performed on dotcom

  • create a repo
  • protect master
    • require pr reviews
    • require signed commits
  • add a @iamnotwillshepherd as collaborator

evil handle - performed in desktop

  • re-sign in as @iamnotwillshepherd
    • update git information from iAmWillShepherd and iamwillshepherd@github.com ➡️: iAmNotWillShepherd and iAmNotWillShepherd@github.com (remember to change back)

noticed that git information didn't automatically update as I was documenting ☝️ (is this a bug?)

  • clone the repo
  • make some commits to master
  • push

Separate maintainers problem

this is a related issue

maintainers should be able to push to their contributors' prs since we can get this info from the maintainer_can_modify property returned from the pull requests endpoint. If we store this data, desktop could allow this.