fix: enable Flux actions for HelmChart resources - #611
Conversation
HelmChart was missing from the supported Flux resource list. Enable suspend, resume, and reconcile through the existing API patches, with tests and help updates. Closes #610
Greptile SummaryThis PR enables existing Flux suspend, resume, and reconcile actions for HelmChart resources while tightening eligibility to exact Flux API group/resource pairs.
Confidence Score: 5/5The PR appears safe to merge; the previous API-group eligibility issue is fully addressed and no new actionable failures remain. Flux action eligibility now requires the exact supported API group and plural, and the added tests verify that matching plurals in unrelated or incorrect Flux groups cannot open the menu. The previously reported plural-only gate is therefore fully fixed. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User presses t] --> B{Selected API group and plural}
B -->|Recognized Flux resource| C[Open Flux action menu]
B -->|Other resource identity| D[Show unsupported-resource warning]
C --> E{Chosen action}
E -->|Suspend or resume| F[Patch spec.suspend]
E -->|Reconcile now| G[Patch requestedAt annotation]
E -->|Force reconcile| H{Flux HelmRelease?}
H -->|Yes| I[Apply force-reconcile patch]
H -->|No| J[Action unavailable]
Reviews (2): Last reviewed commit: "fix: check API groups before enabling Fl..." | Re-trigger Greptile |
| "helmreleases", | ||
| "gitrepositories", | ||
| "helmrepositories", | ||
| "helmcharts", |
There was a problem hiding this comment.
If an unrelated CRD uses the helmcharts plural in another API group, this plural-only allowlist exposes the Flux action menu for it. Suspend and resume then patch an unsupported spec.suspend field, while reconcile adds a Flux-specific annotation, resulting in an API error or a misleading successful no-op. Include the Flux API group in the eligibility check.
Resource plurals can also belong to unrelated CRDs. Match each supported Flux resource to its API group before opening the action menu, and test valid and conflicting groups through keyboard input.
HelmChart resources could not open the Flux action menu because the supported resource list omitted
helmcharts. Enable the existing actions so users can suspend, resume, and reconcile selected or marked charts witht.Check both the API group and resource plural before opening the Flux menu. This prevents unrelated CRDs with the same plural from receiving Flux patches. Tests cover each supported resource in its correct group, an unrelated group, and an incorrect Flux group.
Update the help text and documentation. Tests also check the API paths and patch bodies for all three actions, cancellation, read-only mode, and the restriction of force reconcile to Flux HelmRelease resources.
Validation:
just check(format check, Clippy with warnings denied, and the full test suite).Closes #610
Discussion and approved scope: #605. The maintainer approved implementation in the work request.