Use INSPIRE texkeys for arXiv-ID based imports#15038
Use INSPIRE texkeys for arXiv-ID based imports#15038addix7 wants to merge 21 commits intoJabRef:mainfrom
Conversation
This reverts commit 51fde24.
Review Summary by QodoFix INSPIRE texkeys and preview preferences reset issues
WalkthroughsDescription• Ensure INSPIRE texkeys are used for arXiv-ID based imports consistently • Fix NullPointerException when resetting preview preferences • Preserve citation keys from fetched entries in merged results • Add default factory method and reset capability to PreviewPreferences Diagramflowchart LR
A["ArXiv ID Import"] -->|"via INSPIRE"| B["MergingIdBasedFetcher"]
B -->|"preserve citation key"| C["Merged BibEntry"]
C -->|"uses INSPIRE texkey"| D["Consistent Citation Key"]
E["PreviewPreferences Reset"] -->|"getDefault method"| F["Default Instance"]
F -->|"setAll method"| G["Preferences Cleared"]
File Changes1. jablib/src/main/java/org/jabref/logic/importer/fetcher/MergingIdBasedFetcher.java
|
|
@addix7 Read about git -- https://github.com/JabRef/jabref/pull/15038/commits shows many unrelated changes. -- This time, you are allowed to force-push. |
Review Summary by QodoEnsure INSPIRE texkeys for arXiv imports and fix preview preferences reset
WalkthroughsDescription• Ensure INSPIRE texkeys are used for arXiv-ID based imports consistently • Fix NullPointerException when resetting preview preferences • Add PreviewPreferences.getDefault() and setAll() methods • Preserve citation keys from fetched entries in merged results Diagramflowchart LR
A["ArXiv-ID Import"] -->|"Fetch via INSPIRE"| B["MergingIdBasedFetcher"]
B -->|"Merge entries"| C["Preserve Citation Key"]
C -->|"Use INSPIRE texkey"| D["Merged Entry"]
E["Reset Preferences"] -->|"Call clear()"| F["JabRefGuiPreferences"]
F -->|"Reset preview"| G["PreviewPreferences.getDefault()"]
G -->|"Initialize defaults"| H["Preview Reset Complete"]
File Changes1. jabgui/src/main/java/org/jabref/gui/preferences/JabRefGuiPreferences.java
|
|
|
||
| Set<Field> updatedFields = updateFieldsFromSource(fetchedEntry, mergedEntry); | ||
|
|
||
| fetchedEntry.getCitationKey().ifPresent(mergedEntry::setCitationKey); |
There was a problem hiding this comment.
No - I think updateFieldsFromSource needs to be adapted.
Your change affects ALL fetchers
There was a problem hiding this comment.
Hello,
thanks for the clarification, i understandm= that this makes citation key applicable to all the fetchers, i will work on it such that, this works only when the fetched entry originates from inspire.
I will also clean the messy commit history and add required tests.
Code Review by Qodo
1. TextBasedPreviewLayout built with nulls
|
|
Persistent review updated to latest commit c46be1d |
| this.shouldDownloadCovers.set(shouldDownloadCovers); | ||
| } | ||
|
|
||
| private PreviewPreferences() { |
There was a problem hiding this comment.
urelated? this seems to. be coming from another pr
There was a problem hiding this comment.
@addix7 Its now one week that this comment is unaddressed. Do you intend to work on this?
✅ All tests passed ✅🏷️ Commit: cac51a3 Learn more about TestLens at testlens.app. |
|
That's why I was asking: You need to identify the record first to see if it's an inspire hep related entry and then you can keep the citaiton ke |
|
Your code currently does not meet JabRef's code guidelines. IntelliJ auto format covers some cases. There seem to be issues with your code style and autoformat configuration. Please reformat your code (Ctrl+Alt+L) and commit, then push. |
|
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. |
|
Hi @koppor, I’m currently stuck with a local development issue and would really appreciate some guidance. For some time now, I’ve been unable to run JabRef successfully from source due to initialization errors related to preview preferences and missing generated resources (journal list / citation style catalog). I’ve tried multiple clean setups, fresh clones, clearing caches, and different Gradle run configurations, but I keep running into either JBang-related issues (path with spaces on Windows) or a UnsupportedOperationException during GUI initialization. At the moment, I’ve managed to get it running locally using a small workaround, but I don’t feel confident that this is the correct or intended solution. Since I really want to contribute properly (especially for the TexKey issue), I want to ensure my setup is aligned with the expected development workflow, due to this i cant figure out how to go past this one error showing........ Could you please advise on: The recommended way to run JabRef on Windows if the username contains spaces? Whether there’s a known issue with preview preferences causing the immutable list exception? The correct way to skip or generate the required resources for development mode? I’ve been trying to resolve this for a few weeks now, and I’m very motivated to contribute — I just need a bit of direction to make sure I’m not fighting the wrong problem. Thank you for your time 🙏 |
|
@addix7 please show up at the community chat. Maybe someone has time to investigate. And I think, we fixed space handling issues (cc @calixtus ). -- Note: Our guide says: Checkout to In other words: do not tinker, engineer! ("There is so much tinkering with software. What we need is Software Engineering!") |
|
Hi @koppor, Thank you for the guidance earlier. I have taken some time to reset and i am now setting up the project again following the recommended repositories structure exactly. I will also join the community chat to share my setup and align with others before making further changes. I appreciate the advice about engineering systematically instead of patching locally, I will focus on making the setup reproducible and clean before continuing with the TexKey issue. I’ll update once I have a stable environment. |
Closes #12292
This change ensures that entries imported via arXiv identifiers use INSPIRE-provided citation keys when the INSPIRE arXiv endpoint is used, aligning arXiv-ID based imports with normal INSPIRE search behavior. Although the fix shows correct results in the UI, I revisited and understood the IdBasedFetcher, INSPIREFetcher, and ArXivFetcher flow to confirm that the INSPIRE origin can only be determined after INSPIRE returns BibTeX metadata, which justifies applying INSPIRE texkeys at that stage.
Steps to test
Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)