Skip to content

Commit 651547d

Browse files
authored
Fix aggregate git identifier rules (#187)
1 parent f19b740 commit 651547d

File tree

7 files changed

+15
-16
lines changed

7 files changed

+15
-16
lines changed

src/functionaltests/resources/queryAggregatedObject5.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"aggregatedObject.gav.artifactId":"sub-system",
55
"aggregatedObject.gav.version":"1.1.0"
66
},
7-
"filter" : "incomplete_path_filter(@, 'svnIdentifier')"
8-
}
7+
"filter" : "incomplete_path_filter(@, 'gitIdentifier')"
8+
}

src/main/resources/ArtifactRules_new.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
"ExtractionRules" : "",
126126
"ArrayMergeOptions": "",
127127
"HistoryIdentifyRules": "",
128-
"HistoryExtractionRules": "{SCCEventId: meta.id, author:data.author, issues:data.issues}",
128+
"HistoryExtractionRules": "{SCCEventId: meta.id, gitIdentifier:data.gitIdentifier, author:data.author, issues:data.issues}",
129129
"HistoryPathRules": "{sourceCreations: [{SCCEventId: meta.id}]}",
130130
"ProcessRules":null,
131131
"ProcessFunction" : null
@@ -141,9 +141,9 @@
141141
"ExtractionRules" : "",
142142
"ArrayMergeOptions": "",
143143
"HistoryIdentifyRules":"links | [?type=='CHANGE'].target",
144-
"HistoryExtractionRules": "{SCSEventId: meta.id,svnIdentifier:data.svnIdentifier, submitter:data.submitter}",
144+
"HistoryExtractionRules": "{SCSEventId: meta.id,gitIdentifier:data.gitIdentifier, submitter:data.submitter}",
145145
"HistoryPathRules": "{sourceChanges: [{SCSEventId: meta.id}]}",
146146
"ProcessRules":null,
147147
"ProcessFunction" : null
148148
}
149-
]
149+
]

src/test/java/com/ericsson/ei/jmespath/test/TestIncompleteJmesPathFilter.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import static org.junit.Assert.assertEquals;
2020

2121
import java.io.File;
22-
import java.io.IOException;
2322

2423
import org.apache.commons.io.FileUtils;
2524
import org.junit.BeforeClass;
@@ -68,8 +67,8 @@ public void testFilterObjectWithKey() throws Exception {
6867

6968
@Test
7069
public void testFilterObjectWithManyKeys() throws Exception {
71-
String expectedResult = "{\"time\":\"[1481875921843, 1481875988767, 1481875921763, 1481875944272, 5005, 1481875891763, 2000]\",\"svnIdentifier\":\"null\"}";
72-
String processRule = "{time : incomplete_path_filter(@, 'time'), svnIdentifier : incomplete_path_filter(@, 'svnIdentifier')}";
70+
String expectedResult = "{\"time\":\"[1481875921843, 1481875988767, 1481875921763, 1481875944272, 5005, 1481875891763, 2000]\",\"gitIdentifier\":\"null\"}";
71+
String processRule = "{time : incomplete_path_filter(@, 'time'), gitIdentifier : incomplete_path_filter(@, 'gitIdentifier')}";
7372
JsonNode result = unitUnderTest.runRuleOnEvent(processRule, jsonInput);
7473
assertEquals(result.toString(), expectedResult);
7574
}

src/test/resources/AggregatedDocumentInternalCompositionLatest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"email":"jane.doe@company.com"
4242
},
4343
"SCSEventId":"3ce9df6e-cd45-4320-ae66-945f038caa1b",
44-
"svnIdentifier":null,
44+
"gitIdentifier":null,
4545
"sourceCreations":[
4646
{
4747
"SCCEventId":"ac085e24-ac4c-41be-912d-08c7afd32285",
@@ -197,4 +197,4 @@
197197
}
198198
]
199199
}
200-
}
200+
}

src/test/resources/ArtifactRules_new.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
"ExtractionRules" : "",
126126
"ArrayMergeOptions": "",
127127
"HistoryIdentifyRules": "",
128-
"HistoryExtractionRules": "{SCCEventId: meta.id, author:data.author, issues:data.issues}",
128+
"HistoryExtractionRules": "{SCCEventId: meta.id, gitIdentifier:data.gitIdentifier, author:data.author, issues:data.issues}",
129129
"HistoryPathRules": "{sourceCreations: [{SCCEventId: meta.id}]}",
130130
"ProcessRules":null,
131131
"ProcessFunction" : null
@@ -141,9 +141,9 @@
141141
"ExtractionRules" : "",
142142
"ArrayMergeOptions": "",
143143
"HistoryIdentifyRules":"links | [?type=='CHANGE'].target",
144-
"HistoryExtractionRules": "{SCSEventId: meta.id,svnIdentifier:data.svnIdentifier, submitter:data.submitter}",
144+
"HistoryExtractionRules": "{SCSEventId: meta.id,gitIdentifier:data.gitIdentifier, submitter:data.submitter}",
145145
"HistoryPathRules": "{sourceChanges: [{SCSEventId: meta.id}]}",
146146
"ProcessRules":null,
147147
"ProcessFunction" : null
148148
}
149-
]
149+
]

src/test/resources/RulesHandlerOutput.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"ExtractionRules":"",
1010
"ArrayMergeOptions":"",
1111
"HistoryIdentifyRules":"",
12-
"HistoryExtractionRules":"{SCCEventId: meta.id, author:data.author, issues:data.issues}",
12+
"HistoryExtractionRules":"{SCCEventId: meta.id, gitIdentifier:data.gitIdentifier, author:data.author, issues:data.issues}",
1313
"HistoryPathRules":"{sourceCreations: [{SCCEventId: meta.id}]}",
1414
"ProcessRules":null,
1515
"ProcessFunction":null

src/test/resources/test_events.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,11 +312,11 @@
312312
}
313313
},
314314
"data": {
315-
"svnIdentifier": {
315+
"gitIdentifier": {
316316
"revision": 42,
317317
"directory": "trunk",
318318
"repoName": "Mainline",
319-
"repoUri": "svn://repohost/mainline"
319+
"repoUri": "https://github.com/johndoe/myPrivateRepo.git"
320320
},
321321
"submitter": {
322322
"name": "Jane Doe",

0 commit comments

Comments
 (0)