Skip to content

JobMonitor: Don't reprocess previously processed jobs on reruns#17041

Open
premun wants to merge 1 commit into
dotnet:mainfrom
premun:prvysoky/re-uploads
Open

JobMonitor: Don't reprocess previously processed jobs on reruns#17041
premun wants to merge 1 commit into
dotnet:mainfrom
premun:prvysoky/re-uploads

Conversation

@premun

@premun premun commented Jun 24, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings June 24, 2026 08:38
@premun premun changed the title JobMonitor: DO not reprocess previously processed jobs on reruns JobMonitor: Don't reprocess previously processed jobs on reruns Jun 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to prevent JobMonitor reruns (within the same build) from reprocessing Helix jobs that were already uploaded/processed previously, reducing duplicate uploads and noisy/misleading log output.

Changes:

  • Added a new unit test asserting that previously processed Helix jobs are not re-uploaded and do not re-emit “completed/processing” log lines.
  • Updated JobMonitorRunner.ReconcileCompletedJobAsync to early-return when a job is in ProcessedHelixJobs (in addition to WorkItemOutcomeJobs).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/JobMonitorRunnerTests.cs Adds coverage to ensure reruns don’t re-upload or re-log completion for previously processed jobs.
src/Microsoft.DotNet.Helix/JobMonitor/JobMonitorRunner.cs Attempts to skip reconciliation for jobs already marked processed to avoid duplicate logs/uploads on reruns.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +300 to 310
// Skip jobs whose results have already been uploaded — either earlier in this
// invocation (tracked via WorkItemOutcomeJobs) or by a previous monitor attempt
// for the same build (tracked via ProcessedHelixJobs, seeded on entry from the
// AzDO test-run name markers). Without this, a retried monitor invocation
// re-logs "Job X completed" and re-reports failed work-item console links for
// every job the prior attempt already finished, which is noisy and misleading.
if (_state.WorkItemOutcomeJobs.Contains(helixJob.JobName)
|| _state.ProcessedHelixJobs.Contains(helixJob.JobName))
{
return;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think that if a job is already processed as failed but can't be resbumitted, that would also be a failure.

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.

3 participants