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

feat: typescript and migrations #51

Closed
wants to merge 11 commits into from
Closed

feat: typescript and migrations #51

wants to merge 11 commits into from

Conversation

revolunet
Copy link
Member

Add kysely and database mirgations

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 17 Code Smells

No Coverage information No Coverage information
7.0% 7.0% Duplication

Copy link
Member

@rap2hpoutre rap2hpoutre left a comment

Choose a reason for hiding this comment

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

Super, ça me semble bon !

J'ai laissé quelques notes, c'est plus ou moins ignorable.

Concernant les tests, je ne sais justement pas trop comment faire... Tu as pu tester de ton côté ? Qu'est-ce qui peut nous rassurer quant au fait que tout va toujours bien aller ?

Une deuxième question : pour les tests on a dû ajouter un build pour le TS. C'est bon pour le déploiement, on gère le build aussi ?

| DESTINATION_TABLE | `matomo` |
| STARTDATE | default to today() |
| RESULTPERPAGE | matomo pagination (defaults to 500) |
| INITIAL_OFFSET | How many days to fetch on initialisation (defaults to 3) |
Copy link
Member

Choose a reason for hiding this comment

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

ça veut dire qu'il faut qu'on mette à jour nos env partout ? Si oui, on en parle, si non tu peux ignorer !

Copy link
Member Author

Choose a reason for hiding this comment

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

non c'est juste que ce n'était pas documenté

});
//const isoDate = (date) => formatISO(date, { representation: "date" });

// jest.mock("pg", () => {
Copy link
Member

Choose a reason for hiding this comment

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

Pourquoi on ne teste plus tout ça ? Si c'est inutile on peut supprimer j'imagine, plutôt que de garder un code qu'on ne sait pas pourquoi il est là. Ou alors on pourrait noter pourquoi c'est là mais pas là.

// return MatomoClient;
// });

test("test", () => {});
Copy link
Member

Choose a reason for hiding this comment

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

Mon préféré.

Suggested change
test("test", () => {});

// });

test("test", () => {});
/*
Copy link
Member

Choose a reason for hiding this comment

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

En fait plus globalement je ne comprends pas pourquoi ce fichier est commenté. Je suggère de l'enlever ou d'enlever les parties qu'on ne veut plus, quitte à les refaire.

Copy link
Member

Choose a reason for hiding this comment

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

C'est dommage github montre pas les diff juste un fichier supprimé et un ajouté. Du coup je survole :'(

Comment on lines +16 to +19
if (extension) {
console.error("pg_partman extension detected; Skip migrations");
return;
}
Copy link
Member

Choose a reason for hiding this comment

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

C'est la présence de partman qui conditionne les migrations, pourquoi ?

Copy link
Member Author

Choose a reason for hiding this comment

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

c'était dans un souci de retro-compatibilité avec les anciennes DB qui utilisent partman, mais je vais virer

@revolunet
Copy link
Member Author

remplacé par #54 avec de nouveaux tests

@revolunet revolunet closed this Jun 1, 2023
@revolunet revolunet deleted the kysely branch June 22, 2023 08:01
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