HMS-9490: create templates with extended support repos#849
HMS-9490: create templates with extended support repos#849katarinazaprazna wants to merge 9 commits intocontent-services:mainfrom
Conversation
Reviewer's GuideExtends the templates creation/editing flow to support extended support (EUS/E4S) content versioning, updates the shared context and wizard step logic accordingly, and wires the new data fields through API types, routing, and tests. Class diagram for updated template and content modelsclassDiagram
class AddOrEditTemplateContextInterface {
+QueryClient queryClient
+NameLabel[] distribution_arches
+NameLabel[] distribution_versions
+NameLabel[] extended_release_features
+DistributionMinorVersion[] distribution_minor_versions
+Partial_TemplateRequest templateRequest
+setTemplateRequest(value)
+Set~string~ selectedRedhatRepos
+setSelectedRedhatRepos(uuidSet)
+Set~string~ selectedCustomRepos
+setSelectedCustomRepos(uuidSet)
+Set~string~ hardcodedRedhatRepositoryUUIDS
+hasInvalidSteps(index) boolean
+boolean isEdit
+string editUUID
}
class TemplateRequest {
+string arch
+string version
+boolean use_extended_support
+string extended_release
+string extended_release_version
+string date
+string description
+string name
+string[] repository_uuids
+boolean use_latest
}
class TemplateItem {
+string uuid
+string name
+string description
+SnapshotItem[] snapshots
+SnapshotItem[] to_be_deleted_snapshots
+string arch
+string version
+boolean use_extended_support
+string extended_release
+string extended_release_version
+string date
+boolean use_latest
+string created_at
}
class RepositoryParamsResponse {
+NameLabel[] distribution_versions
+NameLabel[] distribution_arches
+NameLabel[] extended_release_features
+DistributionMinorVersion[] distribution_minor_versions
}
class NameLabel {
+string name
+string label
}
class DistributionMinorVersion {
+string name
+string label
+string major
+string[] feature_names
}
class ContentItem {
+string uuid
+string name
+string url
+number package_count
+string? extended_release
+string? extended_release_version
}
class FilterData {
+string search
+string[] versions
+string[] arches
+string extended_release
+string extended_release_version
+string[] statuses
+string[] uuids
+string[] urls
}
AddOrEditTemplateContextInterface --> TemplateRequest : manages
AddOrEditTemplateContextInterface --> RepositoryParamsResponse : uses
RepositoryParamsResponse --> NameLabel : contains
RepositoryParamsResponse --> DistributionMinorVersion : contains
DistributionMinorVersion --> NameLabel : compatible labels
TemplateItem --> TemplateRequest : related shape
ContentItem --> DistributionMinorVersion : associated via extended_release_version
FilterData --> ContentItem : filters
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
c279f94 to
31d66cd
Compare
rverdile
left a comment
There was a problem hiding this comment.
This looks pretty good so far. I think we still need to hear from UX, but these are some changes that will move us in the right direction either way.
There was a problem hiding this comment.
For the red hat repositories step, The list should be filtered to the extended release type and version. For example, if I choose EUS 9.4, then the backend call to list the repositories would look like /repositories/?extended_release=eus&extended_release_version=9.4. We'd also want to pre-select the 9.4 BaseOS and Appstream Repositories instead of the latest release RHEL 9 repositories.
There was a problem hiding this comment.
Got it, thanks for clarifying the repo filtering! I'll be moving onto that shortly. I'm planning to finish the templates endpoint integration first to ensure a smooth handoff between the steps
There was a problem hiding this comment.
Note to self:
- List should be filtered according to the extended release type and version
- Pre-select BaseOS and Appstream repos
There was a problem hiding this comment.
We don't want the template extended release or release version to be editable. We will make the version editable in a followup ticket.
src/Pages/Templates/TemplatesTable/components/AddOrEditTemplate/steps/ExtendedSupportStep.tsx
Outdated
Show resolved
Hide resolved
2118b41 to
8023d2a
Compare
b13758f to
7365801
Compare
| export const featureNameToExtendedRelease = (featureName: string | undefined): ExtendedRelease => | ||
| featureName === EUS ? 'eus' : featureName === E4S ? 'e4s' : 'none'; | ||
|
|
There was a problem hiding this comment.
Do you think the API should be updated to just return "e4s" or "eus"? I don't see the names "RHEL-EUS-x86_64" or "RHEL-E4S-x86_64" being used anywhere, so that could make sense.
There was a problem hiding this comment.
you might could do this as part of the backend ticket you picked up
There was a problem hiding this comment.
@rverdile I think it makes sense to handle the mapping on the BE side. It’ll save us from having to maintain that logic on the FE. I’m happy to take that on as part of my BE task :)
src/Pages/Templates/TemplatesTable/components/AddOrEditTemplate/steps/ExtendedSupportStep.tsx
Outdated
Show resolved
Hide resolved
- Added new "Content versioning" step that allows users to choose between rolling releases and extended support releases (EUS/E4S) - Implemented validation logic to conditionally show the versioning step based on feature availability and architecture constraints - Updated template request model to include `extended_release` and `extended_release_version` fields - Initialized template request with default extended support values to prevent undefined state - Integrated repository parameters API to fetch extended release features and distribution minor versions
- Added `featureNameToExtendedRelease` helper to map feature names to API-supported values - Enhanced template logic to conditionally send extended release data based on feature availability
e988311 to
122ee33
Compare
122ee33 to
f2f631c
Compare
Summary
This PR aligns the frontend template logic with upcoming changes in the content-sources-backend. It ensures the UI handles extended support features and point-release targeting in parity with the evolving API contract.
The frontend logic is designed to integrate with the following backend updates:
repository_parameters/endpoint.repositories/endpoint.templates/endpoint.Testing steps