for production releases we would like to use tags ...
# pulumi-deployments
r
for production releases we would like to use tags to we can guarantee with deployments and any webhook deployments don't have unintended consequences but as of now it seems like the pulumi side of things appends
refs/heads
to everything that isn't doesnt have that prefixed, so when i use
refs/tags/v1.0.0
pulumi tries to fetch
refs/heads/refs/tags/v1.0.0
. Is there any way around this or any timeline on a fix?
r
Hey! Looks like you found https://github.com/pulumi/pulumi-cloud-requests/issues/328 which is the issue tracking this.
r
hi! yes i saw that but its been open since jan 2023 so i am assuming this is not on the radar? this severely deters the use of pulumi deployments imo. I am assuming its a very easy fix and additional check for whatever helper function that is doing the appending.
r
Definitely appreciate the feedback! The issue has indeed been open for a while but we haven't seen a lot of activity around it and so it hasn't been a top priority. Which isn't to say that it shouldn't be. The work is fairly straightforward, just needs to be prioritized. I'll bring it up in our next iteration's planning (next week)
r
i would greatly appreciate it, we built out a really good solution that we were planning to write a blog post about but if this doesnt work we would hae to get off pulumi deployments and just do it ourselves. I am sure others at some point would be on the same boat. Thank you for responding!
r
yup, totally hear you! I'm curious how you're creating deployment settings (api / web ui/ pulumi provider) - if you could add those details to the issue in a comment it'll help me prioritize the right fix to unblock you
r
we have a pulumi stack with the deployment settings, additionally to trigger various microstack deployments we use nx + some custom code to generate the affected microstacks within a project and then make a call to the pulumi api to trigger the respecting deployment. We pass in the $BRANCH variable which for our development env works fine as we use a main branch, but for production we need to use a tag and additionally our ci job updates the deployment settings for each microstack being deployed prior to each prod deployment to use the correct tag
Screenshot 2024-05-22 at 1.45.59 PM.png
the github actions stage above essentially calls this .sh script and passes the branch value to the curl command
and we get this error because the pulumi ci job keeps trying to add 'refs/heads'
so essentially what we would like to do is for that branch param be also able to pass in
refs/tags/<tagname>
so pulumi could fetch that source to use
and for the deployment settings we do something similar to the .sh script i posted above in terms of setting the branch (just do it in the stack code with a createDeploymentSettings helper function we wrote)
please let me know if you need any additional information! looking forward to the fix when it becomes available 🙏🏽
r
@rhythmic-pharmacist-98468 thanks for the info! I'm wondering if as a workaround currently you could use the commit hash instead of the tag. https://www.pulumi.com/registry/packages/pulumiservice/api-docs/deploymentsettings/#commit_yaml
r
ill take a look, thanks for that info! additionally out of curiosity is there currently a way to poll the deployments to see if it succeeded or not ?
r
> is there currently a way to poll the deployments to see if it succeeded or not yeah, there's a couple ways you could do this. you can either subscribe to webhooks (which is an alternative to polling). Or, you can call the getDeployment endpoint which includes the deployment's status.
r
thank you for the help @red-match-15116! really appreciate it
r
no problem, happy to help