Clear code-quality warnings; make application-view e2e assertions real#5634
Merged
norman-abramovitz merged 7 commits intoJul 12, 2026
Merged
Conversation
…ssion store Code scanning flagged 30 warning-severity findings across the backend; each was a real dropped error, not noise: - initSessionStore dereferenced the store returned by all three session store constructors before checking err (nil-deref panic at startup on constructor failure) - helm job restWorker logged response.StatusCode before the err check (nil-deref panics the worker; errored jobs now send a zero result so the collector still gets one result per job) - kube terminal createPod ignored the getClients error (nil client panic) and assigned its pod-wait timeout error to a loop-shadowed variable, so a never-started pod was reported as success - azure/kubeconfig/oidc auth dropped the ParseKubeConfig error (a malformed kubeconfig upload panics jetstream); awsiam dropped the getTokenIAM error and persisted an empty token as success - unarchive dropped the write-side Close error (lost-data class) - dashboard tryDecode* err discards are now explicit; cfapppush's no-op init method is gone
The constructor body assigned the parameter, not the parameter property, so forceLocalPage has never forced keepPages on the action object reducers read. Flagged by code scanning as a useless assignment.
- firehose formatter: declare 'filtered' without an initializer; every switch arm and the catch assign it - seo.data / kubedash confirmation: missing space in concatenated user-facing strings - json-schema-generator: collapse the null/undefined pair to a loose null check - proxy.conf.template: drop the duplicated ws property
Ten tests asserted 'expect(boolExists !== undefined)' - always true for a boolean, so they verified nothing (flagged by code scanning as comparisons between incompatible types). Each now either asserts real behavior or skips with the reason the behavior is untestable here: - services unbind/details: seed a user-provided service instance and a binding via the CF API, then assert the bound instance's card and its Unbind row action (new createUserProvidedService/deleteServiceInstance helpers; bindService now returns the binding guid for cleanup) - variables edit/delete: seed a variable, assert the Edit/Delete row actions behind the signal-list kebab - events filtering: assert the signal-list name filter input - SSH / per-instance logs: skipped - they need a running instance and the API-created test app has no bits - log auto-scroll / level filter / download: skipped - the modern log viewer auto-scrolls by default and has no filter or download UI Also fixes two latent harness bugs the hollow assertions were hiding: updateAppEnvironment used POST where CF API v3 requires PATCH, and openRowActionMenuByRow returned a menu bound to the dead Material menu selector instead of the row's own actions menu. Verified: 5 pass + 5 skip at 2 workers; remaining application-view failures predate this change (stale pre-modernization selectors).
The home banner fed every connected endpoint into the duplicate-URL counter but labelled the result 'Cloud Foundry endpoints' - with 4 CF and 4 k8s endpoints sharing URLs it claimed '8 Cloud Foundry endpoints share a URL'. Duplicate detection is only meaningful within a type, so the count now runs per cnsi_type. Both banners (home page and the CF Application Wall / Marketplace / Services one) now build the sentence from one shared helper so the phrasing cannot drift: per-type counts joined into a single sentence with type labels from the entity catalog, and the verb agreeing with how many distinct URLs are shared - '4 Cloud Foundry endpoints share a URL.' vs '4 Cloud Foundry endpoints and 4 Kubernetes endpoints share URLs.' The CF banner's page-specific explanation moves to its own line and 'view a single endpoint' becomes 'narrow to a single endpoint' (the filter narrows the entity list; it doesn't open an endpoint). Live-verified against a dev instance with 4 CF + 4 k8s shared-URL endpoints connected.
The /cloud-foundry picker is a projection of the Endpoints page onto its CF subset, but its cards carried no management actions. The per-endpoint kebab (Connect / Disconnect / Edit / Unregister) moves out of the endpoints signal list into a shared EndpointRowActionsService consumed by both surfaces, so the menus cannot drift. The picker passes unregister:false - registering and unregistering are admin-level operations on the global registration and stay on the Endpoints page. Adds the long-discussed Reconnect action for connected endpoints: re-auth in place via the connect dialog, no manual disconnect step - the same flow the stale-token snackbar uses. Two dialog fixes make that flow safe: - the connect success detector derived 'connected' from endpoint.user being set, which is true from the moment the dialog opens against an already-connected endpoint - after the 1s connect delay the dialog self-closed with a false 'Connected' snackbar. Success is now gated on hasAttemptedConnect, the same guard the error path already used. - the username prefill only knew the localStorage history of past connects; the dialog config now carries the live connection's user, preferred over the remembered value, so Reconnect opens prefilled. Live-verified: reconnect round-trip against a dev instance replaces the token with the dialog staying open until submit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clears all 46 open warning-severity findings on the Code Quality board (the level that holds both dimensions at "Fair"), fixing the real bugs behind them rather than suppressing.
Backend (30 findings)
Every Go warning was a genuinely dropped error:
initSessionStoredereferenced the store returned by all three session-store constructors before checkingerr— a constructor failure was a nil-deref panic at startup.restWorkerreadresponse.StatusCodebefore theerrcheck.DoProxySingleRequestalways returns a nil response with a non-nil error, and the worker runs in its own goroutine, so this was a whole-process crash. Errored jobs now carry anErrmarker;UpdatePodsskips its stale-pod sweep andUpdateResourceskeeps the cached resource when a job failed, so a transient proxy error no longer empties the release view.getClientserror (nil-client panic atsecretClient.Create) and assigned its pod-wait timeout error to a loop-shadowed variable, reporting a never-started pod as success.azure,kubeconfig,oidc) dropped theParseKubeConfigerror, so a malformed kubeconfig upload panicked jetstream;awsiamdropped thegetTokenIAMerror and persisted an empty token as success.unarchivedropped the write-sideCloseerror (lost-data class); the cfapppush no-opinitmethod is deleted; the dashboardtryDecode*error discards are now explicit.Frontend (16 findings)
SetPage's constructor assigned thekeepPagesparameter instead of the parameter property, soforceLocalPagenever actually forcedkeepPageson the dispatched action.E2E: real assertions instead of hollow ones
Ten
application-viewtests assertedexpect(boolExists !== undefined)— always true for a boolean, so they verified nothing. Each now either asserts real behavior or skips with the reason it can't be tested here:createUserProvidedService/deleteServiceInstancehelpers (labeledstratos-e2e-testand covered by the cleanup sweep, which now reaps service instances before spaces).Giving these tests teeth exposed two latent harness bugs the hollow assertions had been hiding:
updateAppEnvironmentused POST where CF API v3 requires PATCH, andopenRowActionMenuByRowreturned a menu bound to the removed Material menu selector instead of the row's own actions menu.bindServicenow returns the binding guid (guarded for managed bindings, which return 202 with an empty body).Verification
make lint: golangci-lint 0 issues on both Go modules;make check gategreen (eslint, 3094 frontend tests, production build, go tests).application-viewfailures predate this change (stale pre-modernization selectors, tracked separately).Shared-URL banner correctness (found during live verification)
Live-verifying this branch against a dev instance with 4 CF + 4 Kubernetes shared-URL endpoints surfaced a mislabelled banner: the home page fed every connected endpoint into the duplicate-URL counter and reported "8 Cloud Foundry endpoints share a URL" when only 4 CF endpoints exist. Duplicate detection now runs per endpoint type, and both banners (home and the Application Wall / Marketplace / Services one) build their sentence from a single shared helper so the phrasing cannot drift: "4 Cloud Foundry endpoints share a URL." / "4 Cloud Foundry endpoints and 4 Kubernetes endpoints share URLs." The wall banner's page-specific explanation moves to its own line. Included here rather than as a follow-up so operators picking up this fix level get the banner correction with it.
Endpoint management kebab on the CF picker + Reconnect
Also from live verification: the /cloud-foundry picker is a projection of the Endpoints page onto its CF subset, but its cards had no management menu. The per-endpoint kebab moves into a shared EndpointRowActionsService used by both surfaces (the picker omits Unregister — registration changes are admin-level and stay on the Endpoints page), and gains a Reconnect action for connected endpoints: re-auth in place through the connect dialog, prefilled with the live connection's username. Two connect-dialog fixes make that flow safe — the success detector no longer treats a pre-existing connection as an instant success (gated on hasAttemptedConnect, matching the error path), and the username prefill prefers the live connection's user over the localStorage history.