Registre arrets: première automatisation #4428
Open
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.
Automatise le registre d'arrêt brut fait dans #4393. Voir l'epic #4354.
Transport.S3.AggregatesUploader
responsable de l'upload sur S3 d'un fichier, l'upload de son sha256 dans un fichier voisin, et la mise à jour d'un fichier "latest" avec cette dernière version. A cette occasion un bucket dédié est alloué :transport-data-gouv-fr-aggregates-{prod|staging|dev|test}
.Transport.Jobs.StopsRegistrySnapshot
qui chaine l'extraction de registre d'arrêt et l'upload S3. Ce job est quotidien à 4h du matin UTC.Notes de design
L'uploader
Transport.S3.AggregatesUploader
est fait pour être réutilisé, notamment par l'extracteur IRVE. Pour l'instant il ne supporte l'upload que d'un fichier, mais on peut le généraliser à une énumération.L'algorithme de hash est hardcodé à sha256 pour l'instant. On pourrait aisément le rendre configurable et/ou optionnel si nécessaire.
Le job du registre d'arrêt est tellement simple qu'écrire un test pour celui-ci serait à mon avis artificiellement compliqué (nécessiterait notamment de fournir des stubs sur le registre d'arrêt et le helper d'upload). Ca semble assez artificiel.