#11 Add productmd-compose schemas and examples
Merged 5 years ago by psss. Opened 5 years ago by lholecek.
fedora-ci/ lholecek/messages add-productmd-compose  into  master

@@ -0,0 +1,30 @@ 

+ {

+   "ci": {

+     "url": "https://somewhere.com",

+     "docs": "https://somewhere.com/user-documentation",

+     "team": "RTT",

+     "email": "rtt@somewhere.com",

+     "name": "RTT CI"

+   },

+   "run": {

+     "url": "https://rtt.somewhere.com/job/compose-RHEL-ALT-7-nightly-tier2-acceptance/arch=aarch64,variant=Server/1/",

+     "log": "https://rtt.somewhere.com/job/compose-RHEL-ALT-7-nightly-tier2-acceptance/arch=aarch64,variant=Server/1/consoleText"

+   },

+   "system": [

+     {

+       "variant": "Server",

+       "architecture": "aarch64",

+       "provider": "beaker"

+     }

+   ],

+   "artifact": {

+     "type": "productmd-compose",

+     "compose_id": "RHEL-ALT-7-20180101.n.0"

+   },

+   "type": "acceptance",

+   "category": "validation",

+   "status": "passed",

+   "namespace": "rtt",

+   "generated_at": "2018-01-01 00:01:00.000000",

+   "version": "0.1.0"

+ }

@@ -0,0 +1,30 @@ 

+ {

+   "ci": {

+     "url": "https://somewhere.com",

+     "docs": "https://somewhere.com/user-documentation",

+     "team": "RTT",

+     "email": "rtt@somewhere.com",

+     "name": "RTT CI"

+   },

+   "run": {

+     "url": "https://rtt.somewhere.com/job/compose-RHEL-ALT-7-nightly-tier2-acceptance/arch=aarch64,variant=Server/2/",

+     "log": "https://rtt.somewhere.com/job/compose-RHEL-ALT-7-nightly-tier2-acceptance/arch=aarch64,variant=Server/2/consoleText"

+   },

+   "system": [

+     {

+       "variant": "Server",

+       "architecture": "aarch64",

+       "provider": "beaker"

+     }

+   ],

+   "artifact": {

+     "type": "productmd-compose",

+     "compose_id": "RHEL-ALT-7-20180102.n.0"

+   },

+   "type": "acceptance",

+   "category": "validation",

+   "reason": "CI pipeline aborted",

+   "namespace": "rtt",

+   "generated_at": "2018-01-01 00:00:02.000000",

+   "version": "0.1.0"

+ }

@@ -0,0 +1,22 @@ 

+ {

+   "ci": {

+     "url": "https://somewhere.com",

+     "docs": "https://somewhere.com/user-documentation",

+     "team": "RTT",

+     "email": "rtt@somewhere.com",

+     "name": "RTT CI"

+   },

+   "run": {

+     "url": "https://rtt.somewhere.com/job/compose-RHEL-ALT-7-nightly-tier2-acceptance/arch=aarch64,variant=Server/1/",

+     "log": "https://rtt.somewhere.com/job/compose-RHEL-ALT-7-nightly-tier2-acceptance/arch=aarch64,variant=Server/1/consoleText"

+   },

+   "artifact": {

+     "type": "productmd-compose",

+     "compose_id": "RHEL-ALT-7-20180101.n.0"

+   },

+   "type": "acceptance",

+   "category": "validation",

+   "namespace": "rtt",

+   "generated_at": "2018-01-01 00:00:00.000000",

+   "version": "0.1.0"

+ }

@@ -0,0 +1,23 @@ 

+ {

+   "ci": {

+     "url": "https://somewhere.com",

+     "docs": "https://somewhere.com/user-documentation",

+     "team": "RTT",

+     "email": "rtt@somewhere.com",

+     "name": "RTT CI"

+   },

+   "run": {

+     "url": "https://rtt.somewhere.com/job/compose-RHEL-ALT-7-nightly-tier2-acceptance/arch=aarch64,variant=Server/1/",

+     "log": "https://rtt.somewhere.com/job/compose-RHEL-ALT-7-nightly-tier2-acceptance/arch=aarch64,variant=Server/1/consoleText"

+   },

+   "artifact": {

+     "type": "productmd-compose",

+     "compose_id": "RHEL-ALT-7-20180101.n.0"

+   },

+   "type": "acceptance",

+   "category": "validation",

+   "namespace": "rtt",

+   "lifetime": 1,

+   "generated_at": "2018-01-01 00:00:01.000000",

+   "version": "0.1.0"

+ }

@@ -0,0 +1,21 @@ 

+ $id: https://pagure.io/fedora-ci/messages/productmd-compose-system

+ $schema: http://json-schema.org/draft-07/schema#

+ 

+ description:

+     Information about the system used for compose testing.

+ 

+ properties:

+     provider:

+         $ref: system.json#properties/provider

+     architecture:

+         $ref: system.json#properties/architecture

+     variant:

+         $ref: system.json#properties/variant

+     label:

+         $ref: system.json#properties/label

+ 

+ required:

+     - provider

+     - architecture

+ 

+ type: object

@@ -0,0 +1,52 @@ 

+ $id: https://pagure.io/fedora-ci/messages/productmd-compose.test.complete

+ $schema: http://json-schema.org/draft-07/schema#

+ 

+ description:

+     Testing of the compose has been completed.

+     This is a mandatory message.

+ 

+ properties:

+     ci:

+         $ref: contact.json

+     run:

+         $ref: run.json

+     artifact:

+         $ref: productmd-compose.json

+     system:

+         type: array

+         items:

+             $ref: productmd-compose-system.json

+     category:

+         $ref: common.json#properties/category

+     type:

+         $ref: common.json#properties/type

+     label:

+         $ref: common.json#properties/label

+     status:

+         $ref: common.json#properties/status

+     recipients:

+         $ref: common.json#properties/recipients

+     thread_id:

+         $ref: common.json#properties/thread_id

+     namespace:

+         $ref: common.json#properties/namespace

+     note:

+         $ref: common.json#properties/note

+     generated_at:

+         $ref: common.json#properties/generated_at

+     version:

+         $ref: common.json#properties/version

+ 

+ required:

+     - ci

+     - run

+     - artifact

+     - system

+     - type

+     - category

+     - status

+     - namespace

+     - generated_at

+     - version

+ 

+ type: object

@@ -0,0 +1,56 @@ 

+ $id: https://pagure.io/fedora-ci/messages/productmd-compose.test.error

+ $schema: http://json-schema.org/draft-07/schema#

+ 

+ description:

+     Testing has aborted, it was not finished, e.g. because of infrastructure

+     error, CI system error, etc. Note that a test failure is not an error.

+     Test failures should be exposed under the productmd-compose.test.error

+     topic. This is a mandatory message.

+ 

+ properties:

+     ci:

+         $ref: contact.json

+     run:

+         $ref: run.json

+     artifact:

+         $ref: productmd-compose.json

+     system:

+         type: array

+         items:

+             $ref: productmd-compose-system.json

+     category:

+         $ref: common.json#properties/category

+     type:

+         $ref: common.json#properties/type

+     label:

+         $ref: common.json#properties/label

+     reason:

+         $ref: common.json#properties/reason

+     issue_url:

+         $ref: common.json#properties/issue_url

+     recipients:

+         $ref: common.json#properties/recipients

+     thread_id:

+         $ref: common.json#properties/thread_id

+     namespace:

+         $ref: common.json#properties/namespace

+     note:

+         $ref: common.json#properties/note

+     generated_at:

+         $ref: common.json#properties/generated_at

+     version:

+         $ref: common.json#properties/version

+ 

+ required:

+     - ci

+     - run

+     - artifact

+     - system

+     - type

+     - category

+     - namespace

+     - reason

+     - generated_at

+     - version

+ 

+ type: object

@@ -0,0 +1,42 @@ 

+ $id: https://pagure.io/fedora-ci/messages/productmd-compose.test.queued

+ $schema: http://json-schema.org/draft-07/schema#

+ 

+ description:

+     Testing has been queued, but not yet started.

+     This is an optional message.

+ 

+ properties:

+     ci:

+         $ref: contact.json

+     run:

+         $ref: run.json

+     artifact:

+         $ref: productmd-compose.json

+     category:

+         $ref: common.json#properties/category

+     type:

+         $ref: common.json#properties/type

+     label:

+         $ref: common.json#properties/label

+     thread_id:

+         $ref: common.json#properties/thread_id

+     namespace:

+         $ref: common.json#properties/namespace

+     note:

+         $ref: common.json#properties/note

+     generated_at:

+         $ref: common.json#properties/generated_at

+     version:

+         $ref: common.json#properties/version

+ 

+ required:

+     - ci

+     - run

+     - artifact

+     - type

+     - category

+     - namespace

+     - generated_at

+     - version

+ 

+ type: object

@@ -0,0 +1,46 @@ 

+ $id: https://pagure.io/fedora-ci/messages/productmd-compose.test.running

+ $schema: http://json-schema.org/draft-07/schema#

+ 

+ description:

+     Testing has been started and is in progress.

+     This is an optional message.

+ 

+ properties:

+     ci:

+         $ref: contact.json

+     run:

+         $ref: run.json

+     artifact:

+         $ref: productmd-compose.json

+     category:

+         $ref: common.json#properties/category

+     type:

+         $ref: common.json#properties/type

+     label:

+         $ref: common.json#properties/label

+     lifetime:

+         $ref: common.json#properties/lifetime

+     thread_id:

+         $ref: common.json#properties/thread_id

+     namespace:

+         $ref: common.json#properties/namespace

+     note:

+         $ref: common.json#properties/note

+     progress:

+         $ref: common.json#properties/progress

+     generated_at:

+         $ref: common.json#properties/generated_at

+     version:

+         $ref: common.json#properties/version

+ 

+ required:

+     - ci

+     - run

+     - artifact

+     - type

+     - category

+     - namespace

+     - generated_at

+     - version

+ 

+ type: object

@@ -0,0 +1,26 @@ 

+ $id: https://pagure.io/fedora-ci/messages/productmd-compose

+ $schema: http://json-schema.org/draft-07/schema#

+ 

+ description:

+     Details about the compose being tested.

+ 

+ properties:

+     type:

+         description:

+             Artifact type, in this case 'productmd-compose'.

+         enum:

+             - productmd-compose

+         type: string

+     compose_id:

+         description:

+           ID of the compose as recorded in the productmd metadata

+           (payload.compose.id field inside the metadata/composeinfo.json file)

+         examples:

+             - RHEL-7.4-20180531.2

+         type: string

+ 

+ required:

+     - type

+     - compose_id

+ 

+ type: object

no initial comment

Metadata Update from @psss:
- Request assigned

5 years ago

I think we recently added required docs field

Thanks for the pull request. A couple of comments:

In the productmd-compose.test.running example I've noticed you have status field included as well. Is that intentional? I'd expect status makes only sense in the complete message. Also spec does not mention it.

I see you introduce a new schema productmd-compose-ci. This seems to be very similar to the contact schema which has been recently renamed from ci to share this type of information across different messages. Could you please review whether it could be used for your use case as well? In this way we would save some future maintenance.

We've also introduced a new progress field for the running messages. You might consider adding this optional field to your spec as well.

In the productmd-compose.test.running example I've noticed you have status field included as well. Is that intentional? I'd expect status makes only sense in the complete message. Also spec does not mention it.

Nope. Copy pasta issue (I could only find existing messages for the competed topic).

I see you introduce a new schema productmd-compose-ci. This seems to be very similar to the contact schema which has been recently renamed from ci to share this type of information across different messages. Could you please review whether it could be used for your use case as well? In this way we would save some future maintenance.

There are some differences. For productmd-compose messages ci doesn't contain docs and environment. Is it OK to change? Anyone sending these messages should add missing required field.

We've also introduced a new progress field for the running messages. You might consider adding this optional field to your spec as well.

Same question.

There are some differences. For productmd-compose messages ci doesn't contain docs and environment. Is it OK to change? Anyone sending these messages should add missing required field.

Yes, contact schema now contains a new required field docs which should point to the documentation about the ci system, which can be very useful when linking results for example from Pagure. I would suggest you use the contact schema and include link to your documentation if you don't mind adding this extra field. Regarding the environment, this is an optional field so you do not have to include it in your messages.

We've also introduced a new progress field for the running messages. You might consider adding this optional field to your spec as well.

Same question.

If you do not have a use case for the progress field, just omit it in the messages (and spec). As I mentioned it is optional. Just wanted to point out it has been added just recently so you might have missed it.

The main point is: You can "fork" the contact schema into a separate productmd-compose-ci schema, it depends on what you choose. We just suggest to re-use existing schemas wherever possible which leads to more consistence across messages and less maintenance.

Removed status from the example for productmd-compose.test.running message.

Removed productmd-compose-ci schema and use contact instead.

Added progress to productmd-compose.test.running. (It would be nice to have some inheritance for different message types.)

rebased onto 6d776a1

5 years ago

Removed status from the example for productmd-compose.test.running message.
Removed productmd-compose-ci schema and use contact instead.
Added progress to productmd-compose.test.running.

Great! Thanks for the update.

It would be nice to have some inheritance for different message types.

Agreed. We could possibly use anyof and allof and combine several subschemas but I'm a bit concerned about readability of such specification.

Pull-Request has been merged by psss

5 years ago