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

Set showEnvironmentVariables to true for the pipeline task #150

Closed praneetloke closed 11 months ago

praneetloke commented 1 year ago

Release pipelines in Azure DevOps are UI-based unlike build pipelines which are primarily configured using YAML and allows for env vars to be passed using the YAML key env: for all tasks. This task extension can be used in both build and release pipelines. Setting showEnvironmentVariables to true will now show an Environment Variables configuration panel only in the Releases view. In the regular build pipeline, no new panel is added (can provide a screenshot of that too if needed.)

For additional context, see: https://pulumi-community.slack.com/archives/CRVK66N5U/p1700433168859369

I installed a private version of the extension with these changes into my own DevOps organization and can confirm that I now see the new panel:

Screenshot ![Screenshot 2023-11-20 at 09-13-26 New release pipeline - Pipelines](https://github.com/pulumi/pulumi-az-pipelines-task/assets/1466314/ac2023fb-5763-400e-8ec4-fd4ea1ef2f6b)

Thank you for contributing! Before submitting your PR, can you please confirm that you have done the following?

praneetloke commented 11 months ago

@justinvp merging this PR and releasing a new patch version would fix an issue for a user who reported this issue originally. It would be awesome to get this merged soon.

Also, once this is merged and released I'll also open a new PR that will upgrade some dependencies that have become stale.

praneetloke commented 11 months ago

Thank you for merging this, @justinvp!

It looks like the CI build failed. I can't see why but I am suspecting it might be due to the step where the pipeline installs tfx-cli using TfxInstaller. Looking at the source code for that extension, it appears v2 is no longer there? I see that the last successful CI job was back in June, so I am not sure if they removed that major version at some point after that. There is now a v3 and a v4 though.

justinvp commented 11 months ago

Thanks for the heads-up @praneetloke!

The TfxInstaller step succeeded. This is the failure:

2023-11-29T08:02:32.9894318Z ##[section]Starting: QueryAzureDevOpsExtensionVersion
2023-11-29T08:02:32.9899721Z ==============================================================================
2023-11-29T08:02:32.9900193Z Task         : Query Extension Version
2023-11-29T08:02:32.9900442Z Description  : Queries the current version from the Visual Studio Marketplace
2023-11-29T08:02:32.9900891Z Version      : 2.0.19
2023-11-29T08:02:32.9901065Z Author       : Microsoft Corporation
2023-11-29T08:02:32.9901343Z Help         : 
2023-11-29T08:02:32.9901491Z ==============================================================================
2023-11-29T08:02:33.2374147Z [command]/opt/hostedtoolcache/tfx/0.8.3/x64/node_modules/.bin/tfx extension show --json --no-color --service-url https://marketplace.visualstudio.com/ --auth-type pat --token *** --publisher pulumi --extension-id build-and-release-task 0 [ '[command]/opt/hostedtoolcache/tfx/0.8.3/x64/node_modules/.bin/tfx extension show --json --no-color --service-url https://marketplace.visualstudio.com/ --auth-type pat --token *** --publisher pulumi --extension-id build-and-release-task',
2023-11-29T08:02:33.2378089Z   '' ]
2023-11-29T08:02:33.2379998Z  1 [ '[command]/opt/hostedtoolcache/tfx/0.8.3/x64/node_modules/.bin/tfx extension show --json --no-color --service-url https://marketplace.visualstudio.com/ --auth-type pat --token *** --publisher pulumi --extension-id build-and-release-task',
2023-11-29T08:02:33.2381459Z   '' ]
2023-11-29T08:02:33.5319084Z (node:1970) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency 0 [ '(node:1970) Warning: Accessing non-existent property \'padLevels\' of module exports inside circular dependency',
2023-11-29T08:02:33.5322239Z   '(Use `node --trace-warnings ...` to show where the warning was created)',
2023-11-29T08:02:33.5323277Z   '' ]
2023-11-29T08:02:33.5325293Z (Use `node --trace-warnings ...` to show where the warning was created) 1 [ '(node:1970) Warning: Accessing non-existent property \'padLevels\' of module exports inside circular dependency',
2023-11-29T08:02:33.5326926Z   '(Use `node --trace-warnings ...` to show where the warning was created)',
2023-11-29T08:02:33.5327466Z   '' ]
2023-11-29T08:02:33.5328205Z  2 [ '(node:1970) Warning: Accessing non-existent property \'padLevels\' of module exports inside circular dependency',
2023-11-29T08:02:33.5329161Z   '(Use `node --trace-warnings ...` to show where the warning was created)',
2023-11-29T08:02:33.5329703Z   '' ]
2023-11-29T08:02:33.8215501Z error: Received response 401 (Not Authorized). Check that your personal access token is correct and hasn't expired. 0 [ 'error: Received response 401 (Not Authorized). Check that your personal access token is correct and hasn\'t expired.',
2023-11-29T08:02:33.8217732Z   '' ]
2023-11-29T08:02:33.8219464Z  1 [ 'error: Received response 401 (Not Authorized). Check that your personal access token is correct and hasn\'t expired.',
2023-11-29T08:02:33.8220471Z   '' ]
2023-11-29T08:02:33.8290519Z  0 [ '', '' ]
2023-11-29T08:02:33.8291348Z  1 [ '', '' ]
2023-11-29T08:02:33.8369658Z ##[error]Error: The process '/opt/hostedtoolcache/tfx/0.8.3/x64/node_modules/.bin/tfx' failed with exit code 255
2023-11-29T08:02:33.8380044Z ##[section]Finishing: QueryAzureDevOpsExtensionVersion

Any ideas what to fix?

praneetloke commented 11 months ago

@justinvp ah! Looks like this is the culprit:

2023-11-29T08:02:33.8215501Z error: Received response 401 (Not Authorized). Check that your personal access token is correct and hasn't expired. 0 [ 'error: Received response 401 (Not Authorized). Check that your personal access token is correct and hasn\'t expired.',

There is a PAT configured for the pipeline to be able to query the VS Marketplace. Looks like that has expired. Let me know if you would like to hop on a call and sort it out together. Glad to help!

praneetloke commented 11 months ago

@justinvp ping.

justinvp commented 11 months ago

Let me know if you would like to hop on a call and sort it out together

That would be great! Thanks @praneetloke! Do you have any time Wednesday?