PackageRecommendations: Add distribution to package recommendations

- Add required distribution field to RecommendPackageRequest
- Add modelVersion field to RecommendationsResponse
- Update frontend to send RHEL major version to API
- Add analytics tracking for distribution and modelVersion

Enables version-specific package recommendations and model usage tracking.
This commit is contained in:
Michal Gold 2025-06-19 14:53:43 +02:00 committed by Klara Simickova
parent 6cefc6c199
commit 852d24e568
3 changed files with 15 additions and 0 deletions

View file

@ -1567,6 +1567,10 @@ components:
type: integer
format: int32
default: 3
distribution:
type: string
description: RHEL major release (e.g. "rhel8", "rhel9", "rhel10")
example: "rhel9"
RecommendationsResponse:
required:
- packages
@ -1576,6 +1580,10 @@ components:
type: array
items:
type: string
modelVersion:
type: string
description: Version of the recommendation model used
example: "rpm_rex_42"
ClonesResponse:
required:
- meta

View file

@ -82,6 +82,7 @@ const PackageRecommendations = () => {
recommendPackageRequest: {
packages: packages.map((pkg) => pkg.name),
recommendedPackages: 5,
distribution: distribution.replace('-', ''),
},
});
@ -98,6 +99,7 @@ const PackageRecommendations = () => {
isPreview: isBeta(),
shownRecommendations: response.data.packages,
selectedPackages: packages.map((pkg) => pkg.name),
distribution: distribution.replace('-', ''),
}
);
}
@ -266,6 +268,7 @@ const PackageRecommendations = () => {
(pkg) => pkg.name
),
shownRecommendations: data.packages,
distribution: distribution.replace('-', ''),
}
);
addRecommendedPackage(pkg);

View file

@ -998,10 +998,14 @@ export type DistributionProfileItem =
export type DistributionProfileResponse = DistributionProfileItem[];
export type RecommendationsResponse = {
packages: string[];
/** Version of the recommendation model used */
modelVersion?: string | undefined;
};
export type RecommendPackageRequest = {
packages: string[];
recommendedPackages: number;
/** RHEL major release (e.g. "rhel8", "rhel9", "rhel10") */
distribution?: string | undefined;
};
export const {
useGetArchitecturesQuery,