Hi all, I'm using Bitbucket Pipelines + Jira and f...
# help
a
Hi all, I'm using Bitbucket Pipelines + Jira and for some reason all of the PRs are still showing up as "open" in Infracost Cloud, even though all of them have been merged. Jira plugin also shows the PRs as "open". Anything specific I need to do for BB to report back to Infracost the "merged" status?
b
Hello! Yes, you have to make a custom API request to update the PR status: https://www.infracost.io/docs/guides/source_control_benefits/
a
Just read through it, makes sense. Thanks @busy-agent-35515!
w
@ancient-jewelry-73631 when you get it working with Bitbucket Pipelines, can you possibly share your code snippet here so I can add it to the docs so the rest of the community benefits (of course we’d credit you).
a
Sure thing
@white-airport-8778 I have a suggestion for documentation - should I share it in #general?
w
I do ~90% of the docs so you can just DM me 😄
a
@white-airport-8778 here you go! The PR closing portion was done with @busy-agent-35515’s help
This is a slightly better version that checks whether the monthly cost will change before updating the base cost file on the master branch
and the simplest version which does not commit back to the repo but simply closes the PR in Infracost Cloud:
w
Oh wow - thank you @ancient-jewelry-73631 - I’ll review today and update our docs
a
of course!
w
@ancient-jewelry-73631 on pushes to the main/master branch, you can also run this so that branch’s costs (and tagging policy failures) are shown in the new Repos > myrepo > Default branch tab
Copy code
infracost upload --path=/tmp/infracost.json
a
@white-airport-8778 would this be for the base file?
w
yep, since on branch pushes there is no diff, just the
infracost breakdown
from the branch itself
a
@white-airport-8778 I see, I am using
comment
, which I believe takes care of that in one of the previous steps
w
@ancient-jewelry-73631 on main branch pushes, there is no
diff
or
comment
so you need to run
infracost breakdown
followed by
infracost upload
so the main branch costs show in the Repos > myrepo > Branches tab
The above is documented here
a
makes sense, thanks!