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

Create a Summary/Markdown file or report from pulumi preview/up #87

Open tap1992 opened 2 years ago

tap1992 commented 2 years ago

Is your feature request related to a problem? Please describe. Currently visability of changes in Pulumi preview or Pulumi up isn't very good due to the way Azure Pipelines works, they are currently only visable within the task logs which requires diving into a few drop downs

Describe the solution you'd like Generate a Summary/Markdown file from the output that is generated from the Pulumi preview or Pulumi up commands. This would help with visability of the changes as Azure Pipelines adds Summary files as a seperate tab at the pipeline run overview. This would remove the need for a user to dive into individual task logs.

Describe alternatives you've considered Diving into the task logs is the only alternative.

danielrbradley commented 2 years ago

cc: @pulumi/platform

zbuchheit commented 2 years ago

I also would like to do something similar. I’d like to take the preview results and comment them onto a pr in my CICD workflow. In order to do so I would need to support Pulumi preview —json to a variable and then inject that into the pr comment.

RobbieMcKinstry commented 2 years ago

I'm going to look into this ticket. I'm new to the Pulumi team; thank you for your patience with me as I come up to speed. At first blush, I think the plan is to use the --json flag to store the preview in a file, then convert the JSON into Markdown.

RobbieMcKinstry commented 2 years ago

Hi @zbuchheit. Hmm, without making any commitments, that sounds like something I could explore when I look into this ticket. However, it looks like a duplicate of #60. Do you agree that #60 would satisfy your use case?

zbuchheit commented 2 years ago

Yeah that looks like it is similar/a duplicate. Ultimately I’d like to do what is available in GitHub actions today with the comment on pr functionality. Maybe that’s a better explanation on the feature I actually want. Outputting the json would be good and I could implement that feature myself but would be nice to have it automatically do it for me like in GitHub actions.

I’m not sure if there’s a plan to implement this on azure pipelines but here is a link to the feature in GitHub actions that I’d like.

https://www.pulumi.com/docs/guides/continuous-delivery/github-actions/#comments-by-github-actions

praneetloke commented 2 years ago

I think there are two feature requests being discussed here: 1.) showing a summary tab with the Pulumi logs and 2.) the task should add a comment containing the Pulumi command logs to the PR (#110) (I am working on #110.)

1.) It seems to be possible by specifying an additional entry in the contributions array of the extension manifest file called vss-extensions.json (found in the root of this repo.) Funny enough, I couldn't find official documentation of the available contribution IDs. I had to look at Snyk's own Azure Pipelines task extension to get an idea of what was done there. Their vss-extension.json file specifies the additional tab that you see in the screenshot in this issue's description. I couldn't find this info in the official documentation that I was looking at. Snyk runs their test results through some sort of a custom conversion tool that outputs a nicely formatted HTML which is what they show in their "Snyk Report" tab. BrowserStack's task extension is closed-source so I couldn't examine theirs.

EDIT: I found the place where the contribution IDs are documented! They are called Extension Points. I couldn't find a link from the contribution ID documentation to extension points page.

Additional refs https://docs.microsoft.com/en-us/azure/devops/extend/develop/add-build-task?view=azure-devops https://docs.microsoft.com/en-us/azure/devops/extend/develop/manifest?view=azure-devops#contributionTargets https://docs.microsoft.com/en-us/azure/devops/extend/develop/contributions-overview?source=recommendations&view=azure-devops

2.) I'll post an update in #110 for this.

tap1992 commented 1 year ago

Any update on when this might be implemented please?

RobbieMcKinstry commented 1 year ago

Nothing in progress at this time, sorry! We're always willing to accept community contributions, which can help speed up the process, but as of this sprint we haven't scheduled this issue