Skip to content

Commit

Permalink
Merge branch 'v3-main' into release/3-29-1
Browse files Browse the repository at this point in the history
  • Loading branch information
nsenave committed Dec 6, 2024
2 parents 03d0828 + 72c1603 commit 1dce9fe
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 21 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
- 'CHANGELOG.md'
- 'README**.md'
- 'Dockerfile'
- '.github/**'

jobs:

Expand Down Expand Up @@ -54,10 +53,10 @@ jobs:
exit 1
fi
if ! [[ "${{ steps.version-step.outputs.version }}" =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then
echo "Nothing to tag/release, the tag ${{ steps.version-step.outputs.version }} is not in correct format X.Y.Z"
exit 1
fi
# if ! [[ "${{ steps.version-step.outputs.version }}" =~ ^[0-9]+.[0-9]+.[0-9]+(-hotfix\.\d+)?$ ]]; then
# echo "Nothing to tag/release, the tag ${{ steps.version-step.outputs.version }} is not in correct format X.Y.Z"
# exit 1
# fi

sonar:
name: Sonar analysis
Expand Down Expand Up @@ -136,7 +135,7 @@ jobs:

- name: Get previous final release tag
id: previousTag
run: echo "previousTag=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | grep "^[3-9]\.[0-9]\+\.[0-9]\+$" | tail -1)" >> $GITHUB_OUTPUT
run: echo "previousTag=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | grep "^[3-9]\.[0-9]+\.[0-9]+(-hotfix\.\d+)?$" | tail -1)" >> $GITHUB_OUTPUT
# Note: the regex works for single digit major version, to be updated if the version goes 10.0.0 or more

- name: Create tag
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.sonarqube.gradle.SonarTask

plugins {
id("org.springframework.boot") version "3.3.5" apply false
id("org.springframework.boot") version "3.4.0" apply false
id("io.spring.dependency-management") version "1.1.6" apply false
id("application")
id("jacoco-report-aggregation")
Expand All @@ -16,7 +16,7 @@ java {

allprojects {
group = "fr.insee.eno"
version = "3.29.1-SNAPSHOT"
version = "3.29.1"
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,12 @@ public static String concatenateStrings(String vtlString1, String vtlString2) {

/**
* Inverts the given expression (which is supposed to be a VTL expression that returns a boolean)
* by adding a 'not()' around it, or eventually removing one if the entire expression is in a "not".
* by adding a 'not()' around it.
* @param expression VTL boolean expression.
* @return The inverted VTL expression.
*/
public static String invertBooleanExpression(String expression) {
String trimmed = expression.trim();
// If the whole expression is within a not(), remove it
if (trimmed.startsWith("not(") && trimmed.endsWith(")"))
return trimmed.substring(4, trimmed.length() - 1);
// Otherwise, add a not() around the expression
return "not(" + trimmed + ")";
return "not(" + expression + ")";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void mapDDIWithRoundabout() throws DDIParsingException {
assertEquals(1, enoQuestionnaire.getFilters().size());
Filter enoFilter = enoQuestionnaire.getFilters().getFirst();
assertTrue(enoFilter.isRoundaboutFilter());
assertFalse(enoFilter.getExpression().getValue().startsWith("not"));
assertTrue(enoFilter.getExpression().getValue().startsWith("not"));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void roundaboutItem() {
assertEquals("\"Occurrence description of \" || FIRST_NAME",
roundaboutItem.getDescription().getValue().stripTrailing());
assertEquals(LabelTypeEnum.VTL_MD, roundaboutItem.getDescription().getType());
assertEquals("FIRST_NAME <> FIRST_NAME_REF",
assertEquals("not(not(FIRST_NAME <> FIRST_NAME_REF))",
roundaboutItem.getDisabled().getValue().stripTrailing());
assertEquals(LabelTypeEnum.VTL, roundaboutItem.getDisabled().getType());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ class VtlSyntaxUtilsTest {

@Test
void invertExpressions() {
assertEquals("FOO", VtlSyntaxUtils.invertBooleanExpression("not(FOO)"));
assertEquals("not(not(FOO))", VtlSyntaxUtils.invertBooleanExpression("not(FOO)"));
assertEquals("not(FOO)", VtlSyntaxUtils.invertBooleanExpression("FOO"));
assertEquals("not(FOO)", VtlSyntaxUtils.invertBooleanExpression("not(not(FOO))"));
assertEquals("FOO = 1", VtlSyntaxUtils.invertBooleanExpression("not(FOO = 1)"));
assertEquals("not(not(not(FOO)))", VtlSyntaxUtils.invertBooleanExpression("not(not(FOO))"));
assertEquals("not(not(FOO = 1))", VtlSyntaxUtils.invertBooleanExpression("not(FOO = 1)"));
assertEquals("not(FOO = 1)", VtlSyntaxUtils.invertBooleanExpression("FOO = 1"));
}

Expand Down
2 changes: 1 addition & 1 deletion eno-ws/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tasks.named<Jar>("jar") {
enabled = false
}

val springdocVersion = "2.6.0"
val springdocVersion = "2.7.0"

dependencies {
//
Expand Down

0 comments on commit 1dce9fe

Please sign in to comment.