Uploaded image for project: 'Crucible'
  1. Crucible
  2. CRUC-6720

Creating a review of a binary revision before SVN processing is complete renders binary file as text

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 4.8.11
    • 3.3.0, 4.1.2
    • Code reviews

    Description

      If you add a revision of a binary file, then create a review containing it before the 'infill' stage is complete (i.e. when it still has a ? icon next to it when viewed in the activity stream) a non-binary CrucibleRevision will be created for it (table cru_revision) and it will render as text in that review and in any future review created for the same revision.

      Until infill finishes, FishEye rendering is broken too, but then it self-heals. However in versions prior to 4.8.11, the Crucible data, which has already cached the binary flag, is never fixed.

      Expected Behaviour in 4.8.11+ 

      This issue will still occur in 4.8.11+ when the revision is not fully indexed but it will self-heal fully after indexing is completed.

      Root Cause Analysis

      It is intended that a user can create a review as soon as possible which means while information about the revision is still being gathered and persisted. As such this is how the file is rendered before indexing has reached wrap phase.

      Pre 4.8.11 Workarounds

      Workaround #1  - update the DB manually

      As always, prior to operating on the database:

      1. Create a backup.
      2. Shut down the FishEye/Crucible instance.

      Next, execute the following script to fix the existing crucible reviews (substitute <FILE_PATTERN> with a pattern that matches the files experiencing the problem).

      UPDATE cru_revision 
      SET cru_binary = true
      WHERE cru_path IN (
              SELECT cru_revision.cru_path
              FROM cru_revision
              JOIN cru_stored_path
              ON cru_revision.cru_path = cru_stored_path.cru_path_id
              WHERE cru_stored_path.cru_path LIKE '<FILE PATTERN>'
      )
      AND cru_binary = false
      
      
      Workaround #2 - postpone review creation

      Another way to avoid this issue is to postpone review creation until the file has been fully scanned. Users can check that by viewing the respective file revision in FishEye and ensuring it is not displayed as garbage text.

       

       

      Attachments

        Issue Links

          Activity

            People

              nhansberry Nate Hansberry
              tom@atlassian.com Tom Davies
              Votes:
              3 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: