#4416 Fork created by API does not support PR
Closed: Fixed 2 years ago by pingou. Opened 2 years ago by zlopez.

When using API to create fork and then creating PR I'm getting Pull-Request have been deactivated for this project. However there is no issue, if you create PR manually from the fork.

Here is the whole request and response from vcr:

- request:
    body: title=Update+to+0.0.24&branch_to=master&branch_from=master&initial_comment=This+pull+request+was+automatically+generated+by+the-new-hotness+for+0ad+to+update+it+to+version+0.0.24
    headers:
      Accept:
      - '*/*'
      Accept-Encoding:
      - gzip, deflate
      Authorization:
      - token LD7DLW5U3CIF8MHAD51QPNT934XM44WMKNTT2UMH6JXV34259WOV9BEEV4V2PWGY
      Connection:
      - keep-alive
      Content-Length:
      - '178'
      Content-Type:
      - application/x-www-form-urlencoded
      Cookie:
      - disgit_pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmIjp7IiBiIjoiWlRnek56a3pNbVEwWW1JellUZzBZV1UxTkRCaU56QmxNRE5oTWpRMU5USmpaV0ZrWldaa1pRPT0ifX0.D4zdDQ.ViJ3TrXc6P0NwlrZH4eUHz2JuNQ
      User-Agent:
      - python-requests/2.21.0
    method: POST
    uri: https://src.stg.fedoraproject.org//api/0/fork/zlopez/rpms/0ad/pull-request/new
  response:
    body:
      string: "{\n  \"error\": \"Pull-Request have been deactivated for this project\"\
        ,\n  \"error_code\": \"EPULLREQUESTSDISABLED\"\n}"
    headers:
      AppServer:
      - proxy01.stg.phx2.fedoraproject.org
      AppTime:
      - D=139929
      Connection:
      - Keep-Alive
      Content-Length:
      - '109'
      Content-Type:
      - application/json
      Date:
      - Mon, 08 Apr 2019 13:24:29 GMT
      Keep-Alive:
      - timeout=15, max=498
      Referrer-Policy:
      - same-origin
      Server:
      - Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.2k-fips mod_auth_gssapi/1.5.1
        mod_wsgi/3.4 Python/2.7.5
      Set-Cookie:
      - disgit_pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmIjp7IiBiIjoiWlRnek56a3pNbVEwWW1JellUZzBZV1UxTkRCaU56QmxNRE5oTWpRMU5USmpaV0ZrWldaa1pRPT0ifX0.D4zdDQ.ViJ3TrXc6P0NwlrZH4eUHz2JuNQ;
        Expires=Thu, 09-May-2019 13:24:29 GMT; Secure; HttpOnly; Path=/
      Strict-Transport-Security:
      - max-age=31536000; includeSubDomains; preload
      X-Content-Type-Options:
      - nosniff
      X-Frame-Options:
      - SAMEORIGIN
      X-Xss-Protection:
      - 1; mode=block
    status:
      code: 404
      message: NOT FOUND
version: 1

Just ran into the same problem now.

Note that this is expected, forks do not support PR by default and I do not think this will change.

What we should change though, is allowing open a PR on the target repo from the fork repo. Basically the current APi does not allow to specify the repo_from (iirc) and that's an issue.

Metadata Update from @pingou:
- Issue tagged with: RFE

2 years ago

There was something responsible for finding the parent repo.
I think it was maybe here (?):

https://pagure.io/pagure/blob/master/f/pagure/api/fork.py#_1366

Am I on correct path?

The error pops just in the next paragraph.
I'm trying to fix it. Maybe zlopez will be faster :)

When can we expect this one to be fixed and deployed to prod?

I'm actually surprised this is marked as RFE, since this used to work with early versions and no longer works with 5.5 -- for me, that's a regression.

There is a PR #4424 which would make it work for now.

Metadata Update from @pingou:
- Issue assigned to lenkaseg
- Issue close_status updated to: Fixed
- Issue set to the milestone: 5.6
- Issue status updated to: Closed (was: Open)

2 years ago

@pingou Do you have an ETA when it will be uploaded as a patch in src.fedoraproject.org? I see milestone 5.6, but was not able to find out time plan.

@pingou Do you have an ETA when it will be uploaded as a patch in src.fedoraproject.org? I see milestone 5.6, but was not able to find out time plan.

5.6 was due on May 7th but some of the PR pending should be included in 5.6 so
it was postponed a little.
As for its deployment on dist-git, it will happen later than the release. It's a
process that needs to be synced with CentOS and thus several agenda need to be
considered.

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #4424 Closed 2 years ago