Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
bb22931
Change authentification manangement to use Keycloack
pierrejego Jun 5, 2026
a7632fa
change endpoint management
pierrejego Jun 5, 2026
7bb18bc
update pull diff PEI
pierrejego Jun 5, 2026
e04143d
Traduction des réponses PEI/caractéristiques de v2 en V3 en restant c…
pierrejego Jun 5, 2026
6569374
Mise à jour des la gestion de PEI par nature PIBI ou PENA
pierrejego Jun 5, 2026
739e68f
Modification des codes de gestions de visites CTP et NP
pierrejego Jun 5, 2026
439b280
Modification de la gestion des indisponibiltés temporaires
pierrejego Jun 5, 2026
ee04cb0
modification de la gestion des codes d'anomalie
pierrejego Jun 5, 2026
2a0e55b
Ajout d'un test de bout en bout
pierrejego Jun 5, 2026
cdf2aed
Change docker version management
pierrejego Jun 5, 2026
76ff16d
add missing workflow files
pierrejego Jun 5, 2026
8ba6d71
push image on branche as well
pierrejego Jun 15, 2026
ddb27ab
change java11 version usage
pierrejego Jun 15, 2026
342eb7e
update docker file with java 11
pierrejego Jun 15, 2026
19cc6a6
add more details on API errors
pierrejego Jun 16, 2026
771a246
update style
pierrejego Jun 16, 2026
f384b5a
update authentification errors
pierrejego Jun 16, 2026
fd59676
correction on java spotless
pierrejego Jun 16, 2026
9f8f236
Correction des visites manuelle et modification des controle réalisé
pierrejego Jul 13, 2026
a4756a2
correction des envoies d'IT uniquement dans certains cas ARRET_EAU / …
pierrejego Jul 13, 2026
4134108
ajout de test pour le cas 18
pierrejego Jul 13, 2026
96efd1c
Checkstyle corrections
pierrejego Jul 13, 2026
fdb0ed8
Correction point 18 fichier excel Remocra V3 Test du 2306-3007.xlsx
pierrejego Aug 28, 2026
84f0325
add unit test for new case
pierrejego Aug 28, 2026
cc853c9
Ajout de FERME DEMANDE SSQ -> BSPP_APSE des cas APP PROJET -> BSPP_APSE
pierrejego Sep 4, 2026
2283fb8
ajout de documentation d'exploitation et préparation de la release
pierrejego Sep 8, 2026
15f6c8b
Merge pull request #14 from jdev-org/remocrav3
pierrejego Sep 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions .github/workflows/deploy-image.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#
name: Create and publish a Docker image

# Configures this workflow to run every time a change is pushed to the branch called `release`.
# Configures this workflow to run every time a change is pushed to a branch.
on:
push:
branches: ['main']
branches: ['**']

# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
Expand All @@ -25,6 +25,29 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Compute application version
id: version
run: |
branch_tag=$(echo "${GITHUB_REF_NAME}" | tr '/[:upper:]' '-[:lower:]')
if [ "${GITHUB_REF_NAME}" = "main" ]; then
app_version="main-${GITHUB_SHA::12}"
else
app_version="${branch_tag}-${GITHUB_SHA::12}"
fi
echo "branch_tag=${branch_tag}" >> "$GITHUB_OUTPUT"
echo "app_version=${app_version}" >> "$GITHUB_OUTPUT"
- name: Check whether branch tag conflicts with a Git tag
id: branch-tag-check
run: |
if [ "${GITHUB_REF_NAME}" = "main" ]; then
echo "publish_branch_tag=false" >> "$GITHUB_OUTPUT"
elif git rev-parse --verify --quiet "refs/tags/${GITHUB_REF_NAME}" >/dev/null; then
echo "publish_branch_tag=false" >> "$GITHUB_OUTPUT"
else
echo "publish_branch_tag=true" >> "$GITHUB_OUTPUT"
fi
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
Expand All @@ -38,6 +61,10 @@ jobs:
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=main,enable=${{ github.ref_name == 'main' }}
type=raw,value=${{ steps.version.outputs.app_version }}
type=raw,value=${{ steps.version.outputs.branch_tag }},enable=${{ steps.branch-tag-check.outputs.publish_branch_tag == 'true' }}
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
Expand All @@ -51,7 +78,7 @@ jobs:
build-args: |
UID:"${DOCKER_UID}"
GID:"${DOCKER_GID}"
APP_VERSION:"1.43"
APP_VERSION:"${{ steps.version.outputs.app_version }}"
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/deploy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Compute application version
id: version
run: |
echo "app_version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
Expand All @@ -39,6 +43,10 @@ jobs:
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ steps.version.outputs.app_version }}
type=raw,value=${{ github.ref_name }}
type=raw,value=latest
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
Expand All @@ -52,7 +60,9 @@ jobs:
build-args: |
UID:"${DOCKER_UID}"
GID:"${DOCKER_GID}"
tags: ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:${{ github.ref_name }}
APP_VERSION:"${{ steps.version.outputs.app_version }}"
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

# This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)."
- name: Generate artifact attestation
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ jobs:
cache: maven
- name: Build with Maven
run: mvn -B clean install --file pom.xml
- name: Upload App Coverage Report
if: always()
uses: actions/upload-artifact@v4
with:
name: jacoco-app-report
path: app/target/site/jacoco
if-no-files-found: warn

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
#- name: Update dependency graph
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
app/target/
db/target/
AGENTS.md
comparaison-api-v2-vs-v3 _1_.md
doc/target/

16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,22 @@ Exemple pour Visual Studio Code .vscode/launch.json :
}
```

### Configuration de l'API REMOcRA

Le client REMOcRA est configuré en v3 only avec authentification Keycloak / OIDC.

Variables d'environnement disponibles :

```sh
API_HOST=http://localhost:8881
API_BASE_PATH=/api
API_AUTH_TYPE=keycloak
API_KEYCLOAK_URL=https://keycloak.example
API_KEYCLOAK_REALM=remocra
API_KEYCLOAK_CLIENT_ID=sync-remocra
API_KEYCLOAK_CLIENT_SECRET=change-me
```



## Formatage de code (API)
Expand Down
34 changes: 34 additions & 0 deletions app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,40 @@

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<useIncrementalCompilation>false</useIncrementalCompilation>
<annotationProcessorPaths>
<path>
<groupId>org.immutables</groupId>
<artifactId>value</artifactId>
<version>${immutables.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down
101 changes: 101 additions & 0 deletions app/src/main/java/fr/eaudeparis/syncremocra/api/ApiEndpoints.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
package fr.eaudeparis.syncremocra.api;

/**
* Centralise les chemins des endpoints REMOcRA utilisés par l'application.
*
* <p>Cette classe ne gère que les chemins relatifs. La construction de l'URL complète ({@code host
* + basePath + path}) reste du ressort de {@link fr.eaudeparis.syncremocra.util.RequestManager}.
*/
public class ApiEndpoints {

private static final String DECI_ROOT = "/deci";
private static final String PEI_ROOT = DECI_ROOT + "/pei";
private static final String REFERENTIEL_ROOT = DECI_ROOT + "/referentiel";
private static final String INDISPO_TEMPORAIRE_ROOT = DECI_ROOT + "/indispoTemporaire";
private static final String VISITES_SEGMENT = "/visites";
private static final String CARACTERISTIQUES_SEGMENT = "/caracteristiques";

/** @return Endpoint de récupération des diffs PEI */
public String peiDiff() {
return PEI_ROOT + "/diff";
}

/**
* @param reference Référence ou numéro du PEI
* @return Endpoint du PEI ciblé
*/
public String pei(String reference) {
return PEI_ROOT + "/" + reference;
}

/**
* @param reference Référence ou numéro du PEI
* @return Endpoint des caractéristiques du PEI ciblé
*/
public String peiCaracteristiques(String reference) {
return pei(reference) + CARACTERISTIQUES_SEGMENT;
}

/**
* @param reference Référence ou numéro du PEI
* @return Endpoint de mise à jour des caractéristiques PIBI
*/
public String peiPibiCaracteristiques(String reference) {
return pei(reference) + "/pibi-caracteristiques";
}

/**
* @param reference Référence ou numéro du PEI
* @return Endpoint de mise à jour des caractéristiques PENA
*/
public String peiPenaCaracteristiques(String reference) {
return pei(reference) + "/pena-caracteristiques";
}

/**
* @param reference Référence ou numéro du PEI
* @return Endpoint de la collection de visites du PEI ciblé
*/
public String peiVisites(String reference) {
return pei(reference) + VISITES_SEGMENT;
}

/**
* @param reference Référence ou numéro du PEI
* @param identifiantVisite Identifiant de la visite
* @return Endpoint d'une visite spécifique d'un PEI
*/
public String peiVisite(String reference, Object identifiantVisite) {
return peiVisites(reference) + "/" + identifiantVisite;
}

/** @return Endpoint de la collection des indisponibilités temporaires */
public String indispoTemporaire() {
return INDISPO_TEMPORAIRE_ROOT;
}

/**
* @param identifiant Identifiant de l'indisponibilité temporaire
* @return Endpoint d'une indisponibilité temporaire spécifique
*/
public String indispoTemporaire(Object identifiant) {
return INDISPO_TEMPORAIRE_ROOT + "/" + identifiant;
}

/**
* @param type Type de PEI en minuscule, par exemple {@code pibi} ou {@code pena}
* @param nature Nature du PEI
* @return Endpoint du référentiel des anomalies pour le type et la nature fournis
*/
public String referentielNaturesAnomalies(String type, String nature) {
return REFERENTIEL_ROOT + "/" + type + "/" + nature + "/naturesAnomalies";
}

/**
* @param type Type de PEI en minuscule, par exemple {@code pibi} ou {@code pena}
* @return Endpoint du référentiel des natures PEI pour le type fourni
*/
public String referentielNaturesPei(String type) {
return REFERENTIEL_ROOT + "/" + type + "/naturesPEI";
}
}
30 changes: 26 additions & 4 deletions app/src/main/java/fr/eaudeparis/syncremocra/api/ApiModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,31 @@ public class ApiModule extends AbstractModule {

public static ApiModule create(Config config) {
ImmutableApiSettings.Builder builder = ImmutableApiSettings.builder();
builder
.host(config.getString("host"))
.mail(config.getString("mail"))
.password(config.getString("password"));
builder.host(config.getString("host"));
if (config.hasPath("mail")) {
builder.mail(config.getString("mail"));
}
if (config.hasPath("password")) {
builder.password(config.getString("password"));
}
if (config.hasPath("base_path")) {
builder.basePath(config.getString("base_path"));
}
if (config.hasPath("auth_type")) {
builder.authType(config.getString("auth_type"));
}
if (config.hasPath("keycloak_url")) {
builder.keycloakUrl(config.getString("keycloak_url"));
}
if (config.hasPath("keycloak_realm")) {
builder.keycloakRealm(config.getString("keycloak_realm"));
}
if (config.hasPath("keycloak_client_id")) {
builder.keycloakClientId(config.getString("keycloak_client_id"));
}
if (config.hasPath("keycloak_client_secret")) {
builder.keycloakClientSecret(config.getString("keycloak_client_secret"));
}
return new ApiModule(builder.build());
}

Expand All @@ -25,5 +46,6 @@ public ApiModule(ImmutableApiSettings settings) {
@Override
protected void configure() {
bind(ApiSettings.class).toInstance(apiSettings);
bind(ApiEndpoints.class).asEagerSingleton();
}
}
49 changes: 47 additions & 2 deletions app/src/main/java/fr/eaudeparis/syncremocra/api/ApiSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,54 @@

@Value.Immutable
public interface ApiSettings {
/** @return URL racine de l'instance REMOcRA ou du reverse proxy exposant l'API */
String host();

String password();
/** @return Préfixe optionnel ajouté devant les endpoints, par exemple {@code /api} */
@Value.Default
default String basePath() {
return "";
}

String mail();
/** @return Type d'authentification API supporté par le client v3, soit {@code keycloak} */
@Value.Default
default String authType() {
return "keycloak";
}

/** @return Mot de passe historique conservé pour compatibilité de configuration locale */
@Value.Default
default String password() {
return "";
}

/** @return Adresse e-mail historique conservée pour compatibilité de configuration locale */
@Value.Default
default String mail() {
return "";
}

/** @return URL de base de Keycloak en mode OIDC */
@Value.Default
default String keycloakUrl() {
return "";
}

/** @return Realm Keycloak utilisé pour récupérer le jeton OIDC */
@Value.Default
default String keycloakRealm() {
return "";
}

/** @return Client ID Keycloak utilisé pour le flux {@code client_credentials} */
@Value.Default
default String keycloakClientId() {
return "";
}

/** @return Secret du client Keycloak utilisé pour le flux {@code client_credentials} */
@Value.Default
default String keycloakClientSecret() {
return "";
}
}
Loading
Loading