#4523 SCM tree view can pull wrong commit info, if file hash matches

v1.0.0
closed
sf-2 (994)
SCM
Cory Johns
2015-08-20
2012-07-10
No

LastCommitDoc has repo_id as the beginning of _id, but it is not used when def ls() queries it. If we simply add it to that LastCommitDoc query, it probably won't work with forks. We need to consider 2 cases: the parent & child repos in a repo forked within Allura, and cloned repos pushed into Allura not using the builtin fork functionality.

Initial research notes: https://sourceforge.net/p/allura/pastebin/4ffc901ab9363c3d4f00004e

Hash e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 (empty file) has 1733 incidents. Repo id seems unique on all of them (not various revisions in the same repo).

Discussion

    • status: open --> in-progress
    • assigned_to: Tim Van Steenburgh
     
    • status: in-progress --> code-review
    • qa: Dave Brondsema
    • size: --> 2
     
  • forge:tv/4523

    • Create two separate repos
    • Commit an empty file to both (use distinct commit msgs)
    • Push them, and after the refresh make sure the commit messages are correct for each repo
    • Create a regular fork and an "unknown" fork of one of those repos
    • Check that the commit message is correct for the forks
     
  • Dave Brondsema

    Dave Brondsema - 2012-07-11

    Forked repos are showing up with None for the commits when viewing a tree

     
  • Dave Brondsema

    Dave Brondsema - 2012-07-11
    • status: code-review --> in-progress
     
    • status: in-progress --> code-review
     
  • To ssh://engr.geek.net/forge
    a30f7ed..6deb7c7 tv/4523 -> tv/4523

    Simplest fix was to run compute_diffs() for all commits on every refresh. This will slow down git and hg refreshes until we find a better way, but it works.

    I tested by forking (manually and with the fork button) a repo with an empty file, and checking that the last commit on the forks was correct after the fork (or push). I also verified that the count of DiffInfoDocs remained constant after multiple refreshes of an unchanged repo (i.e., running compute_diffs() for all commits won't create duplicate DiffInfoDocs for those commits)

     
    • qa: Dave Brondsema --> Cory Johns
     
  • Cory Johns - 2012-07-12
    • status: code-review --> closed
     

Log in to post a comment.