docker-tools icon indicating copy to clipboard operation
docker-tools copied to clipboard

PostPublishNotification command should not depend on the displayName of individual stages

Open lbussell opened this issue 8 months ago • 0 comments

This is needed before Add a common prefix to all pipeline stages that aren't injected by 1ES pipeline templates (#1696) can be implemented.

The PostPublishNotification command depends on the displayName of individual stages:

https://github.com/dotnet/docker-tools/blob/f4c1d804fe90a050da4e087481687d00d829fa93/eng/common/templates/jobs/publish.yml#L199-L208

Instead, it should depend on the name of the stages which is independent of the displayName.

PostPublishNotification gets the build timeline from the Azure DevOps API:

https://github.com/dotnet/docker-tools/blob/41c28c39060023a762fc3ee2d2b8bd399274b4ed/src/Microsoft.DotNet.ImageBuilder/src/Commands/PostPublishNotificationCommand.cs#L151

Here is an example timeline (internal link): https://dev.azure.com/dnceng/internal/_apis/build/builds/2703129/timeline

An individual task might look like this:

    {
      "previousAttempts": [],
      "id": "<guid>",
      "parentId": "<another guid>",
      "type": "Task",
      "name": "Publish Readmes", // this is the displayName
      "refName": "PublishReadmes", // this is the name
      "startTime": "2025-05-06T17:55:34.6033333Z",
      "finishTime": "2025-05-06T17:55:39.9666667Z",
      "currentOperation": null,
      "percentComplete": null,
      "state": "completed",
      "result": "succeeded",
      "resultCode": null,
      // ...bunch of other properties
    },

If we could get at the refName property, then we could use that instead of the displayName/name.

lbussell avatar May 06 '25 20:05 lbussell