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

Validateur NeTEx avec enRoute's Chouette #4140

Merged
merged 6 commits into from
Sep 2, 2024
Merged

Conversation

ptitfred
Copy link
Contributor

Cette PR inclut le validateur mais ne l'intègre pas au validateur "On Demand" ni à la validation récurrente.

Ce code est amené à être amendé à la marge au long des tests et des retours d'enRoute. Il est notamment question d'affiner l'interprétation des codes de messages (pour l'instant assez naïve).

@ptitfred ptitfred marked this pull request as ready for review August 28, 2024 13:41
@ptitfred ptitfred requested a review from a team as a code owner August 28, 2024 13:41
@AntoineAugusti AntoineAugusti self-assigned this Aug 29, 2024
@AntoineAugusti
Copy link
Member

Je vais te review ça dans la journée

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.

Bon boulot Frédéric, bravo 👏

Je te fais des premiers retours pour te poser quelques questions et suggérer des améliorations.

apps/transport/lib/validators/netex_validator.ex Outdated Show resolved Hide resolved
apps/transport/lib/validators/netex_validator.ex Outdated Show resolved Hide resolved
apps/transport/lib/validators/netex_validator.ex Outdated Show resolved Hide resolved
@doc """
Returns the maximum severity, with the issues count

iex> validation_result = %{"uic-operating-period" => [%{"criticity" => "error"}], "valid-day-bits" => [%{"criticity" => "error"}], "frame-arret-resources" => [%{"criticity" => "error"}]}
Copy link
Member

Choose a reason for hiding this comment

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

Ajouter un cas warning ici ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok.

apps/transport/lib/validators/netex_validator.ex Outdated Show resolved Hide resolved
resource_history = DB.ResourceHistory.latest_resource_history(resource_id)
with_resource_file(resource_history, &validate_resource_history(resource_history, &1))
end

Copy link
Member

Choose a reason for hiding this comment

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

Pour les 2 validate_, envisager de stocker des informations pour analyser la performance du validateur : temps d'exécution, nombre de retries etc ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dans les metadata ?

import TransportWeb.Gettext, only: [dgettext: 2]

@moduledoc """
Validator for NeTEx files calling enRoute Chouette Valid API.
Copy link
Member

Choose a reason for hiding this comment

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

Documenter que ce validateur effectue la phase de polling d'une API distante et que les appels à validate_ vont prendre plusieurs minutes ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Je peux.

Pour ma gouverne, n'est-ce pas commun à tous les validateurs d'être bloquants et potentiellement longs ?

Copy link
Member

Choose a reason for hiding this comment

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

Si, tout à fait. La différence est que les autres validateurs ont des temps de traitement bien plus rapides, de l'ordre de 1-5s la plupart du temps.

Avoir un temps classique de plusieurs minutes a donc un impact si on veut proposer ça à la demande ou dans une chaine de validations.

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 effet pour enchainer les validations ça peut surprendre. (Pour le on demand le pulling est implémenté via un job oban.)

@ptitfred
Copy link
Contributor Author

Bon boulot Frédéric, bravo 👏

Je te fais des premiers retours pour te poser quelques questions et suggérer des améliorations.

Merci pour la review.

Je pense avoir couvert tous tes commentaires.

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.

Merci pour les améliorations effectuées !

C'est une très bonne première version que tu pourras améliorer au fur et à mesure de l'intégration d'autres fonctionnalités comme tu l'as indiqué.

👏🚢

@ptitfred ptitfred added this pull request to the merge queue Sep 2, 2024
Merged via the queue into master with commit 0527ecc Sep 2, 2024
4 checks passed
@ptitfred ptitfred deleted the netex-validator/validator branch September 2, 2024 07:57
@ptitfred
Copy link
Contributor Author

ptitfred commented Sep 2, 2024

Voir #4153.

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