Skip to content

Commit 9da5eb8

Browse files
author
Sai Krishna V
authored
Merge pull request #279 from saikrishnav/testcaseidsha1change
TestCase ID Generation algorithm to SHA1 on par with TPV1
2 parents 74f6557 + 3a2a32f commit 9da5eb8

File tree

1 file changed

+8
-8
lines changed
  • src/Microsoft.TestPlatform.ObjectModel/Utilities

1 file changed

+8
-8
lines changed

src/Microsoft.TestPlatform.ObjectModel/Utilities/EqtHash.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities
77
using System.Diagnostics;
88
using System.Diagnostics.CodeAnalysis;
99

10-
#if NET46
11-
using System.Security.Cryptography;
12-
#endif
10+
using System.Security.Cryptography;
1311

1412
/// <summary>
1513
/// Wrapper class for cryptographic hashing.
@@ -25,11 +23,13 @@ public static class EqtHash
2523
public static Guid GuidFromString(string data)
2624
{
2725
Debug.Assert(data != null);
28-
#if NET46
29-
using (HashAlgorithm provider = new SHA256CryptoServiceProvider())
30-
#else
31-
using (var provider = System.Security.Cryptography.SHA256.Create())
32-
#endif
26+
// Do NOT change the algorithm ever as this will have compat implications
27+
// TC-TA team has a feature in VS where workitems are associated based on TestCase Ids
28+
// If Algorithm changes, then all the bugs/workitems filed in TFS Server against a given TestCase become unassociated if IDs change
29+
// Any algorithm or logic change must require a sign off from feature owners of above
30+
// Also, TPV2 and TPV1 must use same Algorithm until the time TPV1 is completely deleted to be on-par
31+
// If LUT or .Net core scenario uses TPV2 to discover, but if it uses TPV1 in Devenv, then there will be testcase matching issues
32+
using (HashAlgorithm provider = SHA1.Create())
3333
{
3434
byte[] hash = provider.ComputeHash(System.Text.Encoding.Unicode.GetBytes(data));
3535

0 commit comments

Comments
 (0)