Skip to content

Add GitHub repository deletion service function #124

Closed

Description

@neuromechanist

Problem

backend/src/services/github.ts has no function for deleting a repository. This is required for dataset deletion (#120, #35).

Current State

GitHub service has: createRepository, addCollaborator, updateRepoVisibility, setTagProtection, deployWorkflows, etc.

Missing: deleteRepository.

Proposal

Add to github.ts:

export async function deleteRepository(repoName: string, pat: string): Promise<void> {
  const response = await fetch(
    `https://api.github.com/repos/nemarDatasets/${repoName}`,
    {
      method: "DELETE",
      headers: {
        Authorization: `Bearer ${pat}`,
        Accept: "application/vnd.github+json",
      },
    }
  );
  if (!response.ok && response.status !== 404) {
    throw new Error(...);
  }
}

The admin PAT needs delete_repo scope. 404 should be treated as success (repo already deleted).

Blocked By

This is a dependency for #120 (dataset deletion cascade).

Acceptance Criteria

  • Deletes the repository from nemarDatasets org
  • 404 treated as success (idempotent)
  • Requires admin PAT with delete_repo scope

Related

Activity

  1. added
    enhancement
    on Feb 12, 2026
  2. added 3 commits that reference this issue on Feb 12, 2026
    af29eff
    ce4e41a
    ce46a6f
  3. neuromechanist commented on Feb 12, 2026

    @neuromechanist
    ContributorAuthor

    Completed in PR #130 (merged to epic branch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions