This message was deleted.
# general
b
This message was deleted.
m
hey @hallowed-egg-85694 👋 , what platform are you trying to post a comment to?
b
I think
--format json
is missing
m
^
infracost breakdown --config-file infracost.yml --format json --out-file infracost.json
b
By default the
infracost breakdown
command will output a table view
h
@mysterious-teacher-68276 this was originally in CircleCI. I am running a dry run locally(mac) and it's a same issue - even if I generate a infracost.json using
infracost breakdown --config-file infracost.yml --format json --out-file infracost.json
. BTW comment is for bitbucket
b
Could you please show us the full comment command you're using?
It seems like this happens on API request to Bitbucket, the CLI receives a response but can't parse it for some reason
h
@busy-agent-35515
infracost breakdown --config-file infracost.yml --format json --out-file infracost.json
infracost comment bitbucket --path infracost.json --repo xxxx/xxxx --pull-request xxx --bitbucket-token xxxx:xxxxx --dry-run
m
@busy-agent-35515, I was talking to another user about this yesterday (who I believe might work with @hallowed-egg-85694) and they suspected it was because of the size of the
infracost.json
maybe above bitbucket api limits
b
FYI,
--dry-run
doesn't post anything to the PR, but it still tries to fetch PR's comments (the default behavior is
update
which gets the latest comment and updates it). Seems like the response is not a proper JSON
m
@hallowed-egg-85694 could you run a test where you generate an breakdown using the
examples/terraform
directory in
infracost
main repo and see if this fixes the issue.
@hallowed-egg-85694 - also might be easier for @busy-agent-35515 & I to jump on a call with you now to fix this over zoom if you are available?
b
Here's one way to test if CLI works well with the Bitbucket API: you can run this curl command to fetch PR's comments:
Copy code
export BITBUCKET_REPO=xxx/xxx
export BITBUCKET_PR_NUMBER=xx
export BITBUCKET_TOKEN=xx:xxx

curl \
-H 'Accept: application/json' \
-u $BITBUCKET_TOKEN \
<https://api.bitbucket.org/2.0/repositories/$BITBUCKET_REPO/pullrequests/$BITBUCKET_PR_NUMBER/comments>
g
Thanks @busy-agent-35515& @mysterious-teacher-68276 - we've managed to solve this. It turned out to be a mismatch with the bitbucket global name and bitbucket username!
👍 1
m
👍
great to hear @gorgeous-cpu-6996
🙌 1
party
b
How do you find the Bitbucket comments? Unfortunately, Bitbucket Server doesn't support emojis and other fancy markdown features, so we're using basic layout for now. If you think about anything to improve, we'll be happy to listen :)
👍 1