Repository navigation
Fix Hayagriva export for performance and custom entry types - #17815
Conversation
|
Hey @nysta12! 👋 Thank you for contributing to JabRef! We have automated checks in place, based on which you will soon get feedback if any of them are failing. We also use Qodo for review assistance. It will update your pull request description with a review help and offer suggestions to improve the pull request. After all automated checks pass, a maintainer will also review your contribution. Once that happens, you can go through their comments in the "Files changed" tab and act on them, or reply to the conversation if you have further inputs. You can read about the whole pull request process in our contribution guide. Please ensure that your pull request is in line with our AI Usage Policy and make necessary disclosures. |
PR Summary by QodoFix Hayagriva export for performance and custom entry types
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can start a comment with 'qodo' or '@qodo' to chat about any finding |
|
Note that I am rewriting the exporter in a different way at JabRef#736 It is currently stalled, because other PRs need to get handled first. |
koppor
left a comment
There was a problem hiding this comment.
code-wise looks good. Let's get this in.
|
Successfully created backport PR for |
* refs/heads/main: (219 commits) Update dependency com.konghq:unirest-modules-gson to v4.11.6 (JabRef#17818) New Crowdin updates (JabRef#17816) Fix Hayagriva export for performance and custom entry types (JabRef#17815) Speed up sorting the main table by caching collation keys (JabRef#17762) Preserve literal characters in HTML paragraphs (JabRef#17779) Count braced organizations as one editor (JabRef#17781) Add Markdown publication exporter (JabRef#17598) Change OK button to Remove in three confirmation dialogs (JabRef#17565) Add Test Cases For File-link Scenarios (JabRef#17645) Preserve uppercase named entities in HTML export (JabRef#17777) Improve icon colors and Shorten read-status and priority labels (JabRef#17691) Show effective file directory as prompt text in library properties (JabRef#17581) Chore(deps): Bump com.konghq:unirest-java-bom from 4.11.4 to 4.11.5 in /versions (JabRef#17813) Chore(deps): Bump org.apache.commons:commons-lang3 from 3.21.0 to 3.22.0 in /versions (JabRef#17814) New Crowdin updates (JabRef#17812) chore(deps): update dependency com.konghq:unirest-modules-gson to v4.11.5 (JabRef#17811) Added the word AS to the list of function words and JUnit Tests (JabRef#17751) Chore(deps): Bump org.bouncycastle:bcprov-jdk18on from 1.86 to 1.87 in /versions (JabRef#17807) Chore(deps): Bump com.dlsc.gemsfx:gemsfx from 4.7.0 to 4.9.0 in /versions (JabRef#17806) Chore(deps): Bump gradle-wrapper from 9.9.0 to 9.9.1 (JabRef#17805) ...
…-built-in-journals * upstream/main: (22 commits) New Crowdin updates (#17824) Add macOS text editing shortcuts (#17772) Close PRs for issues that still need triage (#17822) Update dependency com.konghq:unirest-modules-gson to v4.11.7 (#17820) Use JGit to match .gitignore rules in unlinked files search (#17656) Update dependency com.konghq:unirest-modules-gson to v4.11.6 (#17818) New Crowdin updates (#17816) Fix Hayagriva export for performance and custom entry types (#17815) Speed up sorting the main table by caching collation keys (#17762) Preserve literal characters in HTML paragraphs (#17779) Count braced organizations as one editor (#17781) Add Markdown publication exporter (#17598) Change OK button to Remove in three confirmation dialogs (#17565) Add Test Cases For File-link Scenarios (#17645) Preserve uppercase named entities in HTML export (#17777) Improve icon colors and Shorten read-status and priority labels (#17691) Show effective file directory as prompt text in library properties (#17581) Chore(deps): Bump com.konghq:unirest-java-bom from 4.11.4 to 4.11.5 in /versions (#17813) Chore(deps): Bump org.apache.commons:commons-lang3 from 3.21.0 to 3.22.0 in /versions (#17814) New Crowdin updates (#17812) ...
Summary
The Hayagriva YAML export crashed with an
IllegalArgumentExceptionfor any entry whose type is not inStandardEntryType, such as@performance, which aborted the whole export.HayagrivaTypenow resolves the type withEntryTypeFactory.parseinstead ofStandardEntryType.valueOf, maps@performancetotype: performance, and falls back to the existingMiscfor types without a mapping.Notes for reviewers:
Misc, to keep current output and the existing testformatsContentCorrectunchanged. Hayagriva types are lowercase, so should the fallback becomemisc?CSLTypeuses the samevalueOfpattern, which affects the CSL YAML export. I left it out of this PR to keep it focused.jabref-contrib-policy:4.2:reviewed:okSteps to test
type: performanceand the article hastype: article. Bottom right of the image says "Exportåtgärden slutfördes", which translates to that the export was successfulRelated issues and pull requests
Closes #17620
AI usage
I reviewed, tested, and understand all changes.
AI CHECKLIST.md walkthrough
1. Code self-review
Nullability and control flow
== null/!= nullchecks — JSpecify annotations (@NullMarked,@Nullable,@NonNull) used instead.Objects.requireNonNull(...)— nullability expressed via JSpecify annotations.@NullMarked(org.jspecify.annotations.NullMarked).@NullMarked(org.jspecify.annotations.NullMarked).Optionalconsumed withifPresent/ifPresentOrElse/map/orElseThrow— neverorElse(unusedValue)nor anisPresent()+get()block.StringUtil.isBlank(...)used instead ofs == null || s.isBlank().Exceptions
catch (Exception e)— only specific exceptions are caught.throw new RuntimeException(...)/IllegalStateException(...)— these tear down the whole application.LOGGER.info("...", e)), not concatenated into the message string.Style and idioms
BibEntryobjects built with withers (withField, notsetField).List.of()/Map.of()/Set.of(),Path.of(),SequencedCollection/SequencedSet, text blocks.Pattern.compile(...)constant, notString.matches(...).org.jabref.logic.util.BackgroundTask, notnew Thread().///) uses Markdown syntax, not JavaDoc inline tags:`code`instead of{@code},[ClassName]instead of{@link}.User-facing text
Localization.langin Java,%prefix in FXML).!; labels do not end with:."...: %0"), not string concatenation.Security
text/htmlresponse — including exception/error messages, not just the success body (XSS).Tests
org.jabref.model/org.jabref.logichave added or updated tests.assertEquals), use plain JUnit asserts (not AssertJ), have no@DisplayName, do not catch exceptions (let them propagate so JUnit reports setup/teardown failures directly), and use@TempDirinstead of manual temp directories.2. Verification commands
./gradlew :jablib:check(or./gradlew checkfor all modules)../gradlew checkstyleMain checkstyleTest checkstyleJmh../gradlew modernizer../gradlew --no-configuration-cache :rewriteDryRunreports no changes (run./gradlew rewriteRunto fix)../gradlew javadoc.npx markdownlint-cli2 "docs/**/*.md" "*.md"(only if Markdown changed).npm ci && npm run textlintreports no misspellings (only if Markdown changed).rewriteRun:docker run -v $(pwd):/github/workspace ghcr.io/leventebajczi/intellij-format:master "*.java" "" ".idea/codeStyles/Project.xml".3. Documentation
CHANGELOG.mdentry added if the change is visible to the user (end-user wording, no extra blank lines, sorted in next to existing entries about the same component/feature). Link the issue if one exists; link the PR only when no issue exists. UseTODOas the placeholder when neither is known yet — never a fake number. No entry for fixes to changes that were themselves introduced after the last release (feature only in## [Unreleased]) — update the existing unreleased entry instead if needed.TODO(nocloses/fixesfor merely-similar issues).docs/requirements/<area>.mdif the change is a new feature or significant bug fix (skip for refactors, minor fixes, and internal changes).docs/updated if behavior or architecture changed.4. Pull request
.github/PULL_REQUEST_TEMPLATE.md, every section filled.[x],[ ], or[/].gh pr create --body-file <file>(not--body).CHANGELOG.mdused aTODOplaceholder (no issue confidently identified yet — an existing issue link always stays), the PR was opened as draft, the placeholder was replaced with the real PR-number link after PR creation, committed and pushed, and only then was the PR marked ready for review. If an issue is identified or created later, the link is switched to the issue.Checklist
CHANGELOG.mddescribing the change from the user's point of view (if the change is visible to the user)