Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 24, 2025

Problem

The restart functionality was overwriting existing deployment request entries instead of creating new ones, which caused loss of deployment history and made it impossible to track the original request execution.

Issue: When restarting a deployment request, the system would:

  1. Change the existing request status to "Restarting"
  2. Clear deployment results
  3. Reset the request to "Pending" status

This approach overwrote the original request data and execution history.

Solution

Implemented a clone-based restart mechanism that preserves the original request while creating a new one for execution:

Backend Changes

Added clone functionality to IRequestsPersistentSource:

int CloneRequest(int requestId, string newUserName);

Implemented cloning logic in RequestsPersistentSource that:

  • Preserves: RequestDetails, Project, Environment, BuildNumber, Components, IsProd flag
  • 🔄 Resets: ID (new), UserName (current user), Status ("Pending"), timestamps, logs

Modified RequestController.RestartPost to use cloning instead of status modification:

// Old approach: Update existing request status
_requestsPersistentSource.UpdateRequestStatus(requestId, DeploymentRequestStatus.Restarting, username);

// New approach: Clone request
var newRequestId = _requestsPersistentSource.CloneRequest(requestId, username);

Frontend Changes

Updated user messaging to reflect the new behavior:

  • Confirmation dialog now explains that a new request will be created
  • Success message shows the new request ID
  • Event details include both original and new request IDs

Backward Compatibility

  • Monitor service still processes any existing "Restarting" status requests
  • API endpoint remains unchanged (/Request/restart)
  • Frontend restart button functionality preserved

Result

Before:

  • Original request: ID=123, Status="Completed" → ID=123, Status="Pending" (history lost)

After:

  • Original request: ID=123, Status="Completed" (preserved)
  • New request: ID=456, Status="Pending" (ready for execution)

The restart functionality now creates a new cloned request instead of modifying the existing one, preserving deployment history while enabling re-execution with the same configuration.

Fixes #73.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] 304267 - restart request is overwriting the existing entry instead of new entry on the dorc monitor section Fix restart functionality to clone requests instead of overwriting existing entries Jul 24, 2025
Copilot AI requested a review from benhegartysefe July 24, 2025 08:00
@benhegartysefe benhegartysefe marked this pull request as ready for review July 24, 2025 14:56
@dmitryrext
Copy link
Contributor

@slafeer-sefe please could you review and complete?

@slafeer-sefe slafeer-sefe self-assigned this Jan 6, 2026
@slafeer-sefe
Copy link
Collaborator

if we are restarting the request why is the original request shown as completed? it can be confusing

@github-actions
Copy link

github-actions bot commented Jan 13, 2026

Test Results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
1 suites ±0   0 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit 18836a9. ± Comparison against base commit 8fdbaf4.

♻️ This comment has been updated with latest results.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

304267 - restart request is overwriting the existing entry instead of new entry on the dorc monitor section

4 participants