Respect the retry button variant on unrecoverable job failures

What does this MR do and why?

The job details page always rendered the Retry button with the primary confirm variant, even when the job had failed for an unrecoverable reason. The intent in the UI was to down-rank retry on those failures, but the variant never reached the actual buttons.

Two gaps caused this:

  • sidebar_header already computed a variant from the job's recoverable flag and bound it onto JobSidebarRetryButton, but that component had no variant prop. The attribute fell through to the GlButtonGroup root instead of the inner buttons, which stayed hardcoded to variant="confirm".
  • The no-log empty state hardcoded variant="confirm" on its action button and ignored recoverable entirely.

This MR closes both gaps:

  • JobSidebarRetryButton gains a variant prop (default confirm) that is now applied to the retry button, the manual "run again" button, the retry link, and the "retry with modified values" disclosure dropdown — so the variant sidebar_header passes is actually honoured.
  • empty_state gains a variant prop (default confirm) bound to its action button.
  • job_app computes emptyStateRetryVariant (confirm when the job status is present and recoverable, otherwise default) and passes it to the empty state.

Net effect: an unrecoverable failure now renders Retry as a secondary (default) button, while recoverable failures keep the primary confirm styling. Defaults are unchanged, so no other caller is affected.

Changelog: fixed

Before: on an unrecoverable job failure, the Retry button (sidebar and no-log empty state) rendered as a primary confirm button — the same as a recoverable failure.

retry-button-before

After: on an unrecoverable failure, Retry renders as a secondary default button; recoverable failures are unchanged.

retry-button-after

Focused renders of the @gitlab/ui retry button in the two variants.

How to set up and validate locally

  1. Run the unit specs for the changed component:

The added variant cases assert the retry button applies a passed-in variant and defaults to confirm.

  1. In GDK, open a job that failed for a recoverable reason (e.g. a plain script failure) and confirm the sidebar Retry button and the no-log empty-state action button are primary (confirm).
  2. Open a job that failed for an unrecoverable reason and confirm the same Retry controls now render as a secondary (default) button. Toggling between the two job types should be the only thing that changes the variant.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Jeston Singh

Merge request reports

Loading
Loading