Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

DEVPROD-2707: Avoid modifying parent patch when restarting downstream tasks #2251

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

minnakt
Copy link
Contributor

@minnakt minnakt commented Feb 5, 2024

DEVPROD-2707

Description

This PR fixes a bug where restarting a downstream task via the VersionRestartModal would also restart all of the tasks in the parent patch.

The issue seems to stems from a change in restart logic made in Evergreen four months ago. When restarting a downstream task from the UI, the payload looks like the following:

{
   // In the parent patch, restart nothing.
   { 
        versionId: "123", 
        taskIds: []
    },
   // In the child patch, restart "downstream-task".
   { 
        versionId: "123", 
        taskIds: ["downstream-task"]
    }
}

However, according to the function that restarts versions, an empty taskIds array means that ALL completed tasks belonging to the version will be restarted. See screenshot below:

Screenshot 2024-02-05 at 4 30 28 PM

The given payload means that "downstream-task" will be correctly restarted in the child patch, but so will every other completed task in the parent patch.

To correct this we can just remove any items from the payload that have an empty taskIds array.

Testing

  • Restarted my patch on staging with these changes and confirmed that only my downstream task restarted

Copy link

cypress bot commented Feb 6, 2024

1 flaky test on run #15594 ↗︎

0 545 10 0 Flakiness 1

Details:

DEVPROD-2707: Prevent restarting entire patch when restarting downstream tasks
Project: Spruce Commit: b9df9bb977
Status: Passed Duration: 20:49 💡
Started: Feb 5, 2024 11:48 PM Ended: Feb 6, 2024 12:09 AM
Flakiness  cypress/integration/distroSettings/host_section.ts • 1 flaky test

View Output Video

Test Artifacts
host section > using legacy ssh > shows an error when selecting an incompatible host communication method Screenshots Video

Review all test suite changes for PR #2251 ↗︎

@minnakt minnakt marked this pull request as ready for review February 6, 2024 14:11
@minnakt minnakt requested a review from a team February 6, 2024 14:11
Copy link
Contributor

@khelif96 khelif96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 🚀

@minnakt minnakt changed the title DEVPROD-2707: Prevent restarting entire patch when restarting downstream tasks DEVPROD-2707: Avoid modifying parent patch when restarting downstream tasks Feb 7, 2024
@minnakt minnakt merged commit 9bf47a7 into evergreen-ci:main Feb 7, 2024
5 of 6 checks passed
@minnakt minnakt deleted the DEVPROD-2707 branch February 7, 2024 00:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants