Skip to content

Harden ingest PR filtering and ref path resolution#276

Merged
stephenkilbourn merged 2 commits into
mainfrom
feat/retrieve-ingest-pr-filtering
May 15, 2026
Merged

Harden ingest PR filtering and ref path resolution#276
stephenkilbourn merged 2 commits into
mainfrom
feat/retrieve-ingest-pr-filtering

Conversation

@stephenkilbourn

@stephenkilbourn stephenkilbourn commented May 15, 2026

Copy link
Copy Markdown
Contributor

Description

This PR hardens the Edit Ingest flow to prevent non-Github app PRs from being treated as editable ingests, and fixes ref normalization when resolving ingest JSON files.

Context

I saw a retrieve-ingest failure when a manual PR with non-standard refs (for example, collection/GEDI) was included in Edit Collection results. The UI then attempted to resolve a file path from that ref and GitHub Contents returned Not Found.

What Changed

  • Added PR source/convention filtering in ListPRs.ts]
  • Include PRs authored by bot accounts such as the veda-github-actor
  • Otherwise include only PRs that match app conventions:
    • Title starts with collection Ingest Request for or dataset Ingest Request for
    • Head ref starts with feat/
  • Added safer ref normalization in RetrieveJSON.ts
  • Normalizes refs like:
    • refs/heads/collection/GEDI
    • collection/GEDI
    • feat/GEDI
  • Updated tests to reflect and validate the new behavior:
    • ListPRs.test.ts
    • RetrieveJSON.test.ts
    • ListPRsFallback.test.ts

Behavior Change

Before:
Manual/non-conforming PRs could appear in Edit Ingest lists if they touched target paths.
Some refs produced incorrect file paths and caused retrieve-ingest failures.
After:
Only app-authored or convention-conforming PRs are eligible in list-ingests.
retrieve-ingest resolves ref-to-filename more defensively and consistently.

@stephenkilbourn stephenkilbourn merged commit 4d06c87 into main May 15, 2026
1 check passed
@stephenkilbourn stephenkilbourn deleted the feat/retrieve-ingest-pr-filtering branch May 15, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant