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

Allow maintainers with write access to an org repo to push changes to a contributor's branch directly #15473

Open
jtpio opened this issue Dec 22, 2022 · 10 comments
Labels
meta: never-stale This issue can never become stale team: webapp Issue belongs to the WebApp team

Comments

@jtpio
Copy link

jtpio commented Dec 22, 2022

Is your feature request related to a problem? Please describe

Many open-source projects have adopted the following workflow for making contributions:

  • a central repository, usually under a GitHub organization
  • contributors fork the central repository
  • they make changes in their fork
  • then they submit a PR to the main repository

Which can also be illustrated as follows:

github-flow

Some of these contributors can be maintainers with write access to the central repo, some are casual contributors without such rights. These maintainers can usually push directly to the branch of the contributor repo, for example to make minor changes to a PR.

github-flow-2

However Gitpod does not seem to be allowing this at the moment.

Describe the behaviour you'd like

Just like the GitHub UI allows maintainer for pushing to the branch of the contributor:

image

It should also be possible to push to the branch of the contributor from a Gitpod instance from the command line with git push origin branch-name.

Here is a video summarizing the desired workflow. Attempting to do this on Gitpod gives a 403:

gitpod-workflow.mp4

Whereas it is possible to do this via the GitHub UI:

demo-commit-github.mp4

Describe alternatives you've considered

I have been using the following workarounds for now:

  1. start Gitpod from a PR, make a small change, then copy the change from the Gitpod instance (for example a formatting / prettier pass). Then use the GitHub UI to edit the contributor's branch directly and paste the change.
  2. same as above, but open a PR targeting the fork of the contributor instead of pushing to the branch directly.
  3. clone the repo locally without using Gitpod. Make a change, commit and push to the contributor's branch directly. GitHub allows this from the CLI over SSH (and HTTPS?).
  4. open a new PR while keeping the commits from the original branch, just to be able to push new changes on top of it

Each of these have drawbacks:

  1. This is tedious, and doesn't scale if the change to apply is large
  2. This adds an additional round-trip and the other contributor first has to merge the PR. Sometimes they might not be notified about the PR on their fork unless they are pinged explicitly.
  3. This is a manual workflow that doesn't use Gitpod, which is long and tedious
  4. This breaks the normal flow of keeping the commits and the existing conversation in one place (previous comments and reviews are not moved to the new PR)

Additional context

This was also briefly discussed on Twitter a couple of months ago: https://twitter.com/jtpio/status/1555533757695856640

Thanks for the help!

@jtpio
Copy link
Author

jtpio commented Jan 10, 2023

Just tried another scenario to double check the behavior, and it seems like there are also permission issues when trying to push to an org repo directly, even with full (admin) access to the repo.

Here a list of steps using https://github.com/jupyterlab/jupyterlab as an example (an organization repo on which I have admin access):

  1. Open Gitpod from https://github.com/jupyterlab/jupyterlab
  2. Wait for VS Code to load
  3. Create a new branch
  4. Make a change, then commit
  5. Try to push the change with git push origin my-branch

Trying to publish the branch on the origin (org repo) directly results in the following "Permission denied" error:

gitpod-org-repo-permission-denied.mp4

However adding a new remote pointing to my fork and pushing to it works fine:

gitpod-org-repo-push-fork.mp4

@stale
Copy link

stale bot commented May 9, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label May 9, 2023
@jtpio
Copy link
Author

jtpio commented May 14, 2023

It would be nice to keep the issue open a bit longer as having support for this workflow would be super helpful to maintainers!

@stale stale bot removed the meta: stale This issue/PR is stale and will be closed soon label May 14, 2023
@axonasif axonasif added the team: webapp Issue belongs to the WebApp team label May 15, 2023
@stale
Copy link

stale bot commented Sep 16, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Sep 16, 2023
@jtpio
Copy link
Author

jtpio commented Oct 4, 2023

Commenting here after the stale bot :)

Still thinking it would be a great feature!

@stale stale bot removed the meta: stale This issue/PR is stale and will be closed soon label Oct 4, 2023
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the meta: stale This issue/PR is stale and will be closed soon label May 22, 2024
@jtpio
Copy link
Author

jtpio commented May 22, 2024

Commenting again here as this would still be useful!

@Siddhant-K-code Siddhant-K-code added meta: never-stale This issue can never become stale and removed meta: stale This issue/PR is stale and will be closed soon labels May 22, 2024
@svenefftinge
Copy link
Member

We are not doing something special here, we just use the git token that we got from your OAuth.
It could be that the JupyterLab org doesn't have granted access for Gitpod OAuth.
Could you check this link and see what it says next to the jupyter org? You might request access, there.

@jtpio
Copy link
Author

jtpio commented May 23, 2024

Oh that would explain why. I just granted access for another org, opened a PR created from the fork of a contributor, made some changes and pushed to the fork successfully.

After pushing the changes to the branch, the following notification showed up. Not sure it's relevant though since the changes were pushed successfully?

image

Thanks @svenefftinge!

@jtpio
Copy link
Author

jtpio commented May 23, 2024

This can likely be closed then. Or this page in the docs could have a small mention of this use case too: https://www.gitpod.io/docs/configure/authentication/github#errors-with-private-repositories-on-github-orgs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta: never-stale This issue can never become stale team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

No branches or pull requests

4 participants