Saltar al contenido

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

preguntada hace 2 meses43 visualizaciones

2 Respuestas
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.

EXPERTO

respondido hace 2 meses

  • 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

respondido hace 2 meses

EXPERTO

revisado hace 2 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.