feat: Project creation wizard driven by ProjectType / ClusterProjectType#653
Conversation
|
Changeset detected — the following file(s) will be released with this PR: |
|
Warning Review limit reached
More reviews will be available in 46 minutes and 38 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (24)
📝 WalkthroughWalkthroughIntroduces a per- ChangesPer-ProjectType Create Project Wizard
Sequence Diagram(s)sequenceDiagram
participant User
participant CustomTemplateListPage
participant OpenChoreoEntityProvider
participant PtdToTemplateConverter
participant EventDeltaApplier
participant CatalogService
participant ScaffolderBackend
rect rgba(70, 130, 180, 0.5)
note over OpenChoreoEntityProvider,CatalogService: Full Sync / Delta Event
OpenChoreoEntityProvider->>PtdToTemplateConverter: convertPtdToTemplateEntity(crd, namespace)
PtdToTemplateConverter-->>OpenChoreoEntityProvider: Template entity (openchoreo:project:create step)
OpenChoreoEntityProvider->>OpenChoreoEntityProvider: stampManagedByLocation(template)
OpenChoreoEntityProvider->>CatalogService: upsert ProjectType + Template entities
EventDeltaApplier->>PtdToTemplateConverter: buildProjectTypeTemplateEntity(delta event)
PtdToTemplateConverter-->>EventDeltaApplier: Template entity
EventDeltaApplier->>CatalogService: upsert/remove ProjectType + Template on event
end
rect rgba(60, 179, 113, 0.5)
note over User,ScaffolderBackend: User Creates a Project
User->>CustomTemplateListPage: navigates to ?view=projects
CustomTemplateListPage->>CustomTemplateListPage: filter projectGroups by PTD_GENERATED + spec.type=Project
CustomTemplateListPage-->>User: renders ProjectTemplateCard list
User->>CustomTemplateListPage: selects a project type template
CustomTemplateListPage->>ScaffolderBackend: open wizard (ProjectParametersField renders ptdSchema)
User->>ScaffolderBackend: submits form
ScaffolderBackend->>ScaffolderBackend: openchoreo:project:create(typeKind, typeName, parameters)
ScaffolderBackend-->>User: created project entity ref link
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Extend the openchoreo:project:create action with optional typeKind /
typeName / parameters inputs so a Project can be created as an instance of
a (Cluster)ProjectType, mirroring openchoreo:resource:create. When provided,
spec.type and spec.parameters are set on the create request (deploymentPipelineRef
is preserved); when omitted, the request is unchanged and the OpenChoreo API
applies its {ClusterProjectType, default} default, keeping the legacy path working.
The immediate-catalog insert now threads projectTypeName / projectTypeKind into
translateProjectToEntity so the instanceOf -> ProjectType relation appears
immediately instead of after the next sync.
Signed-off-by: VajiraPrabuddhaka <vajiraprabuddhaka@gmail.com>
Mirror the ResourceType -> Template path for ProjectTypes so each (Cluster)ProjectType produces a per-type Project-creation wizard. Adds PtdToTemplateConverter (template-project-<name>, spec.type: Project, PTD_* annotations) with a Project Metadata section (namespace + project name + deployment pipeline) and a schema-driven Details section bound to the type's spec.parameters.openAPIV3Schema via the ProjectParametersField. The generated template wires openchoreo:project:create with the type's kind/name. The OpenChoreoEntityProvider emits these templates during full sync for both namespaced ProjectTypes and cluster-scoped ClusterProjectTypes, and the EventDeltaApplier emits/removes them on projecttype/clusterprojecttype events. Unlike the Resource family, the (Cluster)ProjectType list returns the full parameters schema inline, so no extra /schema fetch is needed. Adds PTD_* annotation constants and unit tests for the converter (namespaced + cluster) and the event delta paths. Signed-off-by: VajiraPrabuddhaka <vajiraprabuddhaka@gmail.com>
Wire the frontend so "Create Project" mirrors "Create Resource": - ProjectParametersField scaffolder field extension (thin RJSF wrapper over the type's ptdSchema), registered in OpenChoreoScaffolderPage. - CustomTemplateListPage gains a ?view=projects browse view listing the PTD_GENERATED per-type templates, a "Project" landing nav-card, and the namespace scope picker; 'Project' is treated as a meta-card type. - useKindCreateConfig routes the Projects catalog (kind=system) "Create Project" button to ?view=projects instead of the static template. - CustomReviewStep gets a ProjectReview section and a 'project' branch in detectTemplateType (keyed on the top-level project_name field). - Remove the static create-openchoreo-project template and its app-config / app-config.production Locations; repoint the Namespace card's "Create a new project" action to ?view=projects. Signed-off-by: VajiraPrabuddhaka <vajiraprabuddhaka@gmail.com>
5ba7779 to
0f2eca7
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
- EventDeltaApplier: assert projecttype/clusterprojecttype events upsert both the type entity and its generated template-project-<name> Template - OpenChoreoEntityProvider: full-sync now fixtures ProjectType / ClusterProjectType and asserts the per-type project templates are emitted - ProjectParametersField: cover schema-driven render, formData seeding, onChange propagation, and the no-parameters empty-state - CustomReviewStep: cover the ProjectReview section and the 'project' detectTemplateType branch (metadata + flattened parameters) Signed-off-by: VajiraPrabuddhaka <vajiraprabuddhaka@gmail.com>
Signed-off-by: VajiraPrabuddhaka <vajiraprabuddhaka@gmail.com>
|
@coderabbitai full-review |
|
✅ Action performedFull review finished. |
Purpose
OpenChoreo's project-release-lifecycle epic (openchoreo/openchoreo#3564) made
Project.spec.type(aProjectTypeRef) andProject.spec.parametersfirst-class: a Project is now an instance of aProjectType/ClusterProjectType, whoseparametersschema configures it. The catalog already ingests both kinds and links Projects to their type (#645), but Project creation was untouched it was a single staticcreate-openchoreo-projecttemplate with a fixed field set and no type/parameters.This PR introduces the Project creation wizard starting from the template selection, and then metadata collection and Parameters collection and finally the creation.
Approach
openchoreo:project:create): accept optionaltypeKind/typeName/parameters; setspec.type+spec.parameterson the create request (preservingdeploymentPipelineRef); thread the type into the immediate-catalog insert so theinstanceOf → ProjectTyperelation appears at once. Back-compatible — when omitted, the API applies its default.PtdToTemplateConvertergenerates onetemplate-project-<name>scaffolder Template per(Cluster)ProjectType(annotationptd-generated,spec.type: Project), with a Project Metadata section (namespace + project name + deployment pipeline) and a schema-driven Details section bound to the type'sspec.parameters.openAPIV3Schema. The provider emits these on full sync and theEventDeltaApplieremits/removes them onprojecttype/clusterprojecttypeevents. The list endpoint returns the parameters schema inline, so no extra/schemafetch is required.packages/app): aProjectParametersFieldRJSF field extension; a?view=projectsbrowse view inCustomTemplateListPagewith a "Project" landing nav-card and namespace scope picker;useKindCreateConfigroutes the Projects catalog "Create Project" button to?view=projects; aProjectReviewsection inCustomReviewStep. The staticcreate-openchoreo-projecttemplate and its app-config Locations are removed; the Namespace card's create action is repointed to?view=projects.Verified end-to-end on a live k3d cluster: created projects from rich-parameter, nested-object, namespaced, and no-parameter project types;
spec.type(correct kind) andspec.parametersround-trip onto the Project CR.Related Issues
Related openchoreo/openchoreo#3921
Checklist
Quick Demo
Screen.Recording.2026-06-23.at.18.24.53.mov
Summary by CodeRabbit
New Features
Updates