Repository navigation
Migrate cloud SBOM collection to asynchronous reports - #66
Conversation
Preserve the documented synchronous GHES API, existing cache and search shape, and repository-level error handling. Bound async generation, polling and download; keep GitHub credentials off download hosts. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ring sanitization' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
SBOM fetching rejects valid URLs with different repository casing and misclassifies cloud repositories such as api/v3 as GHES, selecting the deprecated synchronous endpoint.
2 open issues
What changed in this PR
Migrates cloud SBOM collection to asynchronous reports ahead of the synchronous endpoint’s removal, while retaining synchronous GHES support and the existing cache format.
Changes:
- Adds report generation, bounded polling, and credential-free downloads.
- Integrates the new fetch flow without changing cache and search interfaces.
- Adds regression coverage and documents hosting compatibility.
| File | Description |
|---|---|
src/types.ts |
Updates comments to describe both SBOM sources. |
src/sbomFetch.ts |
Implements asynchronous cloud fetching and synchronous GHES routing. |
src/sbomFetch.test.ts |
Covers fetching, timeouts, redirects, validation, and cache integration. |
src/sbomCollector.ts |
Delegates fetching to the new helper while preserving result metadata. |
README.md |
Documents hosting support, deadlines, and cloud endpoint removal. |
package.json |
Adds SBOM fetch regression tests to the test command. |
Review effort: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
Case-sensitive report URL checks reject valid repositories, an unanchored GHES regex can misroute cloud requests, and non-abortable rate-limit waits can keep the CLI running beyond its deadline.
3 open issues
Review effort: Balanced
| throw timeoutError; | ||
| }; | ||
| try { | ||
| return await Promise.race([run(), deadline]); |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@copilot resolve the merge conflicts in this pull request |
…gration # Conflicts: # package.json Co-authored-by: gubraun <22565171+gubraun@users.noreply.github.com>
Merged |
Use an abortable timer and decline throttling retries after cancellation so SBOM deadlines do not leave long Retry-After timers running. Cover cancellation during and before the wait and unchanged retries without a signal. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Summary
Validation
npm run lintnpm run buildnpm testGHES compatibility is based on the published API documentation and mocked coverage; it was not tested against a live GHES instance.