-
- Notifications
You must be signed in to change notification settings - Fork 3k
New study.yml format #13844
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
New study.yml format #13844
Conversation
…ns from the current study.yml version to the new one
…n and parsing of study.yml if needed
…r to avoid deadlock
…igrator to JSpecify annotations
…nstead of StudyYamlParser
…ith the rest of the codebase
… from getCatalogSpecific form StudyQuery
| @@ -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; | |||
There was a problem hiding this comment.
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( | |||
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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.
jablib/src/main/java/org/jabref/logic/crawler/StudyYamlV1Migrator.java Outdated Show resolved Hide resolved
| | ||
| if (CURRENT_VERSION.equals(version)) { | ||
| // Already current version, read the file normally | ||
| try (InputStream fileInputStream = Files.newInputStream(studyYamlFile)) { |
There was a problem hiding this comment.
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.
jablib/build.gradle.kts Outdated
| 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") |
There was a problem hiding this comment.
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 left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm so far
Version in versions/build.gradle is required.
calixtus left a comment
There was a problem hiding this 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)
* 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 | ||
| */ | ||
| |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
| 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 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. |

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:
title: title
research-questions:
queries:
description: null
lucene: null
catalogue-specific: null
catalogues:
enabled: true
metadata:
notes: null
created-date: null
last-modified: null
Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)