내용으로 건너뛰기

Formatting on comments on pull requests: CloudFormation Git Sync (Bitbucket)

-1

Good Morning,

When enabling Git Sync on CloudFormation, you can set it so that a comment is added showing a summary of the changes. On Bitbucket, when this information is split over over 2 comments, the formatting in the second comment is broken:

Example PR showing issue

Is there any way to resolve this?

Thanks, Robert

질문됨 2달 전43회 조회

2개 답변
1

While there is no direct setting to fix the formatting, this issue typically occurs when the change set is too large for a single Bitbucket comment. To mitigate this, you can:

  • Modularize your templates: Breaking large stacks into smaller, nested stacks can reduce the size of the summary table.
  • Verify in Console: Use the "Change Sets" tab in the AWS CloudFormation Console for a full, correctly formatted view of the planned changes when the Bitbucket comment fails.

PS: The formatting break occurs because Bitbucket's character limit forces the comment to split, which interrupts the Markdown table structure. Since the second comment lacks the header definition, it is rendered as plain text.

전문가

답변함 2달 전

  • The formatting break occurs because Bitbucket's character limit forces the comment to split, which interrupts the Markdown table structure. Since the second comment lacks the header definition, it is rendered as plain text.

    Checking the raw content; while you are correct the multiple comments are due to when the charge set needs the comment to be split; checking the raw content for each comment then the header is present in each case. The only thing I can see that is different is the first comment has an empty line before the table while the second comment doesn't - so I suspect this might break how Bitbucket renders it:

    First Comment:

    ...
    Summary: **14** resources created, **1** resources deleted, **0** resources updated
    
    | **Action**                                         | **LogicalResourceId**...
    

    Second Comment:

    > **Continued**
    
    Comment # 2 of 2
    Stack: ------------
    | **Action**                                         | **LogicalResourceId**...
    
0

Based on the available information about CloudFormation Git Sync's comment on pull request feature, there isn't a documented way to control or fix the formatting when comments are split across multiple messages in Bitbucket.

The "Enable comment on pull request" feature is designed to post a summary of stack changes through the CodeConnections service, describing the differences between the current stack configuration and proposed changes, including resources that will be added, modified, or deleted. However, the documentation doesn't address formatting issues that may occur when comments exceed length limits and are split across multiple comments in specific Git providers like Bitbucket.

This appears to be a limitation or potential bug in how CloudFormation formats continuation comments when the change summary is too large for a single comment. I'd recommend reporting this issue to AWS Support so they can investigate the formatting problem specific to Bitbucket and potentially address it in a future update. In the meantime, you may need to work with the broken formatting in the second comment or consider disabling the feature if the formatting issues significantly impact your workflow.
Sources
Enable CloudFormation to post a summary of stack changes in pull requests - AWS CloudFormation
How Git sync works with CloudFormation - AWS CloudFormation

답변함 2달 전

전문가

검토됨 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠