Skip to content
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

fix(gitlab): smart truncate comments #30580

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

amishk783
Copy link

@amishk783 amishk783 commented Aug 4, 2024

Changes

Context

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@CLAassistant
Copy link

CLAassistant commented Aug 4, 2024

CLA assistant check
All committers have signed the CLA.

@amishk783 amishk783 changed the title fixed comment length bug fix: fixed comment length bug #30551 Aug 4, 2024
Copy link
Collaborator

@RahulGautamSingh RahulGautamSingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trunacate the body content before we compute commentNeedsUpdating. Else, we will compare full body content with comment body we fetch from api. And, the fetched body will be truncated whereas full body (from fn param) won't.

This will cause the comment to be updated each time.

@viceice viceice changed the title fix: fixed comment length bug #30551 fix(gitlab): smart truncate comments Aug 5, 2024
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See conversation

@amishk783
Copy link
Author

Hi Rahul, Thanks for the guidance. I’ve moved smartTruncate(body, maxBodyLength()) before the commentNeedsUpdating check in the if-else case and will push the changes shortly.

@henry-fn

This comment has been minimized.

@viceice

This comment has been minimized.

@amishk783
Copy link
Author

Thanks @amishk783 for the fix, anything blocking this being merged in?

required changes are not pushed. also CI falls, so merge isn't an option.

Hey, sorry for the delay. it completely slipped my mind. I've pushed the changes and addressed the feedback. Now truncating the body before checking commentNeedsUpdating

@henry-fn
Copy link
Contributor

Thanks @amishk783 for the fix, anything blocking this being merged in?

required changes are not pushed. also CI falls, so merge isn't an option.

Hey, sorry for the delay. it completely slipped my mind. I've pushed the changes and addressed the feedback. Now truncating the body before checking commentNeedsUpdating

Just in case you missed it, I think there is still one linting test failing https://github.com/renovatebot/renovate/actions/runs/10960183807/job/30434310107?pr=30580

@henry-fn
Copy link
Contributor

henry-fn commented Oct 4, 2024

@amishk783 poke on formatting here?

@rarkins rarkins requested a review from viceice October 9, 2024 19:28
@henry-fn
Copy link
Contributor

henry-fn commented Nov 4, 2024

Anything blocking merging here?

@rarkins
Copy link
Collaborator

rarkins commented Nov 5, 2024

@viceice please review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

platform(gitlab): comment length not truncated
6 participants