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_headeralready computed a variant from the job'srecoverableflag and bound it ontoJobSidebarRetryButton, but that component had novariantprop. The attribute fell through to theGlButtonGrouproot instead of the inner buttons, which stayed hardcoded tovariant="confirm".- The no-log empty state hardcoded
variant="confirm"on its action button and ignoredrecoverableentirely.
This MR closes both gaps:
JobSidebarRetryButtongains avariantprop (defaultconfirm) 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 variantsidebar_headerpasses is actually honoured.empty_stategains avariantprop (defaultconfirm) bound to its action button.job_appcomputesemptyStateRetryVariant(confirmwhen the job status is present andrecoverable, otherwisedefault) 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.
After: on an unrecoverable failure, Retry renders as a secondary default button; recoverable failures are unchanged.
Focused renders of the @gitlab/ui retry button in the two variants.
How to set up and validate locally
- 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.
- 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). - 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.

