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 12354 title should not contain url #12431

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

Conversation

RapidShotzz
Copy link

Describe the changes you have made here: what, why, ...
Link the issue that will be closed, e.g., "Closes #333". If your PR closes a koppor issue, link it using its URL, e.g., "Closes JabRef#47".

Issue closes #12354 and the link: #12354

We have flagged full URLs that are not supposed to appear in the title and booktitle fields by displaying an error message to inform the user. Regex is used to identify keywords for this

To avoid false positives and incorrect flagging, we accept titles that mention website names as part of the topic e.g. Applying Trip@dvice Recommendation Technology to www.visiteurope.com.

The integrity check focuses on ensuring that URLs which have a start structure of http://, https:// or www. are not mistakenly included in the title/booktitle fields. In terms of minimising false positives, the check only flags full URLs that are followed by a path and will avoid flagging domain names or references that are linked to valid research titles.

Mandatory checks

  • I own the copyright of the code submitted and I licence it under the MIT license
  • [x ] Change in CHANGELOG.md described in a way that is understandable for the average user (if change is visible to the user)
  • [x ] Tests created for changes (if applicable)
  • [ x] Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • [x ] Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • [ x] Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

RapidShotzz added 2 commits January 29, 2025 10:29
…L, a URL that is a false positive or a URL that is accepted in the title or booktitle
…n the Title and BookTitle inputs. Also added tests to identify whether a URL refers to a domain for the Title and BookTitle.
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

JUnit tests are failing. In the area "Some checks were not successful", locate "Tests / Unit tests (pull_request)" and click on "Details". This brings you to the test output.

You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

JUnit tests are failing. In the area "Some checks were not successful", locate "Tests / Unit tests (pull_request)" and click on "Details". This brings you to the test output.

You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

JUnit tests are failing. In the area "Some checks were not successful", locate "Tests / Unit tests (pull_request)" and click on "Details". This brings you to the test output.

You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

JUnit tests are failing. In the area "Some checks were not successful", locate "Tests / Unit tests (pull_request)" and click on "Details". This brings you to the test output.

You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.

Copy link
Member

@LinusDietz LinusDietz left a comment

Choose a reason for hiding this comment

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

I think that this PR generally goes into the right direction.

  • I would simplify the message to the user, maybe @JabRef/developers have another suggestion?
  • As far as I see the checker for a DOMAIN_ONLY_PATTERN does not do anything? Would the functionality be still the same if you removed those checks?

@@ -40,6 +45,14 @@ public Optional<String> checkValue(String value) {
return Optional.empty();
}

if (FULL_URL_PATTERN.matcher(value).find()) {
return Optional.of(Localization.lang("The title contains a full URL which is forbidden"));
Copy link
Member

Choose a reason for hiding this comment

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

I would keep the message simple: The title contains a URL

return Optional.of(Localization.lang("The book title contains a full URL which is forbidden"));
}

if (DOMAIN_ONLY_PATTERN.matcher(value).find()) {
Copy link
Member

Choose a reason for hiding this comment

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

why do you check this case? It seems unnecessary to me.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

JUnit tests are failing. In the area "Some checks were not successful", locate "Tests / Unit tests (pull_request)" and click on "Details". This brings you to the test output.

You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

JUnit tests are failing. In the area "Some checks were not successful", locate "Tests / Unit tests (pull_request)" and click on "Details". This brings you to the test output.

You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.

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