Maakaf/friends-activity-backend

Fix Deprecated Octokit API and 422 Error in GitHub Search

オープン

#57 opened on 2025/10/31

 (2 件のコメント) (0 件のリアクション) (1 人の担当者)TypeScript (17 件のフォーク)auto 404
buggood first issuehacktoberfest

Repository metrics

Stars
 (9 個のスター)
PR merge metrics
 (PR metrics pending)

説明

The application is using a deprecated Octokit method and receiving 422 errors when searching for GitHub issues and pull requests.

Issues Observed

1. Deprecated API Method

Current: Using octokit.rest.search.issuesAndPullRequests() Action Required: Migrate to the updated API method as per GitHub REST API documentation

2. HTTP 422 Errors

Multiple 422 (Unprocessable Entity) responses Possible causes: Invalid query parameter: advanced_search=true (not a valid GitHub API parameter) Malformed date format in the search query Invalid search qualifier combination

Tasks

  • Replace deprecated octokit.rest.search.issuesAndPullRequests() with the current method
  • Remove or fix the invalid advanced_search=true parameter
  • Verify the date format in the created:>= qualifier matches GitHub's expected format (ISO 8601)
  • Add error handling for 422 responses
  • Test the updated search query with valid parameters
  • Add logging to capture the specific validation errors from GitHub's API response

Suggested Fix

The search endpoint should use octokit.request() or the updated REST method without deprecated parameters:

Additional Notes

The error occurs consistently with a ~220-250ms response time Consider implementing retry logic with exponential backoff for failed requests Review GitHub's search API rate limits and secondary rate limits

コントリビューターガイド