It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Crucible Not Allowing Diffs For non text/plain Mime Types for .SQL files

So, it appears that SMSS is likely giving some of our .sql files a binary mime type.

This causes problems when adding .sql files to code reviews, as the code reviewer cannot use Crucible to see the changes. The code reviewer is forced to use source control to see the differences.

Updating all of the affected .sql files is not an option.

Is it possible to configure Crucible to treat .sql files as text regardless of mime-type?

1 answer

1 accepted

0 votes
Answer accepted
Ben Stuart Atlassian Team Feb 13, 2019

Hey AJ, this could be caused for a few different reasons. Do the SQL files show as loading forever or are they displayed as binary? 

It could be a performance problem:

We do allow for diffs between SQL files but there are some improvements on the performance of this in later versions. Ususally slow diff load are related to the following two bugs/ improvement requests:

  1. https://jira.atlassian.com/browse/CRUC-6593
  2. https://jira.atlassian.com/browse/CRUC-7050

The Store Diff Info would probably speed up showing diff's. You should be aware of the ramifications of setting this value as stated in the Documentation.

The issue could also be due to encloding:

Files that you are unable to view/diff could be encoded with: UNICODE

Files that you can view/diff may be encoded with: ASCII

Here is the only possible way I see to fixed this issue with in Fisheye. I am not sure this will work or fits your situation. I suggest testing this in a test environment with a test repo: Configuring a Different Charset in Fisheye/Crucible

Other than that there does not seem to be away with in Fisheye:
Fisheye uses the following file to handle file extensions: <FishEye/Crucible installation directory>/raw-mime.types
The following line within that file is where we map the extensions to be a text file:

text/plain   asc txt java jsp asp cs idl cpp cxx c h  pl pod py sh awk sed sql jspf tag 

SLQ is already consider to be a text file. So it really comes down to encoding I believe.

As you probably already know you can open a file in notepad and then do "Save As" and change the encoding.

I have been looking for a way to bulk convert the encode and I did fine something to at least identify the encoding. Also I am not sure what types of Repos we are dealing with. If you have git installed you can use the file command to list the encoding of each file.

Get encoding of a file in Windows - Stack Overflow

I found the following on how to bulk convert: How to bulk convert unicode file names to Ascii file names windows CMD or powershell - Stack Overflow

Having said all this if all your users change there editor to use ASCII by default when saving the file. Each time edit a file Checkout and Commit, that files head version will be fixed and viewable in Fisheye.

I hope this helps! 

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published Apr 09, 2019 in Portfolio for Jira

Portfolio for Jira 3.0 is here!

The wait is over... Portfolio for Jira Server and Data Center 3.0 is now officially here! Platform releases offer Atlassian an opportunity to shift our strategy, make bold predictions about t...

1,324 views 13 25
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you