Repository navigation
docs(api): stop listing helm-install-timeout carriers in rest.go - #4381
Conversation
The comment next to the timeout overrides named the kinds that set helm-install-timeout and gave each one's reason. The list had already fallen behind the ApplicationDefinitions that carry the annotation, and nothing checks it, so it drifts every time a kind opts in. Say where the annotations live and when a kind should set them instead. Which kinds set them is recorded in their ApplicationDefinitions, and a comment should not restate it. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: cozystack/cozystack/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe change revises a comment about ChangesTimeout annotation documentation
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~2 minutes Change: Other · Severity of issue fixed: Low Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable issue is indicated; the change only updates explanatory text. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
IvanHunters
left a comment
There was a problem hiding this comment.
Verdict
LGTM with non-blocking notes
The list this deletes really had gone stale, and both sentences replacing it hold against the code.
Findings
- [MINOR]
packages/system/tenant-rd/cozyrds/tenant.yaml:9, two cozyrds name Flux's 5m default as the budget the annotation replaces, but this path never sees it
Caveats
Both new claims check out. The annotations are read only off ApplicationDefinition.metadata.annotations (pkg/cmd/server/start.go:306,316), and the other HelmRelease producer, PackageReconciler.buildHelmReleaseSpec (internal/operator/package_reconciler.go:86), has no per-kind annotation path at all. So the ApplicationDefinition really is the sole carrier, and all 31 in-repo ApplicationDefinitions do live under packages/system/*-rd/cozyrds/.
The premise holds too. grep -rn 'helm-install-timeout' packages/ returns five carriers, not the two the old comment named: kafka 7h, kubernetes 20m, kubernetes-nodes 15m, monitoring 15m, tenant 15m. Each one keeps its own rationale beside the annotation it sets, so the deleted paragraphs cost a reader nothing they can't get from the file that picks the number. No other Go comment restates the carrier set, so the class is gone rather than moved somewhere else to rot.
Every changed line is a comment line and nothing under packages/ is touched, so upgrade, fresh install and the config matrix have no surface to exercise here: git diff ff0b851bb..36d5c31ea -- pkg/registry/apps/application/rest.go | grep -E '^[+-]' | grep -v '^[+-][+-]' | grep -cvE '^[+-][[:space:]]*//' prints 0. A comment-only change owes no regression test, and the alternative ask of a check that goes red when the list drifts is moot once the list is gone.
go build ./..., go vet and go test -count=1 over pkg/registry/apps/application, pkg/config and pkg/cmd/server are green at 36d5c31ea, and nothing is failing in CI on that head.
Findings not anchored to changed lines
These reference code outside this PR's diff (unchanged files, or lines outside a hunk), so GitHub cannot render them inline.
[MINOR] packages/system/tenant-rd/cozyrds/tenant.yaml:9 two cozyrds name Flux's 5m default as the budget the annotation replaces, but this path never sees it
This PR relocates the per-kind "why" into the cozyrds manifests, and all five carriers do carry one. Two of them state the wrong baseline. helm-controller's own 5m never applies on this path: cozystack-api stamps Install.Timeout on every HelmRelease it generates, from HelmReleaseInstallTimeout, whose compiled-in default is 10m. Same wording at packages/system/monitoring-rd/cozyrds/monitoring.yaml:12. Neither file is touched here, so this is a sweep for whenever one of them is next edited.
Worth being explicit about which binary, because the repo has two flags of that name and only one is in play here. --helmrelease-install-timeout on cmd/cozystack-operator/main.go:129 is the operator's, and packages/core/installer/templates/cozystack-operator.yaml:181 passes it there, only when the installer value is non-empty. The Application path runs through the other one, cozystack-api's, and that Deployment carries nothing but its two TLS arguments, so the value is the compiled-in default.
$ sed -n '91p' pkg/cmd/server/start.go
HelmReleaseInstallTimeout: "10m",
$ sed -n '1624,1626p' pkg/registry/apps/application/rest.go
installTimeout := r.releaseConfig.HelmReleaseInstallTimeout
upgradeTimeout := r.releaseConfig.HelmReleaseUpgradeTimeout
if r.releaseConfig.HelmInstallTimeout > 0 {
$ grep -n 'args:' -A3 packages/system/cozystack-api/templates/deployment.yaml
args:
- --tls-cert-file=/tmp/cozystack-api-certs/tls.crt
- --tls-private-key-file=/tmp/cozystack-api-certs/tls.key
$ grep -n 'default 5m' packages/system/tenant-rd/cozyrds/tenant.yaml packages/system/monitoring-rd/cozyrds/monitoring.yaml
packages/system/tenant-rd/cozyrds/tenant.yaml:9: # CNPG bootstrap + master quorum). Flux helm-controller's default 5m
packages/system/monitoring-rd/cozyrds/monitoring.yaml:12: # `cozy-keycloak`, not the tenant namespace, so Flux's default 5m
What this PR does
A comment in the Application to HelmRelease conversion listed which kinds set the helm install timeout annotation, and that list was already wrong. It named two kinds while more set
release.cozystack.io/helm-install-timeouttoday, and nothing checks it, so it goes stale every time another kind opts in.The comment now says where the annotations live, on the kind's ApplicationDefinition, and when a kind should set them. Each kind that sets the annotation already explains why next to it in its cozyrds manifest, so nothing is lost. Comment-only change.
Closes #4147
Screenshots
No UI change.
Downstream repositories
Release note
Summary by CodeRabbit