fix(server-nestjs): purge Harbor repositories before deleting project - #2605
Draft
shikanime wants to merge 1 commit into
Draft
fix(server-nestjs): purge Harbor repositories before deleting project#2605shikanime wants to merge 1 commit into
shikanime wants to merge 1 commit into
Conversation
shikanime
commented
Aug 31, 2026
shikanime
left a comment
Member
Author
There was a problem hiding this comment.
Verdict : Approuvé (en commentaire : PR propriétaire, approbation GitHub impossible via l API) — PR propre, correcte, couvre le cas de production.
- registry-client.service.ts:58-69 — [✨ Éloge]
listRepositories/deleteRepositoryexposent exactement ce que le portage legacy avait omis ; paginationpage_size+pagecohérente avecROBOT_LIST_PAGE_SIZE. - registry.service.ts:305-323 — [✨ Éloge]
deleteRepositoriespurge toutes les pages avantdeleteProjectByName, ce qui règle le412 Precondition Failedde Harbor (#2516, constaté en prod le 19/08). La condition d arrêt (data.length < ROBOT_LIST_PAGE_SIZE) est correcte. - registry.service.spec.ts / registry-client.service.spec.ts — [✨ Éloge] Tests de purge (2 dépôts) et de rejet
412(KO) couvrent les deux branches critiques.
Aucun point bloquant. Fusionnable telle quelle (hors rebase éventuelle sur main déjà à jour).
RegistryService.deleteProject removed the Harbor project directly, without purging its repositories first. Harbor refuses to delete a non-empty project and answers 412 Precondition Failed, so the project.delete hook failed for every console project that had received at least one image (observed in production on 2026-08-19, project demoargoref). The legacy Fastify plugin purged repositories (paginated on x-total-count) before deleteProject. This restores that behavior: RegistryClientService now exposes listRepositories / deleteRepository, and deleteProject purges all repositories across pages before issuing the project deletion. Refs #2516 Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Change-Id: If4f5a5d87ae3ce3899e79f66c24b41556a6a6964
shikanime
force-pushed
the
fix/harbor-delete-purge-repos
branch
from
August 31, 2026 11:44
c2a6a80 to
aa129e3
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

0 New Issues
0 Fixed Issues
0 Accepted Issues
Issues liées
Issues numéro: #2516
Quel est le comportement actuel ?
Lors de l'archivage d'un projet,
RegistryService.deleteProjectsupprime le projet Harbor directement, sans purger au préalable ses dépôts. Harbor refuse de supprimer un projet non vide et répond412 Precondition Failed, ce qui fait échouer le hookproject.deletepour tout projet ayant déjà reçu au moins une image (constaté en production le 19/08/2026 sur le projetdemoargoref).Le client
RegistryClientServicen'exposait nilistRepositoriesnideleteRepository, si bien que la purge n'avait pas été reprise lors du portage depuis le plugin legacy.Quel est le nouveau comportement ?
RegistryClientServiceexpose désormaislistRepositoriesetdeleteRepository.deleteProjectpurge l'ensemble des dépôts projet (paginés, comme le faisait le plugin legacy) avant de supprimer le projet Harbor. Le hookproject.deletepeut ainsi aboutir même pour un projet contenant des images.Cette PR introduit-elle un breaking change ?
Non.
Autres informations
Tests ajoutés :
listRepositoriesetdeleteRepository;412Harbor.Refs #2516