Skip to content

Commit

Permalink
Add more conversion fields to schema
Browse files Browse the repository at this point in the history
The change follows up on the rh_cloud plugin sending more conversion
facts to Insights.

Related: theforeman/foreman_rh_cloud#914
  • Loading branch information
bocekm committed Nov 7, 2024
1 parent 7f5aff3 commit 1b6f7ca
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 6 deletions.
57 changes: 54 additions & 3 deletions schemas/system_profile/v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -769,9 +769,60 @@ $defs:
type: object
properties:
activity:
description: Whether the conversion activity has been done or not
type: boolean
example: true
description: 'conversion' for an attempted conversion to RHEL and 'analysis' for an attempted pre-conversion analysis
type: string
example: "conversion, analysis"
activity_started:
description: UTC timestamp of when the activity started
type: string
example: "2024-07-11T17:28:54.281664Z"
activity_ended:
description: UTC timestamp of when the activity started
type: string
example: "2024-07-11T17:48:47.026664Z"
success:
description: Whether the activity has finished successfully or not
type: string
# Ideally should have been boolean - discussed under https://github.com/RedHatInsights/inventory-schemas/pull/129
example: "true, false"
source_os:
description: Name and version of the Linux distribution that's being converted to RHEL
type: object
properties:
name:
description: Name of the Linux distribution that's being converted to RHEL
type: string
example: "AlmaLinux, Oracle Linux"
version:
description: Version of the Linux distribution that's being converted to RHEL
type: string
example: "8.10"
target_os:
description: Name and version of RHEL to which the system is being converted to
type: object
properties:
name:
description: Target Linux distribution
type: string
example: "Red Hat Enterprise Linux"
version:
description: What version of RHEL the system is being converted to
type: string
example: "8.10"
convert2rhel_through_foreman:
description: Whether the activity has been performed using a Red Hat Satellite conversion job template. If not the property is not present.
type: integer
format: int16
minimum: 1
maximum: 1
packages_0_nevra:
description: convert2rhel rpm name, epoch, version, release, and architecture
type: string
example: "convert2rhel-0:2.0.0-1.el8.noarch"
packages_0_signature:
description: The convert2rhel rpm signature
type: string
example: "RSA/SHA256, Thu May 30 13:31:33 2024, Key ID 199e2f91fd431d51"
rhel_ai:
description: Object containing information about RHEL AI
type: object
Expand Down
16 changes: 14 additions & 2 deletions tests/utils/invalids.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,20 @@
"version": "x" * 35,
}},
{"system_update_method": "inv_method"},
{"conversions": { # Must be a boolean, not a string
"activity": "wrong"
{"conversions": { # The activity must be either "conversion" or "analysis"
"activity": true,
}},
{"conversions": {
"source_os": { # The version must be a string
"name": "AlmaLinux",
"version": 8.10
},
}},
{"conversions": { # Currently must be a "true" or "false" string.
"success": false
}},
{"conversions": { # Must be an integer with value 1
"convert2rhel_through_foreman": true,
}},
{"rhel_ai": { # Must be a string, not a number
"variant": "RHEL AI",
Expand Down
16 changes: 15 additions & 1 deletion tests/utils/valids.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,21 @@
}},
{"system_update_method": "yum"},
{"conversions": {
"activity": True
"source_os": {
"name": "AlmaLinux",
"version": "8.10"
},
"target_os": {
"name": "Red Hat Enterprise Linux",
"version": "8.10"
},
"convert2rhel_through_foreman": 1,
"activity": "conversion",
"packages_0_nevra": "convert2rhel-0:2.0.0-1.el8.noarch",
"packages_0_signature": "RSA/SHA256, Thu May 30 13:31:33 2024, Key ID 199e2f91fd431d51",
"activity_started": "2024-07-11T17:28:54.281664Z",
"activity_ended": "2024-07-11T17:48:47.026664Z",
"success": "true"
}},
{"rhel_ai": {
"variant": "RHEL AI",
Expand Down

0 comments on commit 1b6f7ca

Please sign in to comment.