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

fix(dora): fix dora service thematics rejected by the quality check #314

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

YannickPassa
Copy link

Suite à des modifications du coté de DORA la sous thématique --autre n'est plus remplacée par un null.
Il est donc nécessaire de le faire de notre côté.

@vperron je n'ai pas ajouté les tests car ça presse je le mettrai avec mon autre PR qui corrige les autres erreurs de service

@YannickPassa YannickPassa self-assigned this Oct 9, 2024
@vperron
Copy link
Contributor

vperron commented Oct 9, 2024

Note : tu peux sortir la PR de draft maintenant puisque ça ne sera déployé en staging que avec le label "deploy-to-staging".

Et sinon... Tu vois ça sera cool quand on aura ton test unitaire parce que il deviendra ultra simple avec ta première fixture de faire des nouveaux tests qui s'appuient dessus !

Dernière chose : intéressant comme approche que celle que tu proposes, en gros "corriger ce qu'envoie Dora". A une autre époque on aurait changé le schéma de DI, accepté cette nouvelle valeur, etc etc.

Par contre sur le fond : si on retire le --autre à la fin c'est bien ce qu'on veut ? Cf discussion sur Mattermost pour ça.

@YannickPassa YannickPassa marked this pull request as ready for review October 9, 2024 16:06
/* Dora made some changes to the thematics which add '--autre' in some cases.
We do not need them, thus they are removed from the table in order to pass the checks */
ARRAY(
SELECT REGEXP_REPLACE(other, '--autre$', '', 'g')
Copy link
Contributor

Choose a reason for hiding this comment

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

Sur la forme : c'est un peu brutal de recourir à une regexp avec un matching "à chaque occurrence" (avec le "g") quand on peut probablement juste utiliser REPLACE. Non ? Les performances te diront merci !

Copy link
Author

@YannickPassa YannickPassa Oct 9, 2024

Choose a reason for hiding this comment

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

j'aime tellement regex que j'en oublie que replace existe

We do not need them, thus they are removed from the table in order to pass the checks */
ARRAY(
SELECT REGEXP_REPLACE(other, '--autre$', '', 'g')
FROM UNNEST(services.thematiques) AS other
Copy link
Contributor

Choose a reason for hiding this comment

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

nit-picking : tant qu'à faire, AS unnested plutot que un nom générique comme other ?

@YannickPassa YannickPassa force-pushed the YannickPassa/ignore_others_on_dora_services branch from 365c782 to 5d9b43e Compare October 9, 2024 16:33
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