Skip to content

feat(deployment): replace redeploy with a "Run again" action on the deployment detail page - #2866

Merged
TheoGrandin74 merged 6 commits into
stagingfrom
claude/slack-session-jiy2lp
Aug 13, 2026
Merged

feat(deployment): replace redeploy with a "Run again" action on the deployment detail page#2866
TheoGrandin74 merged 6 commits into
stagingfrom
claude/slack-session-jiy2lp

Conversation

@TheoGrandin74

@TheoGrandin74 TheoGrandin74 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Problem

From the Slack thread: on a deployment's detail page, the deploy action redeployed the whole environment instead of the deployment being viewed, and the fixed "Deploy"/"Redeploy" wording was misleading since a deployment-history item can represent other actions (stop, restart, …).

Change

The deployment detail page now shows a single context-aware action button:

  • Cancel deployment while a deployment is in progress (with confirmation) — so an in-progress deploy can always be cancelled.
  • Run again once finished — replays the deployment's original action, scoped to that deployment's services (built from deploymentHistory.stages[].services[].identifier).

Run again maps the deployment's trigger_action to the matching bulk, service-scoped action:

trigger_action Replayed action
DEPLOY, DEPLOY_DRY_RUN deploy (deployAllServices)
RESTART restart (restartAllServices — applications/containers/databases only, per the API)
STOP stop (stopAllServices)
UNINSTALL uninstall (uninstallAllServices)
DELETE delete (deleteAllServices)

For any other action type, Run again is disabled.

Behavior details:

  • Cancel and the destructive replays (stop / uninstall / delete) go through a confirmation modal; deploy and restart run directly.
  • arrow-rotate-right is used for Run again (instead of the deploy-implying rotate-right), xmark for Cancel.

Files

  • libs/domains/environment-logs/feature/src/lib/deployment-action-button/deployment-action-button.tsx — new context-aware button (renamed from run-again-button).
  • libs/domains/environment-logs/feature/src/lib/environment-stages/environment-stages.tsx — renders it on the deployment detail page.
  • libs/domains/services/feature/src/index.ts — exports the useDeployAllServices / useUninstallAllServices hooks (were not exported from the barrel).
  • deployment-action-button.spec.tsx — unit tests for the cancel/run-again toggle, the action mapping, and the destructive/cancel confirmations.

Notes

  • Replays use each service's currently-deployed version (no pinned commit/tag), consistent with the existing multi-select "Deploy".
  • codecov/project may show a coverage delta driven by CI's affected-only coverage upload ("HEAD has 1 upload less than BASE"), not a real regression from this change.

The Redeploy button on the deployment detail page previously redeployed the
whole environment. It now scopes the redeploy to the exact set of services
that were part of the viewed deployment, by threading the deployment's
deploymentHistory into EnvironmentActionToolbar and calling deployAllServices
with a DeployAllRequest built from those services. When no deploymentHistory
is provided (other toolbar usages), the whole-environment deploy behavior is
unchanged.
@nx-cloud

nx-cloud Bot commented Aug 13, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 3131e48

Command Status Duration Result
nx run console:build --parallel=3 --configurati... ✅ Succeeded 1m 11s View ↗
nx affected --target=test --parallel=3 --config... ✅ Succeeded 24s View ↗
nx affected --target=lint --parallel=3 ✅ Succeeded 2m 57s View ↗
nx-cloud record -- yarn nx format:check ✅ Succeeded 5s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-08-13 13:44:41 UTC

@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.73913% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.41%. Comparing base (1435ca6) to head (717df64).

Files with missing lines Patch % Lines
...loyment-action-button/deployment-action-button.tsx 73.33% 10 Missing and 2 partials ⚠️
.../src/lib/environment-stages/environment-stages.tsx 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #2866      +/-   ##
===========================================
- Coverage    49.58%   46.41%   -3.18%     
===========================================
  Files          850      486     -364     
  Lines        21162    12741    -8421     
  Branches      6375     3908    -2467     
===========================================
- Hits         10494     5914    -4580     
+ Misses        8898     5792    -3106     
+ Partials      1770     1035     -735     
Flag Coverage Δ
unittests 46.41% <71.73%> (-3.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

claude added 2 commits August 13, 2026 07:55
…ent detail

The deployment detail page now replays the deployment's original action
(deploy/restart/stop/uninstall/delete) scoped to that deployment's services,
via a "Run again" button, instead of redeploying the whole environment.
Reverts the interim scoped-redeploy change to the shared environment toolbar.
@TheoGrandin74 TheoGrandin74 changed the title fix(deployment): redeploy only the services of the viewed deployment feat(deployment): replace redeploy with a "Run again" action on the deployment detail page Aug 13, 2026
claude added 2 commits August 13, 2026 13:22
…deployment detail

The deployment detail action is now a single context-aware button — Cancel while a deployment is in progress, Run again once finished; Run again replays the deployment's original action (deploy/restart/stop/uninstall/delete) scoped to its services, defaulting to a deploy replay for unmapped actions; renamed RunAgainButton → DeploymentActionButton.
… defaulting to deploy

per review discussion, unmapped trigger actions (terraform ops, DELETE_RESOURCES_ONLY, unknown) leave the Run again button disabled rather than falling back to a deploy replay.
@TheoGrandin74
TheoGrandin74 merged commit e833621 into staging Aug 13, 2026
5 of 6 checks passed
@TheoGrandin74
TheoGrandin74 deleted the claude/slack-session-jiy2lp branch August 13, 2026 13:48
@RemiBonnet

Copy link
Copy Markdown
Member

🎉 This PR is included in version 1.337.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants