Skip to content

Repository page view: restore no-token repo existence validation #42

@vultuk

Description

@vultuk

Repository page view: restore no-token repo existence validation

Summary

Restore fail-closed repository existence validation when the web app does not have a GitHub token so Discofork stops queueing obvious typos and nonexistent repos.

Problem

ensureGitHubRepositoryExists() currently returns early when GH_TOKEN and GITHUB_TOKEN are both absent. In that mode, bogus owner/repo paths can still be queued and inserted into repo_reports, only to fail later in the worker. Users see a queued page for repositories that do not exist, and Discofork wastes queue capacity on work that should have been rejected immediately.

Desired outcome

Discofork should still verify that a public repository exists before queueing it, even when the web tier is running without a GitHub API token.

Requirements

  • Restore a tokenless repository existence check before queueing uncached repositories.
  • Keep using the existing positive and negative existence cache so repeated requests do not re-probe unnecessarily.
  • Do not enqueue or touch queued state for repositories confirmed missing.
  • Preserve the current authenticated GitHub API path when a token is configured.

Evals

  • Requesting a real public repo without a GitHub token still returns a queueable or cached view successfully.
  • Requesting a nonexistent repo without a GitHub token throws RepositoryNotFoundError and does not enqueue or touch queued state.
  • Repeating the same nonexistent repo request reuses the cached negative existence result instead of fetching again.
  • Deployments with a configured GitHub token keep the current behavior unchanged.

Notes

  • This is a regression from the earlier no-token existence validation work; keep the fix scoped to restoring that behavior in the current read/get page-view split.
  • Prefer a lightweight public probe rather than introducing a new dependency or broad refactor.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions