https://infracost.io logo
#help
Title
a

ancient-jewelry-73631

07/12/2023, 6:20 PM
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

busy-agent-35515

07/12/2023, 6:22 PM
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

ancient-jewelry-73631

07/12/2023, 6:25 PM
Just read through it, makes sense. Thanks @busy-agent-35515!
w

white-airport-8778

07/12/2023, 6:26 PM
@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

ancient-jewelry-73631

07/12/2023, 6:31 PM
Sure thing
@white-airport-8778 I have a suggestion for documentation - should I share it in #general?
w

white-airport-8778

07/12/2023, 6:34 PM
I do ~90% of the docs so you can just DM me 😄
a

ancient-jewelry-73631

07/21/2023, 6:44 PM
@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

white-airport-8778

07/21/2023, 7:08 PM
Oh wow - thank you @ancient-jewelry-73631 - I’ll review today and update our docs
a

ancient-jewelry-73631

07/21/2023, 7:09 PM
of course!
w

white-airport-8778

07/21/2023, 9:12 PM
@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

ancient-jewelry-73631

07/21/2023, 10:08 PM
@white-airport-8778 would this be for the base file?
w

white-airport-8778

07/21/2023, 10:44 PM
yep, since on branch pushes there is no diff, just the
infracost breakdown
from the branch itself
a

ancient-jewelry-73631

07/26/2023, 7:11 PM
@white-airport-8778 I see, I am using
comment
, which I believe takes care of that in one of the previous steps
w

white-airport-8778

07/26/2023, 7:19 PM
@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

ancient-jewelry-73631

07/26/2023, 7:21 PM
makes sense, thanks!