Remove a mirrored repository (tullictl + web UI, admin-only) #24
Labels
No labels
Compat/Breaking
demo
hardening
identity
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
needs-verification
notify
ops
packaging
perf
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
process
rbac
research
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
scanning
stage-6e
stage-6f
stage-6g
Status
Abandoned
Status
Blocked
Status
Need More Info
transport
web
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
qwc-open/tulli#24
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Motivation
There is currently no way to remove a mirrored repository — not via
tullictl, not via the web API/UI. Deleting one on a testing (or real) instance means manual surgery in two places:rm -rf /data/mirrors/<host>/<path>.gitreposrow in Postgres (cascades to refs/scans/findings/verdicts/overrides/manual_blocks/components/vuln_matches/triage/notifications; access_events null out):DELETE FROM repos WHERE upstream_url = '…';This is error-prone and, done half-way, is unsafe:
reposrow, butEnsurePresentfinds the existing bare repo →created=false→ no re-scan enqueued. A previously-quarantined repo then serves as CLEAN/unscanned. (This is the important footgun — removal must be atomic across DB + disk.)created=true); fine as a "force re-mirror", but stale findings/verdicts linger.Removal needs to be a single first-class operation that handles both stores in the right order.
Ask
A proper "remove repository" action, exposed in both surfaces:
tullictl repo rm <host>/<path>(or by id)reposrow (cascade handles children) and removes the on-disk mirror dir.--yes/ confirmation prompt; clear output of what was removed.Web UI / API — admin-only
DELETE /api/repos/{id}(admin role via existingguard(minRole, …)).deleted/tombstone state or a dedicated reconcile action rather than a raw FS delete from the web handler.Design notes / open questions
first_seen, fresh scan) — that's the desired behavior; just make it explicit/tested.inflightmap inmirror.go).internal/mirror— it already owns the on-disk mirror lifecycle; add a "prune/remove" path alongside the hideRefs reconcile.tullictlisn't in the shipped Docker image yet, so the CLI half can't be exercised via compose until that's fixed.Relationship to other issues
internal/mirrorlifecycle; removal is the destructive sibling of refresh.Labels:
Kind/Enhancement,web,rbac.