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

[MM-42669] Avoid superfluous error messages on some autolinks #201

Merged
merged 2 commits into from
Dec 2, 2022

Conversation

levb
Copy link
Contributor

@levb levb commented Nov 5, 2022

Summary

For historical reasons, the plugin was skipping autolinks that started with www and were not canonically formatted; it was also LogError-ing unnecessarily.

Also improved the code typography.

Ticket Link

#188
https://mattermost.atlassian.net/browse/MM-42669

@levb levb added the 2: Dev Review Requires review by a core committer label Nov 5, 2022
@levb levb requested review from jespino and hanzei November 5, 2022 12:48
@codecov-commenter
Copy link

codecov-commenter commented Nov 5, 2022

Codecov Report

Base: 40.79% // Head: 40.65% // Decreases project coverage by -0.14% ⚠️

Coverage data is based on head (e76f7d5) compared to base (0f44cfb).
Patch coverage: 90.24% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #201      +/-   ##
==========================================
- Coverage   40.79%   40.65%   -0.15%     
==========================================
  Files           6        6              
  Lines         679      674       -5     
==========================================
- Hits          277      274       -3     
+ Misses        382      380       -2     
  Partials       20       20              
Impacted Files Coverage Δ
server/autolinkplugin/plugin.go 93.33% <90.24%> (+1.33%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.


if changed {
post.Message = message
post.Hashtags, _ = model.ParseHashtags(message)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is now inside the if, looks like something that makes sense, because if I haven't change it, the original post should be having properly processes the hashtags already, but is a subtle change in the behavior and I just want to let you know to ensure that it is on purpose change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly. I think it was basically a bug/redundant before.

Copy link
Contributor

@jespino jespino left a comment

Choose a reason for hiding this comment

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

LGTM, really nice improvement in the code itself.

Copy link
Contributor

@hanzei hanzei left a comment

Choose a reason for hiding this comment

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

Very nice rewrite, LGTM 👍

@hanzei hanzei linked an issue Nov 10, 2022 that may be closed by this pull request
@levb levb added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core committer labels Nov 11, 2022
@levb
Copy link
Contributor Author

levb commented Nov 11, 2022

@DHaussermann 2/5 skip the QA on the PR, but do some release testing around "autolinks", i.e. URLs mixed into the text.

@hanzei hanzei added this to the v1.3.0 milestone Nov 22, 2022
@hanzei hanzei mentioned this pull request Nov 22, 2022
1 task
@hanzei hanzei changed the title avoid superfluous error messages on some autolinks [MM-42669] Avoid superfluous error messages on some autolinks Nov 22, 2022
@hanzei
Copy link
Contributor

hanzei commented Dec 2, 2022

Let's merge this and test it in release testing

@hanzei hanzei merged commit 1a77ee3 into master Dec 2, 2022
@hanzei hanzei deleted the lev-autolink-did-not-match-range-text branch December 2, 2022 09:36
@hanzei hanzei mentioned this pull request Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autolink logs "Markdown autolink did not match range text"
4 participants