Skip to content

Conversation

@turhantolgaunal
Copy link
Contributor

@turhantolgaunal turhantolgaunal commented Sep 9, 2025

Closes #12642

The study.yml is refactored to a new format to implement SEMVER versioning, variable 'databases' is renamed to 'catalogues' for UI consistency.

In the course of working on this draft pull request the query structure is planned to be enhanced to support multiple query formats including catalog-specific variations.

Steps to test

The study.yml file created when a new slr is started should be in a new format and slr search should function as intended.
New format is:
version: 2.0
authors:

  • author
    title: title
    research-questions:
  • question
    queries:
  • query: (author="author" AND title="title")
    description: null
    lucene: null
    catalogue-specific: null
    catalogues:
  • name: ArXiv
    enabled: true
    metadata:
    notes: null
    created-date: null
    last-modified: null

Mandatory checks

  • 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)
  • 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.
@turhantolgaunal turhantolgaunal changed the title Reformatted database variable to catalogue New study.yml format Sep 9, 2025
@@ -8,7 +8,7 @@
import org.jabref.logic.importer.ImportFormatPreferences;
import org.jabref.logic.importer.ImporterPreferences;
import org.jabref.model.study.Study;
import org.jabref.model.study.StudyDatabase;
import org.jabref.model.study.StudyCatalog;
Copy link

Choose a reason for hiding this comment

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

The import statement for StudyCatalog is correct, but the patch does not address the need to use JavaFX ObservableLists for better practice in managing lists in JavaFX applications.

@@ -92,14 +92,14 @@ void studyConstructorFillsDatabasesCorrectly(@TempDir Path tempDir) {
}

private ManageStudyDefinitionViewModel getManageStudyDefinitionViewModel(Path tempDir) {
List<StudyDatabase> databases = List.of(
new StudyDatabase("ACM Portal", true));
List<StudyCatalog> catalogs = List.of(
Copy link

Choose a reason for hiding this comment

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

The code uses List.of() which is correct, but it does not utilize JavaFX ObservableLists, which is considered best practice for managing lists in JavaFX applications.

StudyYamlParser studyYAMLParser = new StudyYamlParser();
studyYAMLParser.writeStudyYamlFile(newStudy, studyRepositoryRoot.resolve(StudyRepository.STUDY_DEFINITION_FILE_NAME));
StudyYamlService studyYamlService = new StudyYamlService();
studyYamlService.writeStudyYamlFile(newStudy, studyRepositoryRoot.resolve(StudyRepository.STUDY_DEFINITION_FILE_NAME));
Copy link

Choose a reason for hiding this comment

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

The method writeStudyYamlFile should ensure it does not return null. If it does, it should use java.util.Optional to handle potential null values.


if (CURRENT_VERSION.equals(version)) {
// Already current version, read the file normally
try (InputStream fileInputStream = Files.newInputStream(studyYamlFile)) {
Copy link

Choose a reason for hiding this comment

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

The try block covers the entire method, which is against best practices. It should cover as few statements as possible to minimize the scope of potential exceptions.

implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
// TODO: Somwewhere we get a warning: unknown enum constant Id.CLASS reason: class file for com.fasterxml.jackson.annotation.JsonTypeInfo$Id not found
// implementation("com.fasterxml.jackson.core:jackson-annotations:2.19.1")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.15.2")
Copy link
Member

@Siedlerchr Siedlerchr Oct 14, 2025

Choose a reason for hiding this comment

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

Put the version in versions/build.gradle

Siedlerchr
Siedlerchr previously approved these changes Oct 14, 2025
Copy link
Member

@Siedlerchr Siedlerchr left a comment

Choose a reason for hiding this comment

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

lgtm so far

@Siedlerchr Siedlerchr requested a review from koppor October 14, 2025 17:57
@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Oct 14, 2025
@calixtus calixtus dismissed Siedlerchr’s stale review October 14, 2025 19:08

Version in versions/build.gradle is required.

@Siedlerchr Siedlerchr enabled auto-merge October 20, 2025 18:44
Siedlerchr
Siedlerchr previously approved these changes Oct 20, 2025
@Siedlerchr Siedlerchr added this pull request to the merge queue Oct 20, 2025
@Siedlerchr Siedlerchr removed this pull request from the merge queue due to a manual request Oct 20, 2025
Copy link
Member

@calixtus calixtus left a comment

Choose a reason for hiding this comment

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

Small issue about lucene open, but to move forward should be merged and done in a followup.

* upstream/main: Revert "Issue676 author last (JabRef#13625)" (JabRef#14123) Issue676 author last (JabRef#13625)
@Siedlerchr Siedlerchr enabled auto-merge October 20, 2025 19:24
@Siedlerchr Siedlerchr added this pull request to the merge queue Oct 20, 2025
Merged via the queue into JabRef:main with commit db1e651 Oct 20, 2025
47 checks passed
@github-actions github-actions bot mentioned this pull request Oct 20, 2025
Siedlerchr added a commit to Yubo-Cao/jabref that referenced this pull request Oct 20, 2025
* upstream/main: New study.yml format (JabRef#13844) Separate issue linking workflows, make them run on `edited` (JabRef#14121)
* Provides common functionality for version detection
* and handles the migration process
*/

Copy link
Member

Choose a reason for hiding this comment

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

Why emtpy line here?

}

@Test
void migrateEmptyStudySuccessfully() throws IOException {
Copy link
Member

Choose a reason for hiding this comment

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

Wrong approach, there should be two YAML files compared. Not input. YAML content and output: data model.

koppor added a commit that referenced this pull request Oct 30, 2025
@koppor
Copy link
Member

koppor commented Oct 30, 2025

We reverted this PR as not everything from the issue was done. We want to have a new intermediate release - and we cannot include some unfinished work. Sorry @turhantolgaunal that we are currently understaffed for this and you did not get any feedback in time. Maybe, another contributor builds on your work.

The last two bullets points of the issue were not done

Image

Moreover, tests were missing reading in the new YAML file structure.

Tests should also go from strings to strings - not from strings to data model and vice versa.

github-merge-queue bot pushed a commit that referenced this pull request Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers

4 participants