In my Bitbucket pipeline I have a slack notify pipeline:
- pipe: atlassian/slack-notify:2.0.1
variables:
WEBHOOK_URL: $SLACK_RELEASE_NOTES_WEBHOOK_URL
PRETEXT: $TITLE
MESSAGE: $MESSAGE
It works well for small messages, but if MESSAGE is large, for example the length of the Declaration of Independence the pipeline will fail with the error:
Notification failed. Pipe has finished with an error: 400 Client Error: Bad Request for url: $SLACK_RELEASE_NOTES_WEBHOOK_URL
This pipeline is for posting auto-generated release notes, and occasionally I require long release notes. How do I get around this issue?
@Steve Annett hi. Thanks for your question.
According to docs:
The text for the block. This field accepts any of the standard text formatting markup when type
is mrkdwn
. The minimum length is 1 and maximum length is 3000 characters.
So this is a Slack API limit.
Regards, Igor
Thanks for answering Igor.
So presumably if I switch to using the Slack Block Kit, I could have 50 blocks and give 3000 characters to each block?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't know, but you could check this case without pipe usage with just sending post requests.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can confirm that by using a custom payload created with Slack Block Kit and each section of test does not exceed 3000, I can get around the size limit
- pipe: atlassian/slack-notify:2.0.1
variables:
WEBHOOK_URL: $SLACK_RELEASE_NOTES_WEBHOOK_URL
MESSAGE: " "
PAYLOAD_FILE: payload.json
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.