-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Reverse PR Comments Order #4005
Conversation
I think I have all the config settings in place. I just need to know how to read the config setting in the various clients to make the logic conditional. |
This is not something I've seen personally on GitHub. Which VCS do you use? Maybe this issue is specific to that one? In that case, I'd approach this as a bug and make the correct way the new default. Not sure what the maintainers think? |
Have you had PR comments larger than 65k? |
I've had plans spanning multiple comments, so I guess so. |
@@ -137,6 +137,8 @@ func (b *Client) CreateComment(repo models.Repo, pullNum int, comment string, co | |||
sepEnd := "\n```\n**Warning**: Output length greater than max comment size. Continued in next comment." | |||
sepStart := "Continued from previous comment.\n```diff\n" | |||
comments := common.SplitComment(comment, maxCommentLength, sepEnd, sepStart) | |||
common.ReverseComments(comments) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of 1.21 (which atlantis uses), go has a standard library module slices
for generic slice operations, including Reverse()
. I'd recommend this be used and the test removed.
common.ReverseComments(comments) | |
slices.Reverse(comments) |
@brandon-fryslie, you mentioned in #3905 frequently having output split across multiple comments; do you have an opinion about whether the current ordering should be default, the reverse, or if it should be configurable? |
This issue is stale because it has been open for 1 month with no activity. Remove stale label or comment or this will be closed in 1 month. |
what
This PR reverses the order of PR comments so that when they are posted to a PR, they will read from top to bottom as a logical block.
why
Assume there is a big terraform long that will be posted and it will be donme as 2 separate comments. The current behavior will post comments block 3, then 2 and finally 1. his causes users to need to scroll to the 1st comment block, read down, then scroll back up past the beginng of the 1st block and to find the beginiing of block 2 and read down, then repeat that process for block 3.
tests
There is a simple function that just reverses the slice array and there's a test for that function. We have also been running this in production for 1.5 years with 100's of PR builds a day.
references