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

composer recipes:update fails with curl error #974

Open
lazka opened this issue May 3, 2023 · 3 comments
Open

composer recipes:update fails with curl error #974

lazka opened this issue May 3, 2023 · 3 comments

Comments

@lazka
Copy link

lazka commented May 3, 2023

Using symfony/flex v1.19.5, when using the "recipes:update" command I get the following for every package:

$composer recipes:update
Which outdated recipe would you like to update? (default: 0)
  [0] symfony/apache-pack
  [1] symfony/flex
  [2] symfony/lock
  [3] symfony/messenger
  [4] symfony/phpunit-bridge
 > 1
  Updating recipe for symfony/flex...

                        
   Yes! Recipe updated! 
                        

  Run git status or git diff --cached to see the changes.
  When you're ready, commit these changes like normal.

  Calculating CHANGELOG...
In CurlDownloader.php line 623:
                                                                                                                       
  The "https://api.github.com/search/issues?q=fcda4f8f67e48ff06163debe049416c698e4f2ae" file could not be downloaded   
  (HTTP/2 422 ):                                                                                                       
  {"message":"Query must include 'is:issue' or 'is:pull-request'","documentation_url":"https://docs.github.com/rest/r  
  eference/search#search-issues-and-pull-requests"}
@weaverryan
Copy link
Member

Hi!

I'm guessing this was some weird, temporary issue. It shows the URL, and that loads just fine for me right now.

Cheers!

@leonboot
Copy link

I experienced the same issue when updating a flex recipe. I think it might have something to do with the new fine grained access tokens (github_pat_ prefixed). I had one in my ~/.composer/auth.json file and replaced it with a classic token (ghp_ prefixed). That seemed to solve the issue. Might be a false positive, or perhaps the new fine grained tokens require a specific permission in order for them to work when using with Flex?

@micheh
Copy link

micheh commented Nov 19, 2023

According to the documentation, it is required to either add is:issue or is:pull-request to the ?q= parameter when using the new fine grained access token. This seems to be a new restriction of the access token and not related to the permissions itself, as even a fine grained access token with all permissions requires the query parameter to be set.

fabpot added a commit that referenced this issue Dec 5, 2023
…t parameter (alainsharemat)

This PR was submitted for the 2.x branch but it was squashed and merged into the 1.x branch instead.

Discussion
----------

fix(recipes:update): github api now requires is:pull-request parameter

This fix is related to issue #974.

While running `recipes:update`  I got this error:

```shell
Calculating CHANGELOG...
In CurlDownloader.php line 630:

  The "https://api.github.com/search/issues?q=95e75e5e424c5f5f611cc57073e399baaf287570" file could not be downloaded (HTTP/2 422 ):
  {"message":"Query must include 'is:issue' or 'is:pull-request'","documentation_url":"https://docs.github.com/rest/search/search#search-issues-and-pull-requests"}
```

According to github's [documentation](https://docs.github.com/en/rest/search/search?apiVersion=2022-11-28#search-issues-and-pull-requests) : `Requests that don't include the is:issue or is:pull-request qualifier will receive an HTTP 422 Unprocessable Entity response`.

Commits
-------

bc89553 fix(recipes:update): github api now requires is:pull-request parameter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants