Skip to content

Commit

Permalink
fix: lunatic scalar variable values (#918)
Browse files Browse the repository at this point in the history
* chore: remove empty entries in changelog

* ci(changelog): exclude docs commits

Due to current issue in changelog action. requarks/changelog-action#51

* build: lunatic-model 3.3.5

Include default empty values for variables.

* refactor(variables): values are now present by default

* chore: bump version

* test: integration test for scalar variable

* chore: remove condition in test ci

* build: bump com.networknt:json-schema-validator from 1.3.1 to 1.3.3 (#916)

Bumps [com.networknt:json-schema-validator](https://github.com/networknt/json-schema-validator) from 1.3.1 to 1.3.3.
- [Release notes](https://github.com/networknt/json-schema-validator/releases)
- [Changelog](https://github.com/networknt/json-schema-validator/blob/master/CHANGELOG.md)
- [Commits](networknt/json-schema-validator@1.3.1...1.3.3)

---
updated-dependencies:
- dependency-name: com.networknt:json-schema-validator
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nicolas Sénave <[email protected]>

* build: bump org.springframework.boot from 3.2.2 to 3.2.3 (#917)

Bumps [org.springframework.boot](https://github.com/spring-projects/spring-boot) from 3.2.2 to 3.2.3.
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](spring-projects/spring-boot@v3.2.2...v3.2.3)

---
updated-dependencies:
- dependency-name: org.springframework.boot
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
nsenave and dependabot[bot] authored Feb 26, 2024
1 parent 7b18699 commit 73151aa
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 16 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ jobs:
with:
fromTag: ${{ needs.check-version.outputs.release-version }}
toTag: ${{ steps.previousTag.outputs.previousTag}}
excludeTypes: style,chore,other
excludeScopes: changelog # do not include changelog commits
excludeTypes: docs,style,chore,other
token: ${{ secrets.GITHUB_TOKEN }}
writeToFile: true
changelogFilePath: 'CHANGELOG.md'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:

jobs:
build:
if: ${{ (github.event.pull_request.draft == false) && !contains(github.event.pull_request.labels.*.name, 'deploy-snapshot') && !startsWith(github.event.head_commit.message, 'chore') }}
if: ${{ (github.event.pull_request.draft == false) && !contains(github.event.pull_request.labels.*.name, 'deploy-snapshot') }}
name: Build and analyze
runs-on: ubuntu-latest
steps:
Expand Down
7 changes: 0 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### :recycle: Refactors
- [`282a34d`](https://github.com/InseeFr/Eno/commit/282a34db5c652b5b1b93d6dd0278c8451cf560b1) - remove lunatic patches *(PR [#913](https://github.com/InseeFr/Eno/pull/913) by [@nsenave](https://github.com/nsenave))*

### :memo: Documentation Changes


## [3.17.1] - 2024-02-07
### :bug: Bug Fixes
- [`0fd6dc1`](https://github.com/InseeFr/Eno/commit/0fd6dc1651a6655f3b7ee8cd5e2e8f8d65fb4199) - lunatic dynamic table variables *(PR [#903](https://github.com/InseeFr/Eno/pull/903) by [@nsenave](https://github.com/nsenave))*
Expand All @@ -21,9 +18,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### :construction_worker: Build System
- [`2476295`](https://github.com/InseeFr/Eno/commit/24762952cfe0c3e3f1dd1ed52f038d9abf171ea7) - bump com.networknt:json-schema-validator from 1.3.0 to 1.3.1 *(PR [#897](https://github.com/InseeFr/Eno/pull/897) by [@dependabot[bot]](https://github.com/apps/dependabot))*

### :memo: Documentation Changes


## [3.17.0] - 2024-02-02
### :bug: Bug Fixes
- [`6282cb0`](https://github.com/InseeFr/Eno/commit/6282cb00724ff90787089f93ba1d4d263465abb4) - pairwise missing variable name *(PR [#892](https://github.com/InseeFr/Eno/pull/892) by [@nsenave](https://github.com/nsenave))*
Expand All @@ -41,7 +35,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### :memo: Documentation Changes
- [`f6ce68c`](https://github.com/InseeFr/Eno/commit/f6ce68c319e6df77815f97eb55e285a25609dd21) - update readme after java 21 *(commit by [@nsenave](https://github.com/nsenave))*


## [3.16.1] - 2024-01-30
### :bug: Bug Fixes
- [`f487c48`](https://github.com/InseeFr/Eno/commit/f487c4863e439417f536b54f0302c183fbeb7ce4) - remove prefix in questionnaire id *(PR [#890](https://github.com/InseeFr/Eno/pull/890) by [@nsenave](https://github.com/nsenave))*
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.2.2' apply false
id 'org.springframework.boot' version '3.2.3' apply false
id 'io.spring.dependency-management' version '1.1.4' apply false
id 'jacoco'
id "org.sonarqube" version '4.4.1.3373'
Expand All @@ -16,7 +16,7 @@ tasks.withType(JavaCompile).configureEach {

allprojects {
group = 'fr.insee.eno'
version = '3.17.2'
version = '3.17.3'
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ private void replaceArrayVariables(Collection<String> collectedVariableNames) {
VariableTypeArray variableTypeArray = new VariableTypeArray();
variableTypeArray.setVariableType(VariableTypeEnum.COLLECTED);
variableTypeArray.setName(variableName);
variableTypeArray.setValues(new ValuesTypeArray());
lunaticQuestionnaire.getVariables().add(variableTypeArray);
});
}
Expand All @@ -96,7 +95,6 @@ private void replacePairwiseVariable(PairwiseLinks pairwiseLinks) {
VariableTypeTwoDimensionsArray variableTypeTwoDimensionsArray = new VariableTypeTwoDimensionsArray();
variableTypeTwoDimensionsArray.setVariableType(VariableTypeEnum.COLLECTED);
variableTypeTwoDimensionsArray.setName(pairwiseVariableName);
variableTypeTwoDimensionsArray.setValues(new ValuesTypeTwoDimensionsArray());
lunaticQuestionnaire.getVariables().add(variableTypeTwoDimensionsArray);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
package fr.insee.eno.core.processing.out.steps.lunatic;

import fr.insee.eno.core.DDIToLunatic;
import fr.insee.eno.core.exceptions.business.DDIParsingException;
import fr.insee.eno.core.parameter.EnoParameters;
import fr.insee.eno.core.parameter.Format;
import fr.insee.lunatic.model.flat.*;
import org.junit.jupiter.api.Test;

import java.util.Optional;

import static org.junit.jupiter.api.Assertions.*;

class LunaticVariablesValuesTest {

@Test
void scalarVariable_integrationTest_ValuesShouldBeNotNull() throws DDIParsingException {
//
Questionnaire lunaticQuestionnaire = DDIToLunatic.transform(
this.getClass().getClassLoader().getResourceAsStream("integration/ddi/ddi-simple.xml"),
EnoParameters.of(EnoParameters.Context.HOUSEHOLD, EnoParameters.ModeParameter.CAWI, Format.LUNATIC));
//
Optional<IVariableType> searchedVariable = lunaticQuestionnaire.getVariables().stream()
.filter(variable -> "Q1".equals(variable.getName())).findAny();
assertTrue(searchedVariable.isPresent());
VariableType variableType = assertInstanceOf(VariableType.class, searchedVariable.get());
assertNotNull(variableType.getValues());
}

@Test
void replaceVariablesFromLoop() {
//
Expand Down
2 changes: 1 addition & 1 deletion eno-treatments/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies {
// Jackson
implementation 'com.fasterxml.jackson.core:jackson-databind'
// Json schema validator
implementation 'com.networknt:json-schema-validator:1.3.1'
implementation 'com.networknt:json-schema-validator:1.3.3'

// Logging
implementation 'org.slf4j:slf4j-api'
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencyResolutionManagement {

versionCatalogs {
libs {
version('lunatic-model', '3.3.4')
version('lunatic-model', '3.3.5')
version('pogues-model', '1.0.5')
library('lunatic-model', 'fr.insee.lunatic', 'lunatic-model').versionRef('lunatic-model')
library('pogues-model', 'fr.insee.pogues', 'pogues-model').versionRef('pogues-model')
Expand Down

0 comments on commit 73151aa

Please sign in to comment.