New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixed up dates in contributors statistics graph #211

Closed
sdinot opened this Issue Jun 6, 2014 · 8 comments

Comments

Projects
None yet
2 participants
@sdinot

sdinot commented Jun 6, 2014

For testing purpose:

  • I created an empty repository (zoinx/zoinx-orekit.git) using Redmine Git Hosting interface

  • I imported a third party repository (Orekit sources) :

    $ git clone http://www.orekit.org/git/orekit
    $ cd orekit
    $ git remote add myforge ssh://git@forge.....net/zoinx/zoinx-orekit.git
    $ git push myforge master

Dates are mixed up in the contributors statistics tab:

Contributors statistics graph

@n-rodriguez n-rodriguez self-assigned this Jun 6, 2014

@n-rodriguez n-rodriguez added the bug label Jun 6, 2014

@n-rodriguez

This comment has been minimized.

Show comment
Hide comment
@n-rodriguez

n-rodriguez Jun 20, 2014

Member

I think this is linked to http://www.redmine.org/issues/5357

The revision order in git is provided only by the linked list nature of revisions, i.e. a revision holds a reference to its parent revision, which in turn holds a reference to its parent, and so on.

I don't know if it can be easily fixed.

Member

n-rodriguez commented Jun 20, 2014

I think this is linked to http://www.redmine.org/issues/5357

The revision order in git is provided only by the linked list nature of revisions, i.e. a revision holds a reference to its parent revision, which in turn holds a reference to its parent, and so on.

I don't know if it can be easily fixed.

@n-rodriguez

This comment has been minimized.

Show comment
Hide comment
@n-rodriguez

n-rodriguez Jun 20, 2014

Member

I've done the test and it seems to work:

dpt - statistiques - test1 - redmine

Which version of Redmine are you running?

Member

n-rodriguez commented Jun 20, 2014

I've done the test and it seems to work:

dpt - statistiques - test1 - redmine

Which version of Redmine are you running?

@sdinot

This comment has been minimized.

Show comment
Hide comment
@sdinot

sdinot Jun 20, 2014

Hi Nicolas,

Thank you for investigating this issue.

I am not familiar with the database model of Redmine but what do you think about the following kind of query ?

SELECT c.commit_date AS date, COUNT(c.id) AS changes FROM changesets AS c JOIN repositories AS r ON c.repository_id = r.id JOIN users AS u ON c.user_id = u.id WHERE r.identifier = 'zoinx-orekit' AND u.mail = 'luc@orekit.org' GROUP BY c.commit_date ORDER BY c.commit_date DESC;

date changes
2014-05-27 2
2014-05-16 7
2014-05-15 2
2014-05-14 2
2014-05-06 1
2014-04-09 2
2014-04-07 2
2014-03-21 2
2014-03-09 3
2014-03-07 2
2014-03-01 1
... ...

sdinot commented Jun 20, 2014

Hi Nicolas,

Thank you for investigating this issue.

I am not familiar with the database model of Redmine but what do you think about the following kind of query ?

SELECT c.commit_date AS date, COUNT(c.id) AS changes FROM changesets AS c JOIN repositories AS r ON c.repository_id = r.id JOIN users AS u ON c.user_id = u.id WHERE r.identifier = 'zoinx-orekit' AND u.mail = 'luc@orekit.org' GROUP BY c.commit_date ORDER BY c.commit_date DESC;

date changes
2014-05-27 2
2014-05-16 7
2014-05-15 2
2014-05-14 2
2014-05-06 1
2014-04-09 2
2014-04-07 2
2014-03-21 2
2014-03-09 3
2014-03-07 2
2014-03-01 1
... ...
@sdinot

This comment has been minimized.

Show comment
Hide comment
@sdinot

sdinot Jun 20, 2014

Administration => Informations:

  • Environment:
    • Redmine version 2.5.1.stable
    • Ruby version 2.0.0-p481 (2014-05-08) [i686-linux]
    • Rails version 3.2.17
    • Environment production
    • Database adapter PostgreSQL
  • SCM:
    • Subversion 1.8.9
    • Mercurial 3.0
    • Git 2.0.0
    • Filesystem
  • Redmine plugins:
    • redmine_bootstrap_kit 0.1
    • redmine_git_hosting 0.7.2
    • redmine_sidekiq 2.0.0

sdinot commented Jun 20, 2014

Administration => Informations:

  • Environment:
    • Redmine version 2.5.1.stable
    • Ruby version 2.0.0-p481 (2014-05-08) [i686-linux]
    • Rails version 3.2.17
    • Environment production
    • Database adapter PostgreSQL
  • SCM:
    • Subversion 1.8.9
    • Mercurial 3.0
    • Git 2.0.0
    • Filesystem
  • Redmine plugins:
    • redmine_bootstrap_kit 0.1
    • redmine_git_hosting 0.7.2
    • redmine_sidekiq 2.0.0
@sdinot

This comment has been minimized.

Show comment
Hide comment
@sdinot

sdinot Jun 20, 2014

I think that I have found the problem. There are some missing ".order(:commit_date)" in the repository_patch.rb file:

https://www.dinot.net/tmp/order_by_commit_date.diff

sdinot commented Jun 20, 2014

I think that I have found the problem. There are some missing ".order(:commit_date)" in the repository_patch.rb file:

https://www.dinot.net/tmp/order_by_commit_date.diff

@n-rodriguez

This comment has been minimized.

Show comment
Hide comment
@n-rodriguez

n-rodriguez Jun 20, 2014

Member

I've tested your patch and it's still working for me :)
Does it work for you?

Member

n-rodriguez commented Jun 20, 2014

I've tested your patch and it's still working for me :)
Does it work for you?

@sdinot

This comment has been minimized.

Show comment
Hide comment
@sdinot

sdinot Jun 20, 2014

Yes, my patch works for me.
I use PostgreSQL, do you use MySQL? If that is the case, maybe that MySQL returns ordered results when a GROUP BY clause is used but not PostgreSQL.

sdinot commented Jun 20, 2014

Yes, my patch works for me.
I use PostgreSQL, do you use MySQL? If that is the case, maybe that MySQL returns ordered results when a GROUP BY clause is used but not PostgreSQL.

@n-rodriguez

This comment has been minimized.

Show comment
Hide comment
@n-rodriguez

n-rodriguez Jun 20, 2014

Member

I use PostgreSQL, do you use MySQL? If that is the case, maybe that MySQL returns ordered results when a GROUP BY clause is used but not PostgreSQL.

Maybe. That's very possible.
In all cases it will be in next release (v0.7.4) ;)

Thank you!

Member

n-rodriguez commented Jun 20, 2014

I use PostgreSQL, do you use MySQL? If that is the case, maybe that MySQL returns ordered results when a GROUP BY clause is used but not PostgreSQL.

Maybe. That's very possible.
In all cases it will be in next release (v0.7.4) ;)

Thank you!

n-rodriguez added a commit that referenced this issue Jun 20, 2014

n-rodriguez added a commit that referenced this issue Jun 20, 2014

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