원클릭으로
review
Review ORC controller code for Kubernetes best practices and ORC conventions. Use after implementing or modifying a controller.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Review ORC controller code for Kubernetes best practices and ORC conventions. Use after implementing or modifying a controller.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Add a dependency on another ORC resource to a controller. Use when a resource needs to reference or wait for another resource (e.g., Subnet depends on Network).
Create a new ORC controller for an OpenStack resource. Use when adding support for a new OpenStack resource type (e.g., LoadBalancer, FloatingIP).
Write an enhancement proposal for a new ORC feature. Use for significant new features, breaking changes, or cross-cutting architectural changes.
Run ORC tests (unit tests, linting, and E2E tests). Use after making changes to verify correctness.
Update an existing ORC controller. Use when adding fields, making fields mutable, adding tag support, or improving error handling.
Draft release notes for a new ORC version. Use when preparing a release to generate changelog and GitHub release body from git history.
| name | review |
| description | Review ORC controller code for Kubernetes best practices and ORC conventions. Use after implementing or modifying a controller. |
| disable-model-invocation | true |
Review ORC controller code for correctness, Kubernetes best practices, and ORC conventions. Produce a structured report at the end.
Determine what changed and which checklists apply:
git diff (or git diff --cached, or diff against the base branch) to identify modified files.api/v1alpha1/*_types.go -> API Types checklistinternal/controllers/*/controller.go -> Controller Setup checklistinternal/controllers/*/actuator.go -> Actuator Logic checklistinternal/controllers/*/status.go -> Status Writer checklistinternal/controllers/*/tests/ -> Test Coverage checklist.go file -> Code Style checklist*_types.go for the resource, even if only part changed).*_types.go)Review any api/v1alpha1/*_types.go file against these rules:
<Resource>ResourceSpec, <Resource>Filter, <Resource>ResourceStatus.<Resource>, <Resource>Spec, <Resource>Status, <Resource>List) are code-generated in zz_generated.* files and NOT hand-edited.ResourceSpec contains fields mapping to OpenStack create API parameters.Filter contains a subset of identifying fields, all optional pointers.ResourceStatus contains observed state from OpenStack.+kubebuilder:validation:MinLength / MaxLength constraints.+kubebuilder:validation:Minimum / Maximum where appropriate.+kubebuilder:validation:Enum listing all valid values.+kubebuilder:validation:MinProperties:=1 (at least one criterion required).+listType annotations (set for unique items like tags, atomic for ordered/opaque lists, map with +listMapKey for keyed lists like conditions).+kubebuilder:validation:XValidation:rule="self == oldSelf" at the struct level.rule="self == oldSelf" on individual immutable fields, leaving mutable fields unmarked."imageRef is immutable").+required fields use value types (e.g., RAM int32) but still have json:"...,omitempty".+optional fields use pointer types (e.g., *OpenStackName, *bool) to distinguish "not set" from zero.ResourceStatus, fields are +optional with pointers or plain strings with omitempty.string with +kubebuilder:validation:MaxLength=1024, not the strongly-typed wrapper.OpenStackName (not raw string). Check the specific OpenStack project for the correct max length (Keystone: 64 chars, Neutron: 255 chars, etc.).KubernetesNameRef with a Ref suffix (e.g., projectRef, networkRef).IPvAny, CIDRs use CIDR, MACs use MAC.NeutronDescription, NeutronTag, FilterByNeutronTags, NeutronStatusMetadata.SecurityGroupRule vs SecurityGroupRuleStatus).ID field when the sub-resource has its own OpenStack ID.XValidation rules on the sub-resource struct.controller.go)GetName() returns the controller name constant.SetupWithManager follows the standard pattern: builder -> watches -> dependency registration -> reconciler creation -> complete.DeletionGuardDependency is used when deleting the dependency would either fail or cause the dependent to fail.Dependency (no deletion guard) is used for import-only dependencies and cases where OpenStack allows the deletion.vipSubnetDependency not subnetDependency when multiple subnet types exist).Watches call in SetupWithManager.predicates.NewBecameAvailable to avoid unnecessary reconciles.errors.Join with AddToManager.actuator.go)osResourceT, actuator interfaces, and helperFactory.var _ createResourceActuator = myActuator{}).k8sClient (when dependencies are used).getResourceName helper exists: returns spec.resource.name if set, otherwise falls back to the ORC object name.progress.WrapError.nil resource, not an error).false (second return value) when spec.resource is nil (no spec to match against).CreateOpts completely.orcerrors.Terminal.GetResourceReconcilers returns reconciler functions for post-creation tasks (e.g., setting Neutron tags, handling mutable field updates).progress.ProgressStatus to force a status refresh.updateResource is used only for general mutable field updates via the resource's Update API (building UpdateOpts, single API call). Operations using a separate API have a descriptive name (e.g., reconcileExtraSpecs, reconcileSubports, reconcilePassword, updateRules).nil (not a terminal error) when spec.resource is nil. Only updateResource returns a terminal error for nil spec.resource.CreateResource does not duplicate work that is handled by a reconciler. The CreateResource contract forbids actions that can fail after creating the primary resource.orcerrors.Terminal and an appropriate ConditionReason.ReconcileStatus return values are never discarded -- always assigned and propagated.progress.WrapError(err) (not bare fmt.Errorf).status.ID already set).GetDependency results checked: if needsReschedule is true, return early.orcv1alpha1.IsAvailable (the standard helper from api/v1alpha1/conditions.go). Status.ID is always set before a resource becomes Available, so checking dep.Status.ID != nil separately is unnecessary.status.go)objectApplyT and statusApplyT (SSA apply configuration types).ResourceStatusWriter.ConditionTrue only when the resource is completely ready for use.ConditionFalse when osResource is nil and no status.ID exists (not yet created).ConditionUnknown when osResource is nil but status.ID exists (can't verify current state).ConditionFalse until the resource reaches a stable, usable state (e.g., ACTIVE).ConditionFalse.ptr.To() for conversion.orcv1alpha1 (e.g., ConditionReasonInvalidConfiguration, ConditionReasonTransientError).ReconcileStatus and ResourceStatusWriter return values.DeletionGuardDependency -- the controller doesn't manually add/remove them.GetApplyConfig returns a fresh apply configuration each time.See AGENTS.md for conventions (import ordering, logging levels, pointer handling). Only flag deviations that affect correctness:
zz_generated.*) are not hand-edited.make generate has been run after any API type changes.ports.StatusActive instead of "ACTIVE").For each controller, verify the following test directories exist under internal/controllers/<kind>/tests/:
| Required Test | Purpose |
|---|---|
<kind>-create-minimal/ | Create with only required fields, verify status matches |
<kind>-create-full/ | Create with all fields populated |
<kind>-import/ | Import an existing OpenStack resource |
<kind>-import-error/ | Import with no matches, verify error handling |
<kind>-dependency/ | Test dependency waiting and deletion guard protection |
| Conditional Test | When Required |
|---|---|
<kind>-update/ | Resource has mutable fields |
<kind>-import-dependency/ | Import filter references other ORC objects |
README.md describing each step.00-, 01-, etc.).TestStep command (not a manifest) using E2E_KUTTL_OSCLOUDS.status.resource fields match the spec.Available, Progressing) are asserted with correct status, reason, and message.Progressing=True, (2) availability after dep created, (3) finalizer blocks dep deletion, (4) dep deleted after resource deleted.kubectl replace (not KUTTL patch) to test field removal.celExpr) used for complex assertions (e.g., checking deletionTimestamp, finalizer membership, field absence with !has(...)).test/apivalidations/<resource>_test.go for non-trivial validation rules.After running through all applicable checklists, produce a structured report:
## Review Summary
**Scope**: <list of files reviewed>
**Overall**: <PASS / PASS with suggestions / NEEDS CHANGES>
## Blockers
Items that MUST be fixed before merge. These are correctness issues, violations
of idempotency/safety invariants, or missing required functionality.
- [file:line] Description of the issue and why it's a blocker.
## Warnings
Items that SHOULD be fixed. These are convention violations, missing edge case
handling, or patterns that may cause issues in production.
- [file:line] Description and recommendation.
## Suggestions
Items that COULD be improved. Style preferences, minor optimizations, or
additional test coverage that would be nice to have.
- [file:line] Description and suggestion.
## Positive Observations
Notable good practices observed in the code (keep brief, 2-3 items max).
Blocker -- any of:
ReconcileStatus propagation (discarded return value)Warning -- any of:
progress.WrapError)Suggestion -- any of: