From 7b721181f32994377a72be29511ee1d377c7ab02 Mon Sep 17 00:00:00 2001 From: DivyangRaval Date: Aug 13 2020 13:53:25 +0000 Subject: [PATCH 1/3] ResultDB UpdaterV2 Mapping Directory added along with component-version.test.complete.yaml & README --- diff --git a/README.md b/README.md index 86c7b05..9db3c17 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ - CI Messages =========== @@ -38,6 +37,8 @@ script to ensure your `message.json` file has proper format: make convert ./scripts/validate.py schemas/brew-build.test.complete.json message.json +**Note**: Release tag 1.x.x onward all messages will be validated against scheme before updating the ResultsDB, + and invalid messges will not be processed. Examples -------- @@ -113,9 +114,7 @@ Message Anatomy All data should be stored in the body of the message. Additional fields can be added to the messages as required by the senders, although it is advised to document them here. - Syntax requirements for field names: - * Use only characters `[a-z0-9_]` * No spaces are allowed in the name of the field * For separation of multi-word strings in field names use the @@ -128,6 +127,38 @@ Syntax requirements for field values: e.g. recipients: ["mvadkert", "optak"]. In case of an empty field, this needs to be and empty list: [] +ResultsDB-Updater V2 Mappings +------------------------------ +All the messages with version:1.x.x onward will be Processed by ResultsDB-Updater V2 logic. +Mappings are stored in `/mappings` directory and its tightly coupled with schemas. +These mappings are used to transform the messages into ResultsDB format. + +Syntax requirements for `/mappings` directory: + + * Only .yaml files supported for `/mappings` directory. + * File name should match with `/schemas` file name. + * Mapping file format/syntex should be driven from ResultsDB [Attributes][resultsDB] + +Headers & Body Supported for `/mappings` files: + +Headers will contain pre-processed metadata. +i.e. UMB = /topic/VirtualTopic.eng.ci.... + + * headers.ciNamespace + * headers.ciArtifact + * headers.ciEvent + * headers.ciStatus + * headers.ciFullEvent : value as ciEvent.ciStatus + * headers.ciComputedStatus : Computes status value based on ciStatus + * headers.uuid : uuid generated for individual message + * Body will be root elment to access all message content. + e.g. body.test.result will resolve to test.result value. + * Inorder to evalute the header and body expressions it shold be enclosed with "${}". + e.g. "${body.test.result}" + * status vs computed-status mapping as follows: + + error >> ERROR , queued >> QUEUED , running >> RUNNING + pass >> PASSED , failed >> FAILED , failure >> FAILED Licensing --------- @@ -148,3 +179,4 @@ Links [js]: http://json-schema.org/ [fedmsg]: https://fedmsg2.readthedocs.io/en/latest/topics.html [CC-BY]: http://creativecommons.org/licenses/by/4.0/ +[resultsDB]: https://resultsdb20.docs.apiary.io/#reference/0/result-groups/create-new-result diff --git a/mappings/component-version.test.complete.yaml b/mappings/component-version.test.complete.yaml new file mode 100644 index 0000000..2aa557f --- /dev/null +++ b/mappings/component-version.test.complete.yaml @@ -0,0 +1,23 @@ +# Resultsdb Updater V2 Mapping, Supported for release Tag 1.x.x onwards. + +outcome: "${body.test.result}" +testcase: + name: "${body.test.namespace}-${body.test.type}-${body.test.category}" + ref_url: "${body.run.url}" +groups: + - uuid: "${headers.uuid}" + url: "${body.run.url}" +ref_url: "${body.artifact.source}" +data: + item: + - "${body.artifact.component}-${body.artifact.version}" + log: + - "${body.run.log}" + type: + - "${body.artifact.type}" + component: + - "${body.artifact.component}" + version: + - "${body.artifact.version}" + category: + - "${body.test.category}" From 6f3fea85851d32d26f72b172f0ebf0cc8371d794 Mon Sep 17 00:00:00 2001 From: DivyangRaval Date: Aug 18 2020 15:59:13 +0000 Subject: [PATCH 2/3] Addressed Review Comments for README File --- diff --git a/README.md b/README.md index 9db3c17..84c61bd 100644 --- a/README.md +++ b/README.md @@ -129,17 +129,17 @@ Syntax requirements for field values: ResultsDB-Updater V2 Mappings ------------------------------ -All the messages with version:1.x.x onward will be Processed by ResultsDB-Updater V2 logic. -Mappings are stored in `/mappings` directory and its tightly coupled with schemas. -These mappings are used to transform the messages into ResultsDB format. +All the messages with version:1.x.x onward will be processed by ResultsDB-Updater V2 logic. +Mappings are stored in the `/mappings` directory and are tightly coupled with the schemas. +These mappings are used to transform the messages into the ResultsDB format. Syntax requirements for `/mappings` directory: * Only .yaml files supported for `/mappings` directory. - * File name should match with `/schemas` file name. - * Mapping file format/syntex should be driven from ResultsDB [Attributes][resultsDB] + * Filename should match with `/schemas` filename. + * Mapping file format/syntax should be driven from the ResultsDB [Attributes][resultsDB] -Headers & Body Supported for `/mappings` files: +Headers & Body supported for `/mappings` files: Headers will contain pre-processed metadata. i.e. UMB = /topic/VirtualTopic.eng.ci.... @@ -149,14 +149,14 @@ i.e. UMB = /topic/VirtualTopic.eng.ci....> ERROR , queued >> QUEUED , running >> RUNNING pass >> PASSED , failed >> FAILED , failure >> FAILED From 99dc926dad439a16681c70ab924bdc6a3c2d0e7b Mon Sep 17 00:00:00 2001 From: DivyangRaval Date: Aug 24 2020 06:44:58 +0000 Subject: [PATCH 3/3] Moved resultsdb mapping files under /mappings/results Directory --- diff --git a/README.md b/README.md index 84c61bd..2b2836a 100644 --- a/README.md +++ b/README.md @@ -130,16 +130,16 @@ Syntax requirements for field values: ResultsDB-Updater V2 Mappings ------------------------------ All the messages with version:1.x.x onward will be processed by ResultsDB-Updater V2 logic. -Mappings are stored in the `/mappings` directory and are tightly coupled with the schemas. +Mappings are stored in the `/mappings/results` directory and are tightly coupled with the schemas. These mappings are used to transform the messages into the ResultsDB format. -Syntax requirements for `/mappings` directory: +Syntax requirements for `/mappings/results` directory: - * Only .yaml files supported for `/mappings` directory. + * Only .yaml files supported for `/mappings/results` directory. * Filename should match with `/schemas` filename. * Mapping file format/syntax should be driven from the ResultsDB [Attributes][resultsDB] -Headers & Body supported for `/mappings` files: +Headers & Body supported for `/mappings/results/*` files: Headers will contain pre-processed metadata. i.e. UMB = /topic/VirtualTopic.eng.ci.... diff --git a/mappings/component-version.test.complete.yaml b/mappings/component-version.test.complete.yaml deleted file mode 100644 index 2aa557f..0000000 --- a/mappings/component-version.test.complete.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# Resultsdb Updater V2 Mapping, Supported for release Tag 1.x.x onwards. - -outcome: "${body.test.result}" -testcase: - name: "${body.test.namespace}-${body.test.type}-${body.test.category}" - ref_url: "${body.run.url}" -groups: - - uuid: "${headers.uuid}" - url: "${body.run.url}" -ref_url: "${body.artifact.source}" -data: - item: - - "${body.artifact.component}-${body.artifact.version}" - log: - - "${body.run.log}" - type: - - "${body.artifact.type}" - component: - - "${body.artifact.component}" - version: - - "${body.artifact.version}" - category: - - "${body.test.category}" diff --git a/mappings/results/component-version.test.complete.yaml b/mappings/results/component-version.test.complete.yaml new file mode 100644 index 0000000..2aa557f --- /dev/null +++ b/mappings/results/component-version.test.complete.yaml @@ -0,0 +1,23 @@ +# Resultsdb Updater V2 Mapping, Supported for release Tag 1.x.x onwards. + +outcome: "${body.test.result}" +testcase: + name: "${body.test.namespace}-${body.test.type}-${body.test.category}" + ref_url: "${body.run.url}" +groups: + - uuid: "${headers.uuid}" + url: "${body.run.url}" +ref_url: "${body.artifact.source}" +data: + item: + - "${body.artifact.component}-${body.artifact.version}" + log: + - "${body.run.log}" + type: + - "${body.artifact.type}" + component: + - "${body.artifact.component}" + version: + - "${body.artifact.version}" + category: + - "${body.test.category}"