* @param {object} opts * @param {string} opts.repo - "owner/name" * @param {string} [opts.cacheDir] - defaults to ".cache/pr-sheriff/github" * @param {number} [opts.cacheTtlSeconds] - defaults to 300 seconds * @param {(args: string[], runnerOpts?: any) => Promise<{exitCode:number, stdout
({
repo,
cacheDir = path.join('.cache', 'pr-sheriff', 'github'),
cacheTtlSeconds = 300,
ghRunner = defaultGhRunner,
sleepFn = (ms) => new Promise((r) => setTimeout(r, ms)),
maxBackoffSeconds = 10,
})
| 84 | * @param {number} [opts.maxBackoffSeconds] - max sleep for rate-limit backoff |
| 85 | */ |
| 86 | constructor({ |
| 87 | repo, |
| 88 | cacheDir = path.join('.cache', 'pr-sheriff', 'github'), |
| 89 | cacheTtlSeconds = 300, |
| 90 | ghRunner = defaultGhRunner, |
| 91 | sleepFn = (ms) => new Promise((r) => setTimeout(r, ms)), |
| 92 | maxBackoffSeconds = 10, |
| 93 | }) { |
| 94 | const { owner, name } = parseOwnerRepo(repo); |
| 95 | this.repo = repo; |
| 96 | this.owner = owner; |
| 97 | this.name = name; |
| 98 | |
| 99 | this.cacheDir = cacheDir; |
| 100 | this.cacheTtlSeconds = cacheTtlSeconds; |
| 101 | this.ghRunner = ghRunner; |
| 102 | this.sleepFn = sleepFn; |
| 103 | this.maxBackoffSeconds = maxBackoffSeconds; |
| 104 | } |
| 105 | |
| 106 | /** |
| 107 | * Fetch pull request details. |
nothing calls this directly
no test coverage detected