Skip to content

SLR : Improved study.yml format (v2) and terminology alignment#15215

Merged
subhramit merged 43 commits into
JabRef:mainfrom
faneeshh:fix/slr-study-v2
May 16, 2026
Merged

SLR : Improved study.yml format (v2) and terminology alignment#15215
subhramit merged 43 commits into
JabRef:mainfrom
faneeshh:fix/slr-study-v2

Conversation

@faneeshh

@faneeshh faneeshh commented Feb 26, 2026

Copy link
Copy Markdown
Collaborator

Closes #12642 (hopefully)

This is basically a continuation of the work done in #13844. I'm starting with the foundational schema changed for the improved SLR support and I'm currently just gonna focus on getting the infrastructure right before diving into the actual fetcher logic.

Progress so far in the 1st Commit :

Terminology Alignment : Renamed StudyDatabase to StudyCatalog across the model and logic to match the UI and align with the domain language used in the repository
Schema Versioning : Added the version field to the Study model to support SEMVER (v2.0) which I feel is necessary for the migration

I'm attaching this rough sketch of how the data flow changes between the legacy format and the v2 format. I'm planning on creating a Migrator and string to string integration tests to ensure we don't break existing user studies

image

Checklist

  • 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 added a screenshot in the PR description showing a library with a single entry with me as author and as title the issue number
  • I described the change in CHANGELOG.md in a way that can be understood by the average user (if change is visible to the user)
  • I checked the user documentation for up to dateness and submitted a pull request to our user documentation repository

@faneeshh

Copy link
Copy Markdown
Collaborator Author

I've added the reason field directly into the StudyCatalog model. While it's not fully wired into the fxml yet in this specific commit I felt like having it in the data model would make sure that upcoming StudyYamlMigrator can handle the field mapping consistently from the start.

@testlens-app

This comment has been minimized.

@github-actions github-actions Bot mentioned this pull request Feb 26, 2026
@github-actions github-actions Bot added the status: changes-required Pull requests that are not yet complete label Feb 26, 2026
@testlens-app

This comment has been minimized.

@testlens-app

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Your pull request conflicts with the target branch.

Please merge with your code. For a step-by-step guide to resolve merge conflicts, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line.

@subhramit

Copy link
Copy Markdown
Member

For submodule conflicts see https://devdocs.jabref.org/code-howtos/faq.html#submodules

@subhramit

Copy link
Copy Markdown
Member

Refs #14170

@koppor

koppor commented Mar 17, 2026

Copy link
Copy Markdown
Member

I think, its OK for me to drop support for the old format. If anyone rasies their voice rearging this, we can work on this.

One reason for this: the current code does not keep datastructrures for the v1 format, it just updates to the new one.

@koppor

koppor commented Mar 17, 2026

Copy link
Copy Markdown
Member

Superficially, this PR should also include the other fixes outlined at #13844 (comment)

@testlens-app

This comment has been minimized.

@testlens-app

This comment has been minimized.

@testlens-app

This comment has been minimized.

@testlens-app

This comment has been minimized.

@testlens-app

testlens-app Bot commented Mar 19, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 2573254
▶️ Tests: 10195 executed
⚪️ Checks: 49/49 completed


Learn more about TestLens at testlens.app.

@github-actions github-actions Bot added status: no-bot-comments and removed status: changes-required Pull requests that are not yet complete labels Mar 19, 2026
@calixtus

Copy link
Copy Markdown
Member

Whts the status here?

@faneeshh

Copy link
Copy Markdown
Collaborator Author

Whts the status here?

The Migrator is handling the v1 to v2 conversion automatically on read and the tests are passing as well. I do still have to extend StudyQuery to support catalogSpecific map for per-catalog native query overrides and also add the string to string tests that @koppor pointed out were missing from the original PR.

I had finals going on at college so didn't really get much time to work on it in a while. I can possibly work on it next week.


// Observe changes to each item's enabledProperty so bindings re-evaluate when catalogs are toggled
private final ObservableList<StudyCatalogItem> databases = FXCollections.observableArrayList(
private final ObservableList<StudyCatalogItem> catalogs = FXCollections.observableArrayList(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

❤️

Comment on lines +129 to +132
Optional<StudyCatalog> match = studyCatalogs.stream().filter(catalog -> catalog.getName().equals(name)).findFirst();
boolean enabled = match.map(StudyCatalog::isEnabled).orElse(false);
String reason = match.map(StudyCatalog::getReason).orElse("");
return new StudyCatalogItem(name, enabled, reason);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can this be simplified without Optional?

Comment on lines 19 to 27
public StudyCatalogItem(@NonNull String name, boolean enabled) {
this(name, enabled, "");
}

public StudyCatalogItem(@NonNull String name, boolean enabled, @Nullable String reason) {
this.name = new SimpleStringProperty(name);
this.enabled = new SimpleBooleanProperty(enabled);
this.reason = new SimpleStringProperty(reason != null ? reason : "");
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Annotate the class with NullMarked, then mark the Nullables.
Dont use @nonnull and @nullable at the same time

@calixtus calixtus May 11, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If a method is overloaded for convenience, there should probably the explicit overloaded part not be nullable. Meaning: Fix in the constructor calls please.

return reason.getValue();
}

public void setReason(@Nullable String reason) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should never be null

@github-actions github-actions Bot added status: changes-required Pull requests that are not yet complete and removed status: no-bot-comments labels May 12, 2026
@github-actions github-actions Bot added status: no-bot-comments and removed status: changes-required Pull requests that are not yet complete labels May 12, 2026
@subhramit

Copy link
Copy Markdown
Member

Has everything been addressed here? @faneeshh

@faneeshh

faneeshh commented May 16, 2026

Copy link
Copy Markdown
Collaborator Author

Has everything been addressed here? @faneeshh

Yes. I just don't know what do with the 'heart' emoji review. #15215 (comment)

@subhramit subhramit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Getting this in as 3 people have reviewed.
Only open question may be regarding comment vs reason field, can be discussed in next developer call.

@subhramit subhramit added this pull request to the merge queue May 16, 2026
@github-actions github-actions Bot added the status: to-be-merged PRs which are accepted and should go into the merge-queue. label May 16, 2026
Merged via the queue into JabRef:main with commit 939f293 May 16, 2026
54 checks passed
@@ -0,0 +1,12 @@
version: 2.0
authors:
- Jab Ref

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Use "real" fake names and not names never existing. This will get important if writing documentation.

Anna, Bob, ...

@koppor

koppor commented May 17, 2026

Copy link
Copy Markdown
Member

Getting this in as 3 people have reviewed.

Thank you! I left minor comments.

Only open question may be regarding comment vs reason field,

According to #12631, it should be "reason" - the intention is to document on why a catalog was enabled or disabled. Maybe rename to "enabled-state-reason" to make it crystal clear?

@koppor

koppor commented May 17, 2026

Copy link
Copy Markdown
Member

The follow-up issue is #14170

// The user might add arbitrary content to the YAML
@JsonIgnoreProperties(ignoreUnknown = true)
public class Study {
public static final String CURRENT_SCHEMA_VERSION = "2.0";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is NOT SemVer

@koppor

koppor commented May 17, 2026

Copy link
Copy Markdown
Member

Please follow-up soon to use Semantic Versioning of the study.yml file - OR reason why SEMVER is not reasonable.

I opted for SemVer, because it is proven and one does not need to evaluate other formats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: slr project: gsoc status: awaiting-second-review For non-trivial changes status: no-bot-comments status: to-be-merged PRs which are accepted and should go into the merge-queue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New study.yml format

6 participants