Skip to content

Commit

Permalink
Merge branch 'main' into devExecutionContext
Browse files Browse the repository at this point in the history
  • Loading branch information
alexisszmundy committed Aug 21, 2024
2 parents eb92cbb + 33a4a39 commit 0272158
Show file tree
Hide file tree
Showing 89 changed files with 378 additions and 2,661 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,25 @@ jobs:
java-version: '21'
distribution: 'temurin'
cache: maven

- name: Clone BPM
uses: actions/checkout@master
with:
repository: InseeFr/BPM
path: bpm

- name: Build BPM
run: |
cd bpm
mvn clean install
cd ..
- name: Build with Maven
- name: Build Kraftwerk with Maven
run: mvn -B clean package --file pom.xml

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@f97a4078d80bca790cd68e93a88da11a056ac0a3
uses: advanced-security/maven-dependency-submission-action@4f64ddab9d742a4806eeb588d238e4c311a8397d

- name: Coveralls GitHub Action
uses: coverallsapp/[email protected]
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ local_files/logs/*

# Config
src/main/resources/application-*.properties
!src/main/resources/application-local.properties
src/main/resources/kraftwerk.properties

# Compiled files
target/
Expand Down
2 changes: 2 additions & 0 deletions kraftwerk-api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Config
src/main/resources/kraftwerk.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import fr.insee.kraftwerk.core.exceptions.KraftwerkException;
import fr.insee.kraftwerk.core.inputs.ModeInputs;
import fr.insee.kraftwerk.core.inputs.UserInputsFile;
import fr.insee.kraftwerk.core.metadata.MetadataModel;
import fr.insee.kraftwerk.core.metadata.MetadataUtils;
import fr.insee.kraftwerk.core.sequence.BuildBindingsSequence;
import fr.insee.kraftwerk.core.sequence.ControlInputSequence;
Expand All @@ -16,6 +15,9 @@
import fr.insee.kraftwerk.core.utils.files.FileUtilsInterface;
import fr.insee.kraftwerk.core.utils.log.KraftwerkExecutionContext;
import fr.insee.kraftwerk.core.vtl.VtlBindings;

import fr.insee.bpm.metadata.model.MetadataModel;

import lombok.Getter;
import lombok.extern.log4j.Log4j2;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package fr.insee.kraftwerk.api.process;

import fr.insee.bpm.exceptions.MetadataParserException;
import fr.insee.bpm.metadata.model.MetadataModel;

import fr.insee.kraftwerk.api.client.GenesisClient;
import fr.insee.kraftwerk.api.configuration.ConfigProperties;
import fr.insee.kraftwerk.core.KraftwerkError;
import fr.insee.kraftwerk.core.data.model.SurveyUnitId;
import fr.insee.kraftwerk.core.data.model.SurveyUnitUpdateLatest;
import fr.insee.kraftwerk.core.exceptions.KraftwerkException;
import fr.insee.kraftwerk.core.inputs.UserInputsGenesis;
import fr.insee.kraftwerk.core.metadata.MetadataModel;
import fr.insee.kraftwerk.core.metadata.MetadataUtilsGenesis;
import fr.insee.kraftwerk.core.sequence.BuildBindingsSequenceGenesis;
import fr.insee.kraftwerk.core.sequence.ControlInputSequenceGenesis;
Expand Down Expand Up @@ -75,8 +77,12 @@ public void init(String idCampaign) throws KraftwerkException {
//We build userInputs for the given questionnaire
userInputs = new UserInputsGenesis(controlInputSequenceGenesis.isHasConfigFile(), inDirectory, client.getModes(idCampaign), fileUtilsInterface);
if (!userInputs.getModes().isEmpty()) {
metadataModels = MetadataUtilsGenesis.getMetadata(userInputs.getModeInputsMap(), fileUtilsInterface);
} else {
try {
metadataModels = MetadataUtilsGenesis.getMetadata(userInputs.getModeInputsMap(), fileUtilsInterface);
} catch (MetadataParserException e) {
throw new KraftwerkException(500, e.getMessage());
}
} else {
log.error("No source found for campaign " + idCampaign);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package fr.insee.kraftwerk.api.services;


import fr.insee.bpm.exceptions.MetadataParserException;
import fr.insee.kraftwerk.api.configuration.ConfigProperties;
import fr.insee.kraftwerk.api.configuration.MinioConfig;
import fr.insee.kraftwerk.api.process.MainProcessing;
import fr.insee.kraftwerk.api.process.MainProcessingGenesis;
import fr.insee.kraftwerk.core.exceptions.KraftwerkException;
import fr.insee.kraftwerk.core.sequence.ControlInputSequenceGenesis;
import fr.insee.kraftwerk.core.utils.files.FileSystemImpl;
import fr.insee.kraftwerk.core.utils.files.FileUtilsInterface;
import fr.insee.kraftwerk.core.utils.files.MinioImpl;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package fr.insee.kraftwerk.api.services;

import fr.insee.bpm.metadata.model.MetadataModel;
import fr.insee.kraftwerk.api.configuration.MinioConfig;
import fr.insee.kraftwerk.api.process.MainProcessing;
import fr.insee.kraftwerk.core.dataprocessing.StepEnum;
import fr.insee.kraftwerk.core.exceptions.KraftwerkException;
import fr.insee.kraftwerk.core.inputs.UserInputsFile;
import fr.insee.kraftwerk.core.metadata.MetadataModel;
import fr.insee.kraftwerk.core.metadata.MetadataUtils;
import fr.insee.kraftwerk.core.sequence.*;
import fr.insee.kraftwerk.core.utils.files.FileSystemImpl;
Expand Down
21 changes: 0 additions & 21 deletions kraftwerk-api/src/main/resources/kraftwerk.properties

This file was deleted.

11 changes: 9 additions & 2 deletions kraftwerk-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.26.2</version>
<version>1.27.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand All @@ -102,7 +102,7 @@
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>8.5.11</version>
<version>8.5.12</version>
</dependency>


Expand All @@ -112,5 +112,12 @@
<artifactId>duckdb_jdbc</artifactId>
<version>${duckdb.version}</version>
</dependency>

<!-- Metadatas -->
<dependency>
<groupId>fr.insee.bpm</groupId>
<artifactId>bpm</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package fr.insee.kraftwerk.core.dataprocessing;

import fr.insee.kraftwerk.core.metadata.CalculatedVariables;
import fr.insee.bpm.metadata.model.CalculatedVariables;
import fr.insee.kraftwerk.core.utils.files.FileUtilsInterface;
import fr.insee.kraftwerk.core.utils.log.KraftwerkExecutionContext;
import fr.insee.kraftwerk.core.vtl.VtlBindings;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package fr.insee.kraftwerk.core.dataprocessing;

import fr.insee.kraftwerk.core.metadata.MetadataModel;
import fr.insee.kraftwerk.core.metadata.PaperUcq;
import fr.insee.kraftwerk.core.metadata.VariablesMap;
import fr.insee.bpm.metadata.model.MetadataModel;
import fr.insee.bpm.metadata.model.PaperUcq;
import fr.insee.bpm.metadata.model.VariablesMap;
import fr.insee.kraftwerk.core.utils.files.FileUtilsInterface;
import fr.insee.kraftwerk.core.utils.log.KraftwerkExecutionContext;
import fr.insee.kraftwerk.core.vtl.VtlBindings;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fr.insee.kraftwerk.core.dataprocessing;

import fr.insee.kraftwerk.core.metadata.MetadataModel;
import fr.insee.bpm.metadata.model.MetadataModel;

import fr.insee.kraftwerk.core.parsers.DataFormat;
import fr.insee.kraftwerk.core.utils.files.FileUtilsInterface;
import fr.insee.kraftwerk.core.vtl.VtlBindings;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package fr.insee.kraftwerk.core.dataprocessing;

import fr.insee.kraftwerk.core.metadata.MetadataModel;
import fr.insee.kraftwerk.core.metadata.VariablesMap;
import fr.insee.bpm.metadata.model.MetadataModel;

import fr.insee.bpm.metadata.model.VariablesMap;
import fr.insee.kraftwerk.core.utils.files.FileUtilsInterface;
import fr.insee.kraftwerk.core.vtl.VtlBindings;
import fr.insee.kraftwerk.core.vtl.VtlScript;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package fr.insee.kraftwerk.core.dataprocessing;

import fr.insee.bpm.metadata.model.MetadataModel;
import fr.insee.kraftwerk.core.Constants;
import fr.insee.kraftwerk.core.metadata.MetadataModel;
import fr.insee.kraftwerk.core.utils.files.FileUtilsInterface;
import fr.insee.kraftwerk.core.vtl.VtlBindings;
import fr.insee.kraftwerk.core.vtl.VtlMacros;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fr.insee.kraftwerk.core.dataprocessing;

import fr.insee.kraftwerk.core.metadata.MetadataModel;

import fr.insee.bpm.metadata.model.MetadataModel;
import fr.insee.kraftwerk.core.utils.files.FileUtilsInterface;
import fr.insee.kraftwerk.core.vtl.VtlBindings;
import fr.insee.kraftwerk.core.vtl.VtlScript;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package fr.insee.kraftwerk.core.dataprocessing;

import fr.insee.kraftwerk.core.metadata.MetadataModel;
import fr.insee.kraftwerk.core.metadata.UcqModality;
import fr.insee.kraftwerk.core.metadata.UcqVariable;
import fr.insee.bpm.metadata.model.MetadataModel;
import fr.insee.bpm.metadata.model.UcqModality;
import fr.insee.bpm.metadata.model.UcqVariable;
import fr.insee.kraftwerk.core.utils.files.FileUtilsInterface;
import fr.insee.kraftwerk.core.vtl.VtlBindings;
import fr.insee.kraftwerk.core.vtl.VtlScript;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package fr.insee.kraftwerk.core.dataprocessing;

import fr.insee.kraftwerk.core.metadata.MetadataModel;
import fr.insee.bpm.metadata.model.MetadataModel;
import fr.insee.kraftwerk.core.utils.TextFileReader;
import fr.insee.kraftwerk.core.utils.files.FileUtilsInterface;
import fr.insee.kraftwerk.core.utils.log.KraftwerkExecutionContext;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package fr.insee.kraftwerk.core.dataprocessing;

import fr.insee.kraftwerk.core.metadata.MetadataModel;
import fr.insee.bpm.metadata.model.MetadataModel;
import fr.insee.kraftwerk.core.utils.files.FileUtilsInterface;
import fr.insee.kraftwerk.core.vtl.VtlBindings;
import fr.insee.kraftwerk.core.vtl.VtlScript;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package fr.insee.kraftwerk.core.dataprocessing;

import fr.insee.kraftwerk.core.metadata.MetadataModel;
import fr.insee.bpm.metadata.model.MetadataModel;
import fr.insee.kraftwerk.core.utils.files.FileUtilsInterface;
import fr.insee.kraftwerk.core.vtl.VtlBindings;
import fr.insee.kraftwerk.core.vtl.VtlScript;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@

import fr.insee.kraftwerk.core.Constants;
import fr.insee.kraftwerk.core.exceptions.NullException;
import fr.insee.kraftwerk.core.metadata.Group;
import fr.insee.kraftwerk.core.metadata.Variable;
import fr.insee.kraftwerk.core.metadata.VariableType;
import fr.insee.kraftwerk.core.metadata.VariablesMap;
import fr.insee.bpm.metadata.model.Group;
import fr.insee.bpm.metadata.model.Variable;
import fr.insee.bpm.metadata.model.VariableType;
import fr.insee.bpm.metadata.model.VariablesMap;
import fr.insee.kraftwerk.core.rawdata.QuestionnaireData;
import fr.insee.kraftwerk.core.rawdata.SurveyRawData;
import fr.insee.kraftwerk.core.utils.files.FileUtilsInterface;
import lombok.extern.log4j.Log4j2;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;

import java.nio.file.Files;
import java.nio.file.Path;
import java.time.Instant;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Stream;

@Log4j2
public class ParadataParser {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@


import fr.insee.kraftwerk.core.Constants;
import fr.insee.kraftwerk.core.metadata.Group;
import fr.insee.kraftwerk.core.metadata.Variable;
import fr.insee.kraftwerk.core.metadata.VariableType;
import fr.insee.bpm.metadata.model.Group;
import fr.insee.bpm.metadata.model.Variable;
import fr.insee.bpm.metadata.model.VariableType;
import fr.insee.kraftwerk.core.rawdata.QuestionnaireData;
import fr.insee.kraftwerk.core.rawdata.SurveyRawData;
import fr.insee.kraftwerk.core.utils.DateUtils;
Expand Down

This file was deleted.

Loading

0 comments on commit 0272158

Please sign in to comment.