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(github): Massage links to issues, pulls or discussions #11214

Merged

Conversation

zharinov
Copy link
Collaborator

@zharinov zharinov commented Aug 11, 2021

Changes:

While replacing for all GitHub links turned to be painful, the more restricted subset (discussions, issues and pulls) should protect us from spamming mentioned repositories.

Context:

Closes #10902
Created instead of #11133

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 tick 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

@HonkingGoose
Copy link
Collaborator

Seems there's a problem with the Jest snapshots?

@zharinov
Copy link
Collaborator Author

Ah, thanks a lot. I've enfored preserving of whilte spaces code, which broke old snapshot.

@HonkingGoose
Copy link
Collaborator

Ah, thanks a lot. I've enfored preserving of whilte spaces code, which broke old snapshot.

You're welcome. By the way you also missed clicking the checkboxes in the PR body text. 😉

@zharinov zharinov marked this pull request as draft August 11, 2021 10:25
viceice
viceice previously approved these changes Aug 11, 2021
@rarkins
Copy link
Collaborator

rarkins commented Aug 11, 2021

What about users? if there's a link to https://github.com/rarkins in a PR body, will I get notified?

What I'm worried about is: can this make our linkback spam worse by accident?

@zharinov I've added your user URL to a PR in https://github.com/renovate-tests/pip-compile-1 - did you get a notification?

@zharinov
Copy link
Collaborator Author

zharinov commented Aug 11, 2021

What about users? if there's a link to https://github.com/rarkins in a PR body, will I get notified?
@zharinov I've added your user URL to a PR in https://github.com/renovate-tests/pip-compile-1 - did you get a notification?

Seems like it works only by using @ character. I received nothing via email or GitHub news feed.

What I'm worried about is: can this make our linkback spam worse by accident?

It shouldn't: it's just one more step added to our existing checks and replacements.
Though, we don't emit and return result from remarkjs anymore (i.e. parse -> tree replace -> emit).
Instead, I've walked the entire parsed tree, detected things that has to be changed, and then performed replacements based on offsets (i.e. parse -> detect -> string replace).
This should minimize PR edits once fix is released.

@zharinov zharinov marked this pull request as ready for review August 11, 2021 13:15
@zharinov zharinov requested a review from viceice August 11, 2021 13:15
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.

Beside types LGTM

lib/platform/github/massage-markdown-links.ts Outdated Show resolved Hide resolved
viceice
viceice previously approved these changes Aug 11, 2021
@viceice viceice requested a review from rarkins August 11, 2021 15:36
@viceice viceice enabled auto-merge (squash) August 13, 2021 06:16
@viceice viceice merged commit 6ec4e2b into renovatebot:main Aug 13, 2021
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 25.72.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Renovate spam GitHub issues
5 participants