jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Fixes and Extends BibliographyConsistencyCheck.check to Handle Custom Entry Types

Open Hrishi-Baskaran opened this issue 3 months ago • 6 comments

Closes #13794

The current implementation of BibliographyConsistencyCheck.check is only aware of standard entry types of both BibTex and BibLaTex. The current implementation is not able to handle scenarios where the user defines a custom bibliography entry type. In this PR, BibliographyConsistencyCheck.check will be modified to handle consistency checks involving custom entry types in addition to new unit tests to cover the check for a variety of mocked custom entry types.

In my current progress, I have just modified the method signature of the check to include a BibEntryTypesManager object as a parameter. I've modified the code of the check to use this object to gather type definitions - which includes any custom definitions the user added to a manager object. I have also modified test cases in BibliographyConsistencyCheckTest to mock BibEntryTypesManager. So far, in my mocks, I have not added custom entry types to the manager when testing nor have I added new test cases.

Next I plan to add specific unit tests that cover managers with different entry types. I also need to figure a way to dependency inject the application's BibEntryTypesManager when the check is called by a user action and not by a unit test with a mock BibEntryTypesManager.

Steps to test

One can test this feature by running the tests in BibliographyConsistencyCheckTest

Mandatory checks

  • [x] I own the copyright of the code submitted and I license it under the MIT license
  • [ ] I manually tested my changes in running JabRef (always required)
  • [x] I added JUnit tests for changes (if applicable)
  • [ ] I added screenshots in the PR description (if change is visible to the user)
  • [ ] I described the change in CHANGELOG.md in a way that is understandable for the average user (if change is visible to the user)
  • [ ] I checked the user 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 updating file(s) in https://github.com/JabRef/user-documentation/tree/main/en.

Hrishi-Baskaran avatar Nov 08 '25 04:11 Hrishi-Baskaran

Hey @Hrishi-Baskaran!

Thank you for contributing to JabRef! Your help is truly appreciated :heart:.

We have automatic checks in place, based on which you will soon get automated feedback if any of them are failing. We also use TragBot with custom rules that scans your changes and provides some preliminary comments, before a maintainer takes a look. TragBot is still learning, and may not always be accurate. In the "Files changed" tab, you can go through its comments and just click on "Resolve conversation" if you are sure that it is incorrect, or comment on the conversation if you are doubtful.

Please re-check our contribution guide in case of any other doubts related to our contribution workflow.

github-actions[bot] avatar Nov 08 '25 04:11 github-actions[bot]

Please ensure the automatic check are green, otherwise no human will review it

Siedlerchr avatar Nov 12 '25 18:11 Siedlerchr

Please ensure the automatic check are green, otherwise no human will review it

Thanks for telling me about this. I will update this on Friday.

Hrishi-Baskaran avatar Nov 12 '25 20:11 Hrishi-Baskaran

This PR is being closed due to continued inactivity.

github-actions[bot] avatar Dec 04 '25 03:12 github-actions[bot]

Hello I'm very sorry about being inactive. I was going through a lot of other work I had to do and was planning on contributing again this weekend. Would it be possible to re-open this PR?

Hrishi-Baskaran avatar Dec 04 '25 04:12 Hrishi-Baskaran

@Hrishi-Baskaran Thank you for coming back and working on this.

Question: Why did you not add a test case for the bib entry given in the issue description?

image

Reason: It would be good to have a test case for a real world example. DBLP is a very large bib data provider.

koppor avatar Dec 19 '25 01:12 koppor