Skip to content

fix(ci): bound PR issue reference fetching - #435

Merged
JSONbored merged 3 commits into
mainfrom
codex/propose-fix-for-unbounded-pr-issue-references
Jun 6, 2026
Merged

fix(ci): bound PR issue reference fetching#435
JSONbored merged 3 commits into
mainfrom
codex/propose-fix-for-unbounded-pr-issue-references

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • Prevent unbounded, attacker-controlled processing of closing references in PR bodies that can exhaust the workflow's GitHub API quota and runtime.
  • Avoid failing the workflow when a PR body contains invalid issue references (e.g., 404s).
  • Avoid performing any authenticated issue lookups for pull requests that are not unlabeled feature PR candidates.

Description

  • Add MAX_CLOSING_ISSUE_REFERENCES and cap parsing in extractClosingIssueNumbers to stop extracting more than a safe number of references.
  • Add a maxReferences option to fetchReferencedIssues and pass the capped list into the per-issue authenticated fetch loop.
  • Treat 404 results when fetching referenced issues as ignorable (skip that reference) and preserve throwing on other unexpected response codes.
  • Add shouldFetchReferencedIssues to early-skip referenced-issue fetching unless the pull_request_target payload looks like an unlabeled feature PR candidate.
  • Update the declaration file scripts/github-type-label.d.mts and add regression unit tests in test/unit/github-type-label.test.ts covering capped fetches, 404 handling, and non-feature PR early skipping.

Testing

  • Ran the unit tests with npx vitest run test/unit/github-type-label.test.ts and all tests passed (27 tests, all green).
  • Ran TypeScript type checking with npm run typecheck (tsc --noEmit) and it succeeded.
  • Added targeted unit tests for capped extraction, 404-ignore behavior, and the early-skip path which passed under the test runner.

Codex Task

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 6, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui 61b8add Commit Preview URL

Branch Preview URL
Jun 06 2026, 09:57 AM

@github-actions github-actions Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jun 6, 2026
@ghost

ghost commented Jun 6, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #435 is no longer open. No action.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

@ghost ghost added the gittensory:reviewed label Jun 6, 2026
@JSONbored JSONbored self-assigned this Jun 6, 2026
@JSONbored
JSONbored merged commit 9ae9657 into main Jun 6, 2026
10 checks passed
@JSONbored
JSONbored deleted the codex/propose-fix-for-unbounded-pr-issue-references branch June 6, 2026 09:58
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant