Skip to content

GitHub API error: The search is longer than 256 characters. #103

@h-yon

Description

@h-yon

Thank you for this great gem.

I am running git-pr-release --squashed in CI on GitHub Actions to create prod release PR.
When the number of PRs contained became large, I encountered an error.
The following is the runner's output (query is masked, keeping string length).

▼ Run git-pr-release --squashed
git-pr-release --squashed
shell: /usr/bin/bash -e {0}
env:
GIT_PR_RELEASE_TEMPLATE: ../../_temp/tmp.xxx
GIT_PR_RELEASE_TOKEN: ***
GIT_PR_RELEASE_BRANCH_PRODUCTION: release
GIT_PR_RELEASE_BRANCH_STAGING: main
TZ: Asia/Tokyo
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
To use multipart middleware with Faraday v2.0+, install `faraday-multipart` gem; note: this is used by the ManageGHES client for uploading licenses
/opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/octokit-9.1.0/lib/octokit/response/raise_error.rb:14:in `on_complete': GET https://api.github.com/search/issues?q=repo%3Amyorgxx%2Fmyrepositoryx+is%3Apr+is%3Aclosed+0000000+0000000+0000000+0000000+0000000+0000000+0000000+0000000+0000000+0000000+0000000+0000000+0000000+0000000+0000000+0000000+0000000+0000000+0000000+0000000+0000000+0000000+0000000+0000000+0000000+0000000: 422 - Validation Failed (Octokit::UnprocessableEntity)
Error summary:
message: The search is longer than 256 characters.
resource: Search
field: q
code: invalid // See: https://docs.github.com/v3/search/
from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/faraday-2.10.1/lib/faraday/middleware.rb:57:in `block in call'
from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/faraday-2.10.1/lib/faraday/response.rb:42:in `on_complete'
from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/faraday-2.10.1/lib/faraday/middleware.rb:56:in `call'
from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/octokit-9.1.0/lib/octokit/middleware/follow_redirects.rb:73:in `perform_with_redirection'
from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/octokit-9.1.0/lib/octokit/middleware/follow_redirects.rb:61:in `call'
from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/faraday-2.10.1/lib/faraday/rack_builder.rb:152:in `build_response'
from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/faraday-2.10.1/lib/faraday/connection.rb:444:in `run_request'
from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/faraday-2.10.1/lib/faraday/connection.rb:200:in `get'
from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/sawyer-0.9.2/lib/sawyer/agent.rb:99:in `call'
from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/octokit-9.1.0/lib/octokit/connection.rb:156:in `request'
from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/octokit-9.1.0/lib/octokit/connection.rb:84:in `paginate'
from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/octokit-9.1.0/lib/octokit/client/search.rb:99:in `search'
from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/octokit-9.1.0/lib/octokit/client/search.rb:49:in `search_issues'
from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/git-pr-release-2.2.0/lib/git/pr/release/cli.rb:145:in `search_issue_numbers'
from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/git-pr-release-2.2.0/lib/git/pr/release/cli.rb:179:in `fetch_squash_merged_pr_numbers_from_github'
from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/git-pr-release-2.2.0/lib/git/pr/release/cli.rb:101:in `fetch_merged_prs'
from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/git-pr-release-2.2.0/lib/git/pr/release/cli.rb:46:in `start'
from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/git-pr-release-2.2.0/lib/git/pr/release/cli.rb:12:in `start'
from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/git-pr-release-2.2.0/exe/git-pr-release:5:in `<top (required)>'
from /opt/hostedtoolcache/Ruby/3.3.4/x64/bin/git-pr-release:25:in `load'
from /opt/hostedtoolcache/Ruby/3.3.4/x64/bin/git-pr-release:25:in `<main>'
Error: Process completed with exit code 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions