openwrt / openwrt/openwrt-bot-worker

Split githubApiCall into a transport layer and named operations

Open
#103 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
0
Forks
2
Avg merge
1d 19h
Merged PRs (30d)
3

Description

githubApiCall is both the HTTP transport (retry, accept headers, JSON parsing, logging, silencing) and the thing every caller uses directly, so business code is full of if (res.code !== 200) and has to know REST details.

Suggested shape:

  • transport: githubFetch(url, init) — retry/backoff, budget accounting (now in place, see #98), rate-limit handling, logging, JSON parsing
  • operations: getPull, listComments, createCheckRun, ensureLabel, getFile — returning parsed results or throwing, with no HTTP status handling at the call site

Related gap in the same area: the retry policy currently retries every 5xx and network error but ignores Retry-After, X-RateLimit-Reset and secondary rate limits, while the stale bot has its own separate 403/429 handling. Those two policies should become one.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating githubApiCall and the stale bot's separate 403/429 handling, then map the callers and existing retry, budget, rate-limit, logging, and parsing behavior. Done means transport and named operations are separated and the retry policies are unified, with tests covering the resulting behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend, networking
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.