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

Structuration import GTFS en batch job + dashboard de reporting #2920

Merged
merged 23 commits into from
Jan 16, 2023

Conversation

thbar
Copy link
Contributor

@thbar thbar commented Jan 13, 2023

Dans cette PR, j'ajoute un job GTFSImportStopsJob qui va rafraichir (via Transport.GTFSImportStops.import_stops_and_remove_previous) tous les GTFS importés en base (gtfs_stops) et importer ceux qui ne le sont pas déjà.

Le résultat est tracé dans une nouvelle table data_import_batch sous forme de map simplifiée.

Le job peut être lancé depuis le back office avec un bouton.

Le résultat est affiché au même endroit (la vue prend le DB.DataImportBatch le plus récent).

Le résultat de consolidation est affiché de façon triée, pour grouper un peu les erreurs par "type d'erreur" et faciliter le travail de traitement de ces erreurs dans les prochaines PR.

CleanShot 2023-01-14 at 17 07 20@2x

@thbar thbar marked this pull request as ready for review January 13, 2023 10:36
@thbar thbar requested a review from a team as a code owner January 13, 2023 10:36
@thbar thbar marked this pull request as draft January 13, 2023 10:36
@thbar thbar marked this pull request as ready for review January 14, 2023 16:10
try do
data_import_id = Transport.GTFSImportStops.import_stops_and_remove_previous(rh.id)
%{resource_history_id: rh.id, status: :ok, data_import_id: data_import_id}
rescue
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

En cas d'erreur, je constitue une map précise pour afficher des choses dans le backoffice et faire en sorte d'itérer sur les imports.

Copy link
Member

@AntoineAugusti AntoineAugusti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me parait très bien pour suivre l'état d'avancement d'un import. Quelques petits comms

@thbar
Copy link
Contributor Author

thbar commented Jan 16, 2023

@AntoineAugusti j'ai pris en compte des comm, merci!

@thbar thbar enabled auto-merge (squash) January 16, 2023 10:50
@AntoineAugusti AntoineAugusti self-requested a review January 16, 2023 11:03
Copy link
Member

@AntoineAugusti AntoineAugusti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Très cool, hâte de voir ça dans le backoffice/en base

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