Auto-refresh of instance status

Status: Implemented Issue: https://gitlab.com/gitlab-org/cloud-native/gitlab-operator/-/work_items/2232 Parent: none

Goal

An administrator watching an instance install or upgrade in the Bridge UI sees its status and upgrade progress change without reloading the page. For the design, see ADR 39.

Requirements

  • The instance list refreshes every 10 seconds while the page is visible, with no loading indicator. Its rows, including the upgrade detail of an expanded row, follow without losing what is expanded or picked. The detail closes when the upgrade finishes.
  • After Confirm, the row shows the upgrade as started until the instance takes up the new version. It offers Upgrade again if the instance fails instead, or after two minutes.
  • The form of an existing instance refreshes its Siphon and Orbit status panels at the same pace, and never changes a field.
  • Each view shows when its data was last updated. A load that stored nothing does not change it.
  • A failed refresh keeps the data, says why, and retries with a backoff. The first success clears the message, and the error of a failed first load. The error of a save, an upgrade, or a deletion stays.
  • A hidden page, or one left before its first load finished, sends no refreshes. A page shown again refreshes at once.
  • At most one refresh per page is in flight. A refresh answered after a save, an upgrade, or a deletion is dropped, so a deleted instance does not reappear.

Out of scope

  • Pushing changes from the server (watch, server-sent events, WebSocket).
  • Refreshing the fields of the form with what changed on the cluster.
  • A setting for the refresh interval.
  • Refreshing the form of an instance created in it, which stays open when an add-on fails to save.

FAQ

  • Why poll rather than push? Each request runs with the caller’s own token, and one list call every 10 seconds per open page is cheap for the API server. The issue asks for updates within 15 seconds, which polling meets. See ADR 39.
  • Why does the form not reload its fields? The administrator may be editing them. A refresh that overwrote them would lose the edit, and one that merged them could save a mix nobody wrote.
  • Why does the form not show the phase of the instance? It has no instance status panel today. The list shows the phase and the upgrade progress.