Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEVPROD-8000: fix duplicate notification for generate.tasks #8609

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Kimchelly
Copy link
Contributor

@Kimchelly Kimchelly commented Jan 9, 2025

DEVPROD-8000

Description

This fixes a bug where a user could get multiple notifications for a version finishing when there are multiple tasks running generate.tasks. The core of the bug is that when generate.tasks adds new tasks to an existing build, that could change the build's state, but generate.tasks didn't update the build state to reflect that, which left the build in a stale state. I fixed it so that when adding new tasks to an existing build, it updates the build's status to take the new tasks into account.

The sequence of events that cause the bug is:

  1. Patch schedules generator task 1 and 2 in build variant B1.
  2. Generator task 1 runs and creates a new build variant B2 with a new task T1. B1 hasn't run anything yet, so it starts out as "created".
  3. T1 succeeds, so B2 finishes with "success".
  4. Generator task 2 runs and adds new task T2 to B2. The generator does not update the build status, so the build is still marked "success".
  5. Generator task 2 finishes, so B1 is marked finished. Both B1 and B2 are marked finished, so Evergreen sends a notification that the version is finished. However, B2 is actually not finished since it has to run T2.
  6. T2 runs and finishes, causing B2 to be marked "success" again, which results in a second version completion notification.

Testing

  • Added unit test that fails before this change and passes afterwards.
  • Confirmed in manual test that a version with two generators sent only one version completion notification. That same patch created two notifications if I didn't deploy my fix.

@Kimchelly Kimchelly changed the title Devprod 8000 generated tasks notification DEVPROD-8000: fix duplicate notification for generate.tasks Jan 9, 2025
@Kimchelly Kimchelly requested a review from a team January 9, 2025 21:11
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.

1 participant