Null check safety in actual state calculate of remote development
The following discussion from !112906 should be addressed: - [ ] @cwoolley-gitlab started a [discussion](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/112906#note_1308282548): > **question:** Is it possible for any of these nested entries in the workspace info object to be missing? If not, then we should be null-safe/type-safe and do a fetch with a non-default value, and allow it to blow up with a runtime error. This will help us identify problems sooner. > > I don't know what the answer to this is, it's currently not typed on the `agentk` side. It's in [`internal/module/remote_development/agent/worker.go`](https://gitlab.com/gitlab-org/cluster-integration/gitlab-agent/-/merge_requests/854/diffs#48d590822bdc534a31716c85a1626005dadd3f8f_66_39), the `LatestK8sDevWorkspaceInfo` entry in the `WorkspaceAgentInfo` struct, which is just a json string. > > There's already a `TODO` above that struct: > > > // TODO: revisit all request and response types, and make more strongly typed if possible > > We should probably capture an issue to look into this. > > Then, we can have more type-safety on the `agentk` side, and be able to more fully understand what fields we can make required and which ones might be missing.
issue