-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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: use comments if PR body is too long #31616
base: main
Are you sure you want to change the base?
feat: use comments if PR body is too long #31616
Conversation
…ionPr() throws' tests
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.
Previously smartTruncate()
was exclusively a platform concept and used only in platform modules. With this PR it's now used in many places with lib/workers, which seems undesirable.
Did you try solving this in the platform only, to avoid this undesirable mixing of logic?
I understand your point regarding After initally looking at the code, it seemed easier to fix this problem for all platforms. While I think it is probably still better to adjust this for all platforms to ensure that no information is lost. In our tests we have had some PRs which were larger than 150000 characters, which would be larger than other length limits as well (e.g. bitbucket 50000) As another Solution, we could maybe create a second function, like |
The key question is: does the worker layer need to have any awareness of how the PR body content is being split up? If not then this capability should be isolated to the platform layer. |
The alternative solution would be to have I think both ways have some drawbacks: As it is now:
Alternative solution:
|
Changes
While creating PRs it is now checked if the maximum body length of the platform fits the whole PR body.
When the body is longer, some parts of the body are moved into comments.
For Onboarding PRs first the PR list is moved to the comments, and if the body is still too large, also the Detected Package Files are moved into comments.
For Update PRs first the changelog is moved to the comments, and if the body is still too large, also the Update Table is moved into comments.
If the body is still too long, it will be truncated, like it is now. Also if the platform limit for comment length is met, the comments are also truncated
Context
Our Team recently added renovate and we instantly noticed that the PR Body was missing information as the body limit on azure devops is 4000 characters.
Then we found this discussion with the idea to put some parts of the body into comments.
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: