Bug 1037614 - VFS IOService sorts the version records by commit date instead of naturally as they happened
Summary: VFS IOService sorts the version records by commit date instead of naturally a...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ER6
: 6.0.0
Assignee: Alexandre Porcelli
QA Contact: Lukáš Petrovický
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-03 13:33 UTC by Petr Široký
Modified: 2014-08-06 20:15 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-06 20:15:43 UTC
Type: Bug


Attachments (Terms of Use)

Description Petr Široký 2013-12-03 13:33:18 UTC
Description of problem:
I hit the following issue when testing the jcr2vfs migration tool. Versions records (e.g. commits in case of git) are sorted by the commit date instead of how they actually happened (the order in which they were committed). See the example.

Following is returned by 'git log' (the number in parentheses is just for reference, not part of the actual output):
(1)
commit 558c4b05ed4f6ab241e2c8bab17fb0940dd0871a
Author: Petr Siroky <psiroky>
Date:   Thu Aug 15 10:08:45 2013 +0200

    Underage.rdrl - salience updated to 11

(2)
commit 1b9e2799199bf032815f18f169f1264b68d3f657
Author: mic <null>
Date:   Wed Oct 1 04:54:34 2008 +0200

(3)
commit 23f53aaf7ef00df10119f20f18fbe77eecfe752d
Author: Petr Siroky <psiroky>
Date:   Fri Jul 26 17:59:37 2013 +0200


Following is the code used to get version records using VFS API:
    VersionAttributeView<Path> versionAttributeView = ioService.getFileAttributeView(path, VersionAttributeView.class);
    VersionHistory history = versionAttributeView.readAttributes().history();
    return history.records();

However this code returns the records in order: 2, 3, 1 - sorting them by date. 

It should instead return them in order 1, 2, 3 (or maybe 3, 2, 1 - not sure if its better to return latest as first or oldest as first)


Version-Release number of selected component (if applicable):
Uberfire in 6.0.0-ER5 (and most probably also in 0.3.0-SNAPSHOT and 0.4.0-SNAPSHOT)

Additional info:
This should not be an issue when the repository is accessed only through UI (kie-wb) as it commits the changes in correct order. However if we allow also remote access this could bring some issues when displaying the asset history. Also this pops up when using the jcr2vfs migration tool as it uses the dates from past to align the history with the JCR repo.

Comment 1 Pedro Zapata 2013-12-03 15:13:48 UTC
Not sure this actually has to do with the migration tool but with the VFS service itself. Please, verify and if that might involve a platform wide impact, consult with Uberfire engineers before changing

Comment 2 Petr Široký 2013-12-03 15:36:03 UTC
Pedro,

yes, you are right, it is not specific to jcr2vfs migration tool I just stumbled on it when testing the tool. That's the reason I originally assigned this BZ to Alexandre. We had a little chat about that and he asked me to create one.

Comment 3 Pedro Zapata 2013-12-04 17:34:51 UTC
I reassign it to Porcelli then, since it involves UF / VFS changes. Feel free to reassign if we can help with that, but this might have a platform impact it's best assessed by him.

Comment 4 Alexandre Porcelli 2013-12-06 21:51:17 UTC
Issue fixed on UberFire master and product branches:

https://github.com/droolsjbpm/uberfire/commit/09afc07dc
https://github.com/droolsjbpm/uberfire/commit/5d8d2c884

Comment 5 Lukáš Petrovický 2014-06-08 00:42:19 UTC
VERIFIED.


Note You need to log in before you can comment on or make changes to this bug.