Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registre arrets: première automatisation #4428

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ptitfred
Copy link
Contributor

@ptitfred ptitfred commented Jan 29, 2025

Automatise le registre d'arrêt brut fait dans #4393. Voir l'epic #4354.

  • un module 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}.
  • un nouveau job 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.

@ptitfred ptitfred force-pushed the registre-arrets/automation branch 2 times, most recently from 3c37fad to bfffbfc Compare January 29, 2025 11:42
@ptitfred ptitfred marked this pull request as ready for review January 29, 2025 13:44
@ptitfred ptitfred requested a review from a team as a code owner January 29, 2025 13:44
@ptitfred ptitfred force-pushed the registre-arrets/automation branch from bfffbfc to f7d598d Compare January 29, 2025 20:21
- Upload a timestamped file
- Update a stable copy to the latest file
@ptitfred ptitfred force-pushed the registre-arrets/automation branch from f7d598d to b6a2956 Compare January 30, 2025 16:36
@thbar
Copy link
Contributor

thbar commented Feb 3, 2025

Je vais faire un petit test en local pour bien ingérer le fonctionnement, et je reviens reviewer.

@thbar thbar self-requested a review February 3, 2025 14:23
@thbar thbar self-assigned this Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants