Skip to content

Commit 1b6f7ca

Browse files
committed
Add more conversion fields to schema
The change follows up on the rh_cloud plugin sending more conversion facts to Insights. Related: theforeman/foreman_rh_cloud#914
1 parent 7f5aff3 commit 1b6f7ca

File tree

3 files changed

+83
-6
lines changed

3 files changed

+83
-6
lines changed

schemas/system_profile/v1.yaml

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -769,9 +769,60 @@ $defs:
769769
type: object
770770
properties:
771771
activity:
772-
description: Whether the conversion activity has been done or not
773-
type: boolean
774-
example: true
772+
description: 'conversion' for an attempted conversion to RHEL and 'analysis' for an attempted pre-conversion analysis
773+
type: string
774+
example: "conversion, analysis"
775+
activity_started:
776+
description: UTC timestamp of when the activity started
777+
type: string
778+
example: "2024-07-11T17:28:54.281664Z"
779+
activity_ended:
780+
description: UTC timestamp of when the activity started
781+
type: string
782+
example: "2024-07-11T17:48:47.026664Z"
783+
success:
784+
description: Whether the activity has finished successfully or not
785+
type: string
786+
# Ideally should have been boolean - discussed under https://github.com/RedHatInsights/inventory-schemas/pull/129
787+
example: "true, false"
788+
source_os:
789+
description: Name and version of the Linux distribution that's being converted to RHEL
790+
type: object
791+
properties:
792+
name:
793+
description: Name of the Linux distribution that's being converted to RHEL
794+
type: string
795+
example: "AlmaLinux, Oracle Linux"
796+
version:
797+
description: Version of the Linux distribution that's being converted to RHEL
798+
type: string
799+
example: "8.10"
800+
target_os:
801+
description: Name and version of RHEL to which the system is being converted to
802+
type: object
803+
properties:
804+
name:
805+
description: Target Linux distribution
806+
type: string
807+
example: "Red Hat Enterprise Linux"
808+
version:
809+
description: What version of RHEL the system is being converted to
810+
type: string
811+
example: "8.10"
812+
convert2rhel_through_foreman:
813+
description: Whether the activity has been performed using a Red Hat Satellite conversion job template. If not the property is not present.
814+
type: integer
815+
format: int16
816+
minimum: 1
817+
maximum: 1
818+
packages_0_nevra:
819+
description: convert2rhel rpm name, epoch, version, release, and architecture
820+
type: string
821+
example: "convert2rhel-0:2.0.0-1.el8.noarch"
822+
packages_0_signature:
823+
description: The convert2rhel rpm signature
824+
type: string
825+
example: "RSA/SHA256, Thu May 30 13:31:33 2024, Key ID 199e2f91fd431d51"
775826
rhel_ai:
776827
description: Object containing information about RHEL AI
777828
type: object

tests/utils/invalids.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,20 @@
366366
"version": "x" * 35,
367367
}},
368368
{"system_update_method": "inv_method"},
369-
{"conversions": { # Must be a boolean, not a string
370-
"activity": "wrong"
369+
{"conversions": { # The activity must be either "conversion" or "analysis"
370+
"activity": true,
371+
}},
372+
{"conversions": {
373+
"source_os": { # The version must be a string
374+
"name": "AlmaLinux",
375+
"version": 8.10
376+
},
377+
}},
378+
{"conversions": { # Currently must be a "true" or "false" string.
379+
"success": false
380+
}},
381+
{"conversions": { # Must be an integer with value 1
382+
"convert2rhel_through_foreman": true,
371383
}},
372384
{"rhel_ai": { # Must be a string, not a number
373385
"variant": "RHEL AI",

tests/utils/valids.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,21 @@
186186
}},
187187
{"system_update_method": "yum"},
188188
{"conversions": {
189-
"activity": True
189+
"source_os": {
190+
"name": "AlmaLinux",
191+
"version": "8.10"
192+
},
193+
"target_os": {
194+
"name": "Red Hat Enterprise Linux",
195+
"version": "8.10"
196+
},
197+
"convert2rhel_through_foreman": 1,
198+
"activity": "conversion",
199+
"packages_0_nevra": "convert2rhel-0:2.0.0-1.el8.noarch",
200+
"packages_0_signature": "RSA/SHA256, Thu May 30 13:31:33 2024, Key ID 199e2f91fd431d51",
201+
"activity_started": "2024-07-11T17:28:54.281664Z",
202+
"activity_ended": "2024-07-11T17:48:47.026664Z",
203+
"success": "true"
190204
}},
191205
{"rhel_ai": {
192206
"variant": "RHEL AI",

0 commit comments

Comments
 (0)