Giter Club home page Giter Club logo

Comments (8)

tibdex avatar tibdex commented on May 25, 2024 10

Hi, indeed I never tested the app on forks.

I will probably have to make some developments on the upstream libraries github-cherry-pick and github-rebase to make it work. Not sure yet if it will be a quick fix or not but I'm determined to support the fork use case.

from autorebase.

asbjornu avatar asbjornu commented on May 25, 2024

I have the same expectations as @gep13. It would be awesome if autorebase could meet those expectations. 😄

from autorebase.

gep13 avatar gep13 commented on May 25, 2024

@tibdex woo hoo! Let us know if you need any beta testers. Happy to help out!

from autorebase.

tibdex avatar tibdex commented on May 25, 2024

So, I investigated a bit and I have bad news. When making the necessary changes to support fork-PRs where the HEAD branch is from another repo (one that forked the original one), the Autorebase GitHub App doesn't have permission to force-push on this HEAD branch. Even if the author of the PR checked the "Allow edits from maintainers" box. The error is:

{ HttpError: Resource not accessible by integration
    at response.text.then.message (/home/tibdex/autorebase/node_modules/@octokit/rest/node_modules/@octokit/request/lib/request.js:56:27)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  name: 'HttpError',
  status: 403,
  headers: { /* [REDACTED] */ },
  request:
   { method: 'PATCH',
     url:
      'https://api.github.com/repos/tibdest/github-apps-test/git/refs/heads/master',
     headers:
      { accept: 'application/vnd.github.v3+json',
        'user-agent': 'octokit.js/16.22.0 Node.js/10.13.0 (macOS Mojave; x64)',
        authorization: 'token [REDACTED]',
        'content-type': 'application/json; charset=utf-8' },
     body:
      '{"force":true,"sha":"51a378a1a094378768036501627f5268caddc796"}',
     request: { validate: [Object] } },
  documentation_url:
   'https://developer.github.com/v3/git/refs/#update-a-reference' }

The rejected request is this one.

Even if the owner of the fork were to install Autorebase on its repo, the GitHub App installation ID would be different so I'm quite sure it wouldn't help.

So I guess supporting fork-PRs cannot be done with the current design.
If you have any ideas to support it, I would be happy to hear them ;)

from autorebase.

gep13 avatar gep13 commented on May 25, 2024

@tibdex thank you for taking the time to investigate this!

To help me understand the infrastructure a little bit...

What is the difference between me as a user force pushing to the branch on the fork, which is allowed, and the autorebase app?

from autorebase.

tibdex avatar tibdex commented on May 25, 2024

What is the difference between me as a user force pushing to the branch on the fork, which is allowed, and the autorebase app?

I don't know precisely how GitHub handles permissions for the "Allow edits from maintainers" option but I guess it only works for real users (actual accounts) and not GitHub applications.

from autorebase.

gep13 avatar gep13 commented on May 25, 2024

@tibdex said..
I don't know precisely how GitHub handles permissions for the "Allow edits from maintainers" option but I guess it only works for real users (actual accounts) and not GitHub applications.

Yeah, that could well be it.

from autorebase.

thedrow avatar thedrow commented on May 25, 2024

If I provide you with an OAuth token to use I think that you will have permission to act on my behalf and rebase from a fork if "Allow edits from maintainers" is checked.
That requires creating an OAuth app instead of a Github app.

So when we register you'll need to get a token from the user using the web flow authentication and you'll be able to use that token to impersonate the user.

from autorebase.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.