pulumi / pulumi-az-pipelines-task

Azure Pipelines task extension for running Pulumi apps.
https://marketplace.visualstudio.com/publishers/pulumi
Apache License 2.0
27 stars 19 forks source link

After updating to Version 1.1 our release pipeline fails #118

Closed thoemmi closed 2 years ago

thoemmi commented 2 years ago

This morning we've updated the Pulumi DevOps Extension to version 1.1. Afterwards, our release pipeline fails with this error:

2022-09-28T06:30:09.5368088Z ##[error]Error: Job access token is required to create/update PR comment

As it turned out, the option Job access token is required to create/update is enabled by default. However, this doesn't make sense for release pipelines.

As a workaround, I now have to edit all of our release pipelines to disable this option.

JDetmar commented 2 years ago

We are seeing a similar issue after 1.1.0 upgrade. Our deployment pipelines are failing with the error Could not determine the PR ID. This version is a breaking change that requires us to edit our pipelines and explicitly add the configuration value: createPrComment: false

JDetmar commented 2 years ago

am I understanding that PR #113 is defaulting to comment to true? As shown here:

{
    "name": "createPrComment",
    "type": "boolean",
    "label": "Add the Pulumi log output as a PR comment",
    "defaultValue": "true",
    "helpMarkDown": "Check this option if you would like this task to add a comment to your PR (when applicable.) **Note**: Your project's build service user must have the `Contribute to pull requests` permission for this to work. Additionally, you must map the `System.AccessToken` variable as an env var for this task: `SYSTEM_ACCESSTOKEN: $(System.AccessToken)`.",
    "required": "false"
}
MitchellGerdisch commented 2 years ago

In case this helps others, until the referenced PR is pushed out, one can set the "createPrComment" property in the pipeline code as such:

- task: Pulumi@1
  inputs:
    azureSubscription: '$(serviceConnection)'
    stack: "$(pulumiOrg)/$(pulumiStack)"
    command: 'up'
    args: '--yes' 
    createStack: 'true' # create the stack if it does not already exist
    # This is not a PR pipeline and so I don't want it to try to add a PR comment.  
    createPrComment: 'false' 
  displayName: 'Pulumi Up'