Skip to content

Refactor BibDatabase Migrations#3733

Merged
lenhard merged 5 commits into
masterfrom
refactor-migrations
Feb 20, 2018
Merged

Refactor BibDatabase Migrations#3733
lenhard merged 5 commits into
masterfrom
refactor-migrations

Conversation

@LinusDietz

Copy link
Copy Markdown
Member

This is the followup for #3658 (comment).

I have moved the functionality from org.jabref.migrations to org.jabref.logic.importer.migrations.

The code is called from the UI now in org.jabref.gui.importer.actions.OpenDatabaseAction.performPostOpenActions(), where also some other similar actions are called.

Since the build is broken at the moment due to external resources, I'll have to re-check later if everything is actually fine here.
The general structure should be ready to review anyways.

@LinusDietz LinusDietz added status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers component: import-load labels Feb 17, 2018
@stefan-kolb

Copy link
Copy Markdown
Member

Why logic.importer.migrations? Sure it would not be in a wrong place, but we put it in a top-level package on purpose as this should be immediately evident that this is caused by JabRef design decisions and not hidden inside logic.importer where standard formats should be put. Not sure what others think.

@Siedlerchr

Copy link
Copy Markdown
Member

Agree with @stefan-kolb What has a migration to do with import?
Top level logic.migrations should be the way to got

@lenhard

lenhard commented Feb 17, 2018

Copy link
Copy Markdown
Member

+1 for logic.migrations

@@ -1,4 +1,4 @@
package org.jabref.migrations;
package org.jabref.logic.importer.migrations;

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 class has to many UI-dependencies to be in logic.

@Siedlerchr

Copy link
Copy Markdown
Member

The failing test is probably due to caching on travis and a result from #3713.
I cleared the cache in travis for master and this build. Hope that's enough.,
If not, delete it again: https://travis-ci.org/JabRef/jabref/caches

@koppor koppor mentioned this pull request Feb 18, 2018
8 tasks
import org.jabref.logic.importer.ParserResult;
import org.jabref.logic.migrations.MergeReviewIntoCommentMigration;

public class MergeReviewIntoComment implements GUIPostOpenAction {

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.

Maybe rename that with the action suffix so that it is better distingusishable from the other migration

import org.jabref.model.entry.BibEntry;

public class MergeReviewIntoCommentUIManager {
public class MergeReviewIntoCommentConfirmation {

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.

I would add the Dialog suffix to better see that above

MergeReviewIntoCommentMigration migration = new MergeReviewIntoCommentMigration();

migration.performMigration(parserResult);
if (new MergeReviewIntoCommentConfirmation(basePanel).askUserForMerge(MergeReviewIntoCommentMigration.collectConflicts(parserResult))) {

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.

I would split that into assignment and declaration. It's unforunately not so easy distinguishable what what ist, because all is named very similar

@Siedlerchr Siedlerchr 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.

If you make the class names a bit more distinguishable from each other, I would be happy.
Rest is okay 👍

@lenhard lenhard 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.

Code looks good and I'll merge. At some point, we can think about removing the FileLinksUpgradeWarning migration completely.

v2.3 is so long back and by removing this we could speed up the startup a little.

@lenhard lenhard merged commit e9e7bcc into master Feb 20, 2018
@lenhard lenhard deleted the refactor-migrations branch February 20, 2018 13:57
@koppor koppor removed the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Mar 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants