Skip to content

Commit 1fed68c

Browse files
authored
Transfer wiki pages from git wiki to main repo (#193)
* Transfer wiki pages from git wiki to main repo
1 parent a13c37c commit 1fed68c

30 files changed

+5135
-2
lines changed

README.md

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
# Eiffel Intelligence
2525
Eiffel Intelligence is a real time data aggregation and analysis solution for Eiffel events. While Eiffel represents an event based architecture, Eiffel Intelligence addresses the need of stakeholders to view the current state of the system by bridging the divide from immutable events to mutable state representation.
2626

27-
## Detailed documentation is provided in [the repository wiki](../../wiki).
28-
2927
# About this repository
3028
The contents of this repository are licensed under the [Apache License 2.0](./LICENSE).
3129

@@ -35,3 +33,62 @@ To get involved, please see [Code of Conduct](./CODE_OF_CONDUCT.md) and [contrib
3533
This repository forms part of the Eiffel Community. Eiffel is a protocol for technology agnostic machine-to-machine communication in continuous integration and delivery pipelines, aimed at securing scalability, flexibility and traceability. Eiffel is based on the concept of decentralized real time messaging, both to drive the continuous integration and delivery system and to document it.
3634

3735
Visit [Eiffel Community](https://eiffel-community.github.io) to get started and get involved.
36+
37+
# Documentation
38+
39+
1. [**Configuration**](./wiki/Configuration.md)
40+
1. [**Running Eiffel Intelligence**](./wiki/Running-Eiffel-Intelligence.md)
41+
- [**Prerequisites**](./wiki/Running-Eiffel-Intelligence.md#Prerequisites)
42+
1. [**REST API**](./wiki/REST-API.md)
43+
- [**Query aggregated objects**](./wiki/Query.md)
44+
- [**Perform query on created aggregated object**](./wiki/Query.md#Perform-query-on-created-aggregated-object)
45+
- [**Perform freestyle query on created aggregated object**](./wiki/Query.md#Perform-freestyle-query-on-created-aggregated-object)
46+
- [**Query an aggregated object and filter it with specific key**](./wiki/Query.md#Query-an-aggregated-object-and-filter-it-with-specific-key)
47+
- [**Query missed notifications**](./wiki/Query.md#Query-missed-notifications)
48+
- [**Running rules on objects**](./wiki/Running-rules-on-objects.md)
49+
- [**Test JMESPath expression on given Event**](./wiki/Running-rules-on-objects.md#Test-JMESPath-expression-on-given-Event)
50+
- [**Test a list of rule sets on given list of events**](./wiki/Running-rules-on-objects.md#Test-a-list-of-rule-sets-on-given-list-of-events)
51+
- [**Authentication**](./wiki/Authentication.md)
52+
- [**Check if security is enabled**](./wiki/Authentication.md#Check-if-security-is-enabled)
53+
- [**Login point that returns the name of current user**](./wiki/Authentication.md#Login-point-that-returns-the-name-of-current-user)
54+
- [**Delete session of current user**](./wiki/Authentication.md#Delete-session-of-current-user)
55+
- [**Check if backend is running**](./wiki/Authentication.md#Check-if-backend-is-running)
56+
- [**Subscriptions**](./wiki/Subscription-API.md)
57+
- [**Create subscriptions**](./wiki/Subscription-API.md#Create-subscriptions)
58+
- [**Get subscriptions for the given names**](./wiki/Subscription-API.md#Get-subscriptions-for-the-given-names)
59+
- [**Update subscriptions**](./wiki/Subscription-API.md#Update-subscriptions)
60+
- [**Delete subscriptions for the given names**](./wiki/Subscription-API.md#Delete-subscriptions-for-the-given-names)
61+
- [**Get all subscriptions**](./wiki/Subscription-API.md#Get-all-subscriptions)
62+
- [**Download files**](./wiki/Download-Files.md)
63+
- [**List available files**](./wiki/Download-Files.md#List-available-files)
64+
- [**Download subscription template file**](./wiki/Download-Files.md#Download-subscription-template-file)
65+
- [**Download rules template file**](./wiki/Download-Files.md#Download-rules-template-file)
66+
- [**Download events template file**](./wiki/Download-Files.md#Download-events-template-file)
67+
1. [**Rules**](./wiki/Rules.md)
68+
- [**Introduction**](./wiki/Rules.md#Introduction)
69+
- [**Rule set up**](./wiki/Rules.md#Rule-set-up)
70+
- [**Existing rules files**](./wiki/Rules.md#Existing-rules-files)
71+
- [**MergeResolverRules**](./wiki/MergeResolverRules.md)
72+
- [**Example 1**](./wiki/MergeResolverRules.md#Example-1)
73+
- [**Example 2 - array aggregations**](./wiki/MergeResolverRules.md#Example-2---array-aggregations)
74+
- [**History Rules**](./wiki/History-rules.md)
75+
1. [**Test Rules User Guide**](./wiki/TestRulesUserGuide.md)
76+
- [**Rule testing mechanism via "Test Rules" GUI interface**](./wiki/TestRulesUserGuide.md#Rule-testing-mechanism-via-Test-Rules-GUI-interface)
77+
- [**Introduction**](./wiki/TestRulesUserGuide.md#Introduction)
78+
- [**Aggregated object**](./wiki/TestRulesUserGuide.md#Aggregated-object)
79+
- [**Rule set up**](./wiki/TestRulesUserGuide.md#Rule-set-up)
80+
- [**The most common operation you would do**](./wiki/TestRulesUserGuide.md#The-most-common-operation-you-would-do)
81+
1. [**Subscriptions**](./wiki/Subscriptions.md)
82+
- [**REST POST notification**](./wiki/REST-POST-notification.md)
83+
- [**Email notification**](./wiki/Email-notification.md)
84+
1. [**Known limitations**](./wiki/Known-limitations.md)
85+
1. [**Step by Step Aggregation**](./wiki/Step-by-Step-Aggregation.md)
86+
- [**ArtifactCreatedEvent Aggregation**](./wiki/ArtifactCreatedEvent-aggregation.md)
87+
- [**EiffelTestCaseTriggeredEvent Aggregation**](./wiki/EiffelTestCaseTriggeredEvent-Aggregation.md)
88+
- [**EiffleTestCaseStartedEvent Aggregation**](./wiki/EiffleTestCaseStartedEvent-aggregation.md)
89+
- [**EiffleTestCaseFinishedEvent Aggregation**](./wiki/EiffleTestCaseFinishedEvent-aggregation.md)
90+
- [**EiffelArtifactPublishedEvent Aggregation**](./wiki/EiffelArtifactPublishedEvent-Aggregation.md)
91+
- [**EiffelConfidenceLevelModifiedEvent Aggregation**](./wiki/EiffelConfidenceLevelModifiedEvent-Aggregation.md)
92+
1. [**Step by Step Subscription Notification**](./wiki/Step-by-Step-Subscription-Notification.md)
93+
94+
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# ArtifactCreatedEvent Aggregation
2+
3+
Suppose, we publish an “EiffelArtifactCreatedEvent” (given below) on the message bus.
4+
5+
{
6+
"meta": {
7+
"time": 1473177136433,
8+
"source": {
9+
"domainId": "example.domain"
10+
},
11+
"type": "EiffelArtifactCreatedEvent",
12+
"id": "ccce572c-c364-441e-abc9-b62fed080ca2",
13+
"version": "1.0.0"
14+
},
15+
"links": [{
16+
"target": "23df3bd2-c620-42ce-80ba-b7ba6551c9f9",
17+
"type": "COMPOSITION"
18+
},
19+
{
20+
"target": "9ace5eea-3547-45f6-be4d-25b43d87e6dc",
21+
"type": "ENVIRONMENT"
22+
},
23+
{
24+
"target": "51601fdb-db7c-4b3f-862e-da1154e4ae96",
25+
"type": "PREVIOUS_VERSION"
26+
},
27+
{
28+
"target": "51c77087-74e2-449f-9def-00acd5e2c944",
29+
"type": "CONTEXT"
30+
}
31+
],
32+
"data": {
33+
"customData": [{
34+
"value": "ArtC2",
35+
"key": "name"
36+
},
37+
{
38+
"value": 53,
39+
"key": "iteration"
40+
}
41+
],
42+
"fileInformation": [{
43+
"extension": "jar",
44+
"classifier": "debug"
45+
},
46+
{
47+
"extension": "",
48+
"classifier": "test"
49+
},
50+
{
51+
"extension": "exe",
52+
"classifier": ""
53+
}
54+
],
55+
"gav": {
56+
"version": "1.53.0",
57+
"artifactId": "sub-system",
58+
"groupId": "com.mycompany.myproduct"
59+
}
60+
}
61+
}
62+
63+
64+
When this message is received at EI, processing begins for possible aggregation and notification. In the next step rules object for the message is extracted. The rules object is a set of rules in JSON format that helps extract required information from an event by using JMESPath API (for more information about the EI rules follow this [link](./Rules.md)). From the rules object, “IdentifyRules” is extracted which is a JMESPath identifier of ids and will be used to search for all existing aggregated objects linked to the event under process. Here it should be noted that rules object path is configured in the application.properties file as “rules.path”.
65+
66+
**Rule object extracted from the event under consideration:**
67+
68+
{
69+
"TemplateName": "ARTIFACT_1",
70+
"Type": "EiffelArtifactCreatedEvent",
71+
"TypeRule": "meta.type",
72+
"IdRule": "meta.id",
73+
"StartEvent": "YES",
74+
"IdentifyRules": "[meta.id]",
75+
"MatchIdRules": {
76+
"_id": "%IdentifyRules_objid%"
77+
},
78+
"ExtractionRules": "{ id : meta.id, type : meta.type, time : meta.time, gav : data.gav, fileInformation : data.fileInformation, buildCommand : data.buildCommand }",
79+
"DownstreamIdentifyRules": "links | [?type=='COMPOSITION'].target",
80+
"DownstreamMergeRules": "{\"externalComposition\":{\"eventId\":%IdentifyRules%}}",
81+
"DownstreamExtractionRules": "{artifacts: [{id : meta.id}]}",
82+
"HistoryIdentifyRules": "links | [?type=='COMPOSITION'].target",
83+
"HistoryExtractionRules": "{id : meta.id, gav : data.gav, fileInformation : data.fileInformation}",
84+
"HistoryPathRules": "{artifacts: [{id: meta.id}]}",
85+
"ProcessRules": null,
86+
"ProcessFunction": null
87+
}
88+
89+
If no event-linked aggregated object is found, then next step is to check whether the given event is a “start event”. It should be clear that, term “start event” means that the event might be starting a new flow and therefore, a new aggregated object may be created out of this. If the current event is not a “start event” then it is stored in the database. The name of the collection is configured in the application.properties file as “waitlist.collection.name”. The event is stored with the aim that if an aggregated object is created later with links to this specific event then it can be merged with that object. The event storage life time is set in the properties file as “waitlist.collection.ttlValue”.
90+
91+
Otherwise, If the event is a start event (as is the current event) then the next step is information extraction from the event and adding into the aggregated object. It should be noted that this event has no links to any aggregated object. However, as it is a start event so a new aggregated object is created by extracting information from this event.
92+
93+
**Information Extraction from an Event:** In this step, information from a given event is extracted. This information will then be added into a relevant aggregated object. This is what the term aggregation comes from. What information is extracted from a given event is encoded in the extraction rules. Extraction rules are represented in the rules object with a key named “ExtractionRules”. For example, for the current event and rule object, following information will be extracted:
94+
95+
{
96+
"id": "ccce572c-c364-441e-abc9-b62fed080ca2",
97+
"type": "EiffelArtifactCreatedEvent",
98+
"time": 1473177136433,
99+
"gav": {
100+
"version": "1.53.0",
101+
"artifactId": "sub-system",
102+
"groupId": "com.mycompany.myproduct"
103+
},
104+
"fileInformation": [{
105+
"extension": "jar",
106+
"classifier": "debug"
107+
}, {
108+
"extension": "",
109+
"classifier": "test"
110+
}, {
111+
"extension": "exe",
112+
"classifier": ""
113+
}],
114+
"buildCommand": null
115+
}
116+
117+
Once the information extraction is complete, the next processing steps are different for start events (an event with no linked aggregated object) and events with link to an associated aggregated object. For start event, an object is created out of the extracted content and inserted into the database, with a name configured in the properties file as “aggregated.collection.name”. The next step is to query the database for all the upstream linked objects for this event. Then each of the linked object is processed individually. For each object, its rule object field “HistoryExtractionRules” is used to extract contents from it and merge with the aggregated object. More about the “HistoryExtractionRules” can be found [here](./Rules.md). Finally, the modified aggregated object is updated in the database.
118+
119+
On the other hand, If the event is linked to aggregated object(s) then each of the aggregated object is processed together with this event. The contents of the event to be merged into the aggregated object are extracted and added to the aggregated object using “MergeResolverRules”. More about “MergeResolverRules” can be found [here](./Rules.md). Next, “ProcessRules” (if exist) are applied on the aggregated object and the resulting modified aggregated object is updated in the database.

wiki/Authentication.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Authentication
2+
3+
|Method|Endpoint |Authentication|
4+
|------|-----------------|--------------|
5+
|GET |/auth |no |
6+
|GET |/auth/login |yes |
7+
|GET |/auth/logout |no |
8+
|GET |/auth/checkStatus|yes |
9+
10+
Authentication is not a requirement but can be turned on and off in the application properties file with the '_ldap.enabled_' property.
11+
12+
## Check if security is enabled
13+
14+
Returns the json variable '_security_' that is set to either true or false
15+
16+
GET /auth
17+
18+
Curl command
19+
20+
curl -X GET -H "Content-type: application/json" http://<host>:8090/auth
21+
22+
Example of response body
23+
24+
{"security":true}
25+
26+
## Login point that returns the name of current user
27+
28+
Upon the first time valid credentials are used the response will contain an 'X-Auth-Token' header that must be saved and attached to any following calls to endpoints that require authentication. If the same client connection is used then session cookie is used to authenticate and 'X-Auth-Token' would not be needed in that case.
29+
30+
GET /auth/login
31+
32+
Curl command
33+
34+
curl -X GET -H "Content-type: application/json" -u <username>:<password> http://<host>:8090/auth/login
35+
36+
Example of full response
37+
38+
````
39+
< HTTP/1.1 200
40+
< X-Content-Type-Options: nosniff
41+
< X-XSS-Protection: 1; mode=block
42+
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
43+
< Pragma: no-cache
44+
< Expires: 0
45+
< X-Frame-Options: DENY
46+
< X-Auth-Token: 791541ad-67aa-4630-9698-66638e6987c2
47+
< Set-Cookie: SESSION=NzkxNTQxYWQtNjdhYS00NjMwLTk2OTgtNjY2MzhlNjk4N2My; Path=/; HttpOnly
48+
< Content-Type: application/json;charset=UTF-8
49+
< Content-Length: 16
50+
< Date: Wed, 15 Aug 2018 10:58:23 GMT
51+
<
52+
* Connection #0 to host localhost left intact
53+
{"user":"myuser"}
54+
````
55+
56+
## Delete session of current user
57+
58+
Removes the current session bound to the client. If 'X-Auth-Token' is used to authenticate then the same token needs to be attached when calling the logout endpoint.
59+
60+
GET /auth/logout
61+
62+
Curl command with session cookie
63+
64+
curl -X GET -H "Content-type: application/json" http://<host>:8090/auth/logout
65+
66+
Curl command with token
67+
68+
curl -X GET -H "Content-type: application/json" -H "X-Auth-Token: <uuid>" http://<host>:8090/auth/logout
69+
70+
## Check if backend is running
71+
72+
An arbitrary endpoint to check if backend is up and running
73+
74+
GET /auth/checkStatus
75+
76+
Curl command
77+
78+
curl -X GET -H "Content-type: application/json" http://<host>:8090/auth/checkStatus
79+
80+
Example of response body
81+
82+
Backend server is up and running

wiki/Configuration.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Configuration
2+
3+
Address and port for message buss and MongoDB needs to be configured in [application.properties](https://github.com/Ericsson/eiffel-intelligence/blob/master/src/main/resources/application.properties) for the application to run properly.
4+
5+
Each property is explained in the file so open the properties file for a view on properties role.

wiki/Download-Files.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Download Files
2+
3+
Via this RestApi user can download EI templates files.
4+
5+
These entrypoint exits today:
6+
7+
|Method|Endpoint |Comment |
8+
|------|--------------------------------|-------------------------------------------|
9+
|GET |/download |List available files that can be downloaded|
10+
|GET |/download/subscriptionsTemplate |Returns subscription template file|
11+
|GET |/download/rulesTemplate |Returns rules template file|
12+
|GET |/download/eventsTemplate |Returns events template file|
13+
14+
15+
## List available files
16+
17+
GET /download
18+
19+
Curl command
20+
21+
curl -X GET -H "Content-type: application/json" http://<host>:8090/download
22+
23+
## Download subscription template file
24+
25+
GET /download/subscriptionsTemplate
26+
27+
Curl command
28+
29+
curl -X GET -H "Content-type: application/json" http://<host>:8090/download/subscriptionsTemplate
30+
31+
## Download rules template file
32+
33+
GET /download/rulesTemplate
34+
35+
Curl command
36+
37+
curl -X GET -H "Content-type: application/json" http://<host>:8090/download/rulesTemplate
38+
39+
## Download events template file
40+
41+
GET /download/eventsTemplate
42+
Curl command
43+
44+
curl -X GET -H "Content-type: application/json" http://<host>:8090/download/eventsTemplate

0 commit comments

Comments
 (0)