Skip to content

Refactor/transform into one module - #513

Draft
GtanSndil wants to merge 49 commits into
refactor/refactoring_magma_traditional_in_new_magmafrom
refactor/transform-into-one-module
Draft

Refactor/transform into one module#513
GtanSndil wants to merge 49 commits into
refactor/refactoring_magma_traditional_in_new_magmafrom
refactor/transform-into-one-module

Conversation

@GtanSndil

Copy link
Copy Markdown
Contributor

No description provided.

GtanSndil added 30 commits July 8, 2026 16:48
tests diffusion and gestion OK, swagger OK, call of http://localhost:8080/geo/departements and http://localhost:8080/datasets/list OK
…-impl

at this step, all tests are OK
+delete /old
…utomatically recognized as source root

avoid manual action : clic droit sur target/generated-sources/openapi/src/main/java → Mark Directory as → Generated Sources Root
+ add a directory for all config test containers classes
+ add expected json for gestion container tests

@nsenave nsenave left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

quelques remarques / questions / commentaires au passage mais le refacto a l'air très propre 👏

Comment thread magma-app/src/main/java/fr/insee/rmes/service/OpenApiService.java
Comment thread magma-app/src/main/java/fr/insee/rmes/service/OpenApiService.java
Comment thread magma-impl/src/main/java/fr/insee/rmes/magma/api/GeoDistrictEndpoints.java Outdated
Comment thread magma-impl/src/main/java/fr/insee/rmes/magma/services/RapportQualiteService.java Outdated
Comment thread magma-impl/pom.xml Outdated
Comment thread magma-impl/pom.xml Outdated
Comment thread magma-impl/pom.xml
Comment thread magma-interface/pom.xml Outdated
@@ -6,17 +6,16 @@
<parent>
<groupId>fr.insee.rmes</groupId>
<artifactId>magma-parent</artifactId>
<version>magma-refactored-1.0-rc0</version> <!-- Hérite de la propriété du parent -->
<version>2.0.0-SNAPSHOT</version>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

depuis une une certaine version de maven (~3.5+) on peut mettre en commun la version du projet pour tous les modules avec la property revision https://maven.apache.org/guides/mini/guide-maven-ci-friendly.html

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fait

@GtanSndil GtanSndil Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

mais question : doit-on avoir le même numéro pour <revision> (présente dans le pom parent - version Maven) et VERSION (présente dans la classe OpenApiService créée suite à cette PR - reflète la version du contrat d'API REST exposé aux consommateurs) ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Oui les deux devraient porter la même version, avec la logique semver

Comment thread pom.xml Outdated

@FBibonne FBibonne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rien d'important à signaler : quelques remarques ça et là. Je m'interroge juste sur l'utilité du module magma-app désormais
=> GTan : c'est le module de démarrage, pourquoi ne pas le garder ?

Sinon dernière remarque en passant : dans fr.insee.rmes.magma.queryexecutor.QueryExecutor#parseAskResponse , l'objet JsonMapper est un objet fait pour être réutilisatbe et thread safe : il devrait être transformé en un attribut de la classe
=> GTan : fait

Comment thread magma-interface/pom.xml Outdated
</configuration>
</execution>
</executions>
</plugin>
</plugins>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

On ne retrouve plus le yaml de la spec open-api par dépendance transitive sur les resources ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

explication IA : normalement, quand un module dépend d'un autre (ici magma-fusion-oas est déclaré en dépendance ligne 17-19), les ressources de ce module sont accessibles par dépendance transitive sur le classpath, sans avoir besoin de les extraire manuellement. Pourquoi c'est fait ainsi malgré tout ? Le openapi-generator-maven-plugin attend un paramètre inputSpec qui est un chemin fichier, pas une ressource classpath. Il ne peut pas lire le yaml directement depuis le classpath d'une dépendance. D'où l'étape explicite d'extraction avec unpack-dependencies.
En résumé : c'est un contournement technique nécessaire parce que le plugin OpenAPI Generator ne supporte pas la lecture de specs depuis le classpath — il faut un fichier physique sur disque.

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.

3 participants