Skip to content

Commit

Permalink
updated property repo name
Browse files Browse the repository at this point in the history
  • Loading branch information
ragavareddychalapala committed Jul 12, 2024
1 parent 882ca7d commit e3f093f
Show file tree
Hide file tree
Showing 33 changed files with 108 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "siparty-release-npm-egll"
},
{
Expand Down Expand Up @@ -128,7 +128,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "org1-npmjs-npm-remote-cache"
},
{
Expand Down Expand Up @@ -180,7 +180,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "org1-npmjs-npm-remote-cache"
},
{
Expand Down Expand Up @@ -231,7 +231,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "siparty-release-npm-egll"
},
{
Expand Down Expand Up @@ -282,7 +282,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "org1-npmjs-npm-remote-cache"
},
{
Expand Down Expand Up @@ -334,7 +334,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "org1-npmjs-npm-remote-cache"
},
{
Expand Down
4 changes: 2 additions & 2 deletions src/AritfactoryUploader.UTest/PackageUploadHelperTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public void UpdateBomArtifactoryRepoUrl_GivenBomAndComponentsUploadedToArtifacto
PackageUploadHelper.UpdateBomArtifactoryRepoUrl(ref bom, components);

//Assert
var repoUrl = bom.Components.First(x => x.Properties[3].Name == "internal:siemens:clearing:repo-name").Properties[3].Value;
var repoUrl = bom.Components.First(x => x.Properties[3].Name == "internal:siemens:clearing:jfrog-repo-name").Properties[3].Value;
Assert.AreEqual("org1-npmjs-npm-remote", repoUrl);
}

Expand All @@ -193,7 +193,7 @@ public void UpdateBomArtifactoryRepoUrl_GivenBomAndComponentsUploadedToArtifacto
PackageUploadHelper.UpdateBomArtifactoryRepoUrl(ref bom, components);

//Assert
var repoUrl = bom.Components.First(x => x.Properties[3].Name == "internal:siemens:clearing:repo-name").Properties[3].Value;
var repoUrl = bom.Components.First(x => x.Properties[3].Name == "internal:siemens:clearing:jfrog-repo-name").Properties[3].Value;
Assert.AreNotEqual("org1-npmjs-npm-remote", repoUrl);
}

Expand Down
8 changes: 4 additions & 4 deletions src/ArtifactoryUploader/PackageUploadHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public async static Task<List<ComponentsToArtifactory>> GetComponentsToBeUploade
ComponentType = GetComponentType(item),
PackageType = packageType,
DryRun = !appSettings.Release,
SrcRepoName = item.Properties.Find(s => s.Name == Dataconstant.Cdx_ArtifactoryRepoUrl)?.Value,
SrcRepoName = item.Properties.Find(s => s.Name == Dataconstant.Cdx_ArtifactoryRepoName)?.Value,
DestRepoName = GetDestinationRepo(item, appSettings),
ApiKey = appSettings.ArtifactoryUploadApiKey,
Email = appSettings.ArtifactoryUploadUser,
Expand Down Expand Up @@ -954,15 +954,15 @@ private async static Task<AqlResult> GetSrcRepoDetailsForPyPiOrConanPackages(Com
if (item.Purl.Contains("pypi", StringComparison.OrdinalIgnoreCase))
{
// get the component list from Jfrog for given repo
aqlResultList = await GetListOfComponentsFromRepo(new string[] { item.Properties.Find(x => x.Name == Dataconstant.Cdx_ArtifactoryRepoUrl)?.Value }, jFrogService);
aqlResultList = await GetListOfComponentsFromRepo(new string[] { item.Properties.Find(x => x.Name == Dataconstant.Cdx_ArtifactoryRepoName)?.Value }, jFrogService);
if (aqlResultList.Count > 0)
{
return GetArtifactoryRepoName(aqlResultList, item);
}
}
else if (item.Purl.Contains("conan", StringComparison.OrdinalIgnoreCase))
{
var aqlConanResultList = await GetListOfComponentsFromRepo(new string[] { item.Properties.Find(x => x.Name == Dataconstant.Cdx_ArtifactoryRepoUrl)?.Value }, jFrogService);
var aqlConanResultList = await GetListOfComponentsFromRepo(new string[] { item.Properties.Find(x => x.Name == Dataconstant.Cdx_ArtifactoryRepoName)?.Value }, jFrogService);

if (aqlConanResultList.Count > 0)
{
Expand Down Expand Up @@ -1175,7 +1175,7 @@ public static void UpdateBomArtifactoryRepoUrl(ref Bom bom, List<ComponentsToArt
var bomComponent = bom.Components.Find(x => x.Purl.Equals(component.Purl, StringComparison.OrdinalIgnoreCase));
if (component.DestRepoName != null && !component.DryRun)
{
bomComponent.Properties.First(x => x.Name == Dataconstant.Cdx_ArtifactoryRepoUrl).Value = component.DestRepoName;
bomComponent.Properties.First(x => x.Name == Dataconstant.Cdx_ArtifactoryRepoName).Value = component.DestRepoName;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/LCT.Common/Constants/Dataconstant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static class Dataconstant
public const string ReleaseAttachmentComment = "Attached by CA Tool";
public const char ForwardSlash = '/';
public const string SourceURLSuffix = "/srcfiles?fileinfo=1";
public const string Cdx_ArtifactoryRepoUrl = "internal:siemens:clearing:repo-name";
public const string Cdx_ArtifactoryRepoName = "internal:siemens:clearing:jfrog-repo-name";
public const string Cdx_ProjectType = "internal:siemens:clearing:project-type";
public const string Cdx_ClearingState = "internal:siemens:clearing:clearing-state";
public const string Cdx_IsInternal = "internal:siemens:clearing:is-internal";
Expand Down
4 changes: 2 additions & 2 deletions src/LCT.PackageIdentifier.UTest/ConanParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public async Task GetJfrogRepoDetailsOfAComponent_ReturnsWithData_SuccessFully()
ConanProcessor conanProcessor = new ConanProcessor(cycloneDXBomParser.Object);
var actual = await conanProcessor.GetJfrogRepoDetailsOfAComponent(
components, appSettings, mockJfrogService.Object, mockBomHelper.Object);
var reponameActual = actual.First(x => x.Properties[0].Name == "internal:siemens:clearing:repo-name").Properties[0].Value;
var reponameActual = actual.First(x => x.Properties[0].Name == "internal:siemens:clearing:jfrog-repo-name").Properties[0].Value;

// Assert
Assert.That(actual, Is.Not.Null);
Expand Down Expand Up @@ -245,7 +245,7 @@ public async Task GetArtifactoryRepoName_Conan_ReturnsNotFound_ReturnsFailure()
var actual = await conanProcessor.GetJfrogRepoDetailsOfAComponent(
components, appSettings, mockJfrogService.Object, mockBomHelper.Object);

var reponameActual = actual.First(x => x.Properties[0].Name == "internal:siemens:clearing:repo-name").Properties[0].Value;
var reponameActual = actual.First(x => x.Properties[0].Name == "internal:siemens:clearing:jfrog-repo-name").Properties[0].Value;

Assert.That("Not Found in JFrogRepo", Is.EqualTo(reponameActual));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void SetProperties_GivenComponent_SetsPropertiesInBOM()
List<Property> expectedpropList = new List<Property>()
{
new Property(){ Name = Dataconstant.Cdx_ProjectType,Value = "NPM"},
new Property(){ Name = Dataconstant.Cdx_ArtifactoryRepoUrl,Value = repo},
new Property(){ Name = Dataconstant.Cdx_ArtifactoryRepoName,Value = repo},
new Property(){ Name = Dataconstant.Cdx_IsInternal,Value = "false"},

};
Expand Down
8 changes: 4 additions & 4 deletions src/LCT.PackageIdentifier.UTest/NugetParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ public async Task GetArtifactoryRepoName_Nuget_ReturnsRepoName_SuccessFully()
var actual = await nugetProcessor.GetJfrogRepoDetailsOfAComponent(
components, appSettings, mockJfrogService.Object, mockBomHelper.Object);

var reponameActual = actual.First(x => x.Properties[0].Name == "internal:siemens:clearing:repo-name").Properties[0].Value;
var reponameActual = actual.First(x => x.Properties[0].Name == "internal:siemens:clearing:jfrog-repo-name").Properties[0].Value;

Assert.That(reponameActual, Is.EqualTo(aqlResult.Repo));
}
Expand Down Expand Up @@ -833,7 +833,7 @@ public async Task GetArtifactoryRepoName_Nuget_ReturnsRepoName_ReturnsFailure()
var actual = await nugetProcessor.GetJfrogRepoDetailsOfAComponent(
components, appSettings, mockJfrogService.Object, mockBomHelper.Object);

var reponameActual = actual.First(x => x.Properties[0].Name == "internal:siemens:clearing:repo-name").Properties[0].Value;
var reponameActual = actual.First(x => x.Properties[0].Name == "internal:siemens:clearing:jfrog-repo-name").Properties[0].Value;

Assert.That("Not Found in JFrogRepo", Is.EqualTo(reponameActual));
}
Expand Down Expand Up @@ -873,7 +873,7 @@ public async Task GetArtifactoryRepoName_Nuget_ReturnsRepoName_ReturnsSuccess()
var actual = await nugetProcessor.GetJfrogRepoDetailsOfAComponent(
components, appSettings, mockJfrogService.Object, mockBomHelper.Object);

var reponameActual = actual.First(x => x.Properties[0].Name == "internal:siemens:clearing:repo-name").Properties[0].Value;
var reponameActual = actual.First(x => x.Properties[0].Name == "internal:siemens:clearing:jfrog-repo-name").Properties[0].Value;


Assert.That("internalrepo1", Is.EqualTo(reponameActual));
Expand Down Expand Up @@ -914,7 +914,7 @@ public async Task GetArtifactoryRepoName_Nuget_ReturnsNotFound_ReturnsFailure()
var actual = await nugetProcessor.GetJfrogRepoDetailsOfAComponent(
components, appSettings, mockJfrogService.Object, mockBomHelper.Object);

var reponameActual = actual.First(x => x.Properties[0].Name == "internal:siemens:clearing:repo-name").Properties[0].Value;
var reponameActual = actual.First(x => x.Properties[0].Name == "internal:siemens:clearing:jfrog-repo-name").Properties[0].Value;

Assert.That("Not Found in JFrogRepo", Is.EqualTo(reponameActual));
}
Expand Down
2 changes: 1 addition & 1 deletion src/LCT.PackageIdentifier/ConanProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public async Task<List<Component>> GetJfrogRepoDetailsOfAComponent(List<Componen
string jfrogpackageName = $"{component.Name}/{component.Version}";
Logger.Debug($"Repo Name for the package {jfrogpackageName} is {repoName}");
var hashes = aqlResultList.FirstOrDefault(x => x.Path.Contains(jfrogpackageName, StringComparison.OrdinalIgnoreCase));
Property artifactoryrepo = new() { Name = Dataconstant.Cdx_ArtifactoryRepoUrl, Value = repoName };
Property artifactoryrepo = new() { Name = Dataconstant.Cdx_ArtifactoryRepoName, Value = repoName };
Property jfrogRepoPathProperty = new() { Name = Dataconstant.Cdx_JfrogRepoPath, Value = jfrogRepoPath };
Component componentVal = component;

Expand Down
2 changes: 1 addition & 1 deletion src/LCT.PackageIdentifier/CycloneBomProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static void SetProperties(CommonAppSettings appSettings, Component compon

Property artifactoryrepo = new()
{
Name = Dataconstant.Cdx_ArtifactoryRepoUrl,
Name = Dataconstant.Cdx_ArtifactoryRepoName,
Value = repo
};

Expand Down
2 changes: 1 addition & 1 deletion src/LCT.PackageIdentifier/DebianProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public async Task<List<Component>> GetJfrogRepoDetailsOfAComponent(List<Componen

string jfrogpackageName = $"{component.Name}-{component.Version}{ApiConstant.DebianExtension}";
var hashes = aqlResultList.FirstOrDefault(x => x.Name == jfrogpackageName);
Property artifactoryrepo = new() { Name = Dataconstant.Cdx_ArtifactoryRepoUrl, Value = repoName };
Property artifactoryrepo = new() { Name = Dataconstant.Cdx_ArtifactoryRepoName, Value = repoName };
Property jfrogFileNameProperty = new() { Name = Dataconstant.Cdx_Siemensfilename, Value = jfrogRepoPackageName };
Property jfrogRepoPathProperty = new() { Name = Dataconstant.Cdx_JfrogRepoPath, Value = jfrogRepoPath };
Component componentVal = component;
Expand Down
2 changes: 1 addition & 1 deletion src/LCT.PackageIdentifier/MavenProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public async Task<List<Component>> GetJfrogRepoDetailsOfAComponent(List<Componen
AqlResult finalRepoData = GetJfrogArtifactoryRepoDetials(aqlResultList, component, bomhelper, out jfrogRepoPath);
Property siemensfileNameProp = new() { Name = Dataconstant.Cdx_Siemensfilename, Value = finalRepoData?.Name ?? Dataconstant.PackageNameNotFoundInJfrog };
Property jfrogRepoPathProp = new() { Name = Dataconstant.Cdx_JfrogRepoPath, Value = jfrogRepoPath };
Property artifactoryrepo = new() { Name = Dataconstant.Cdx_ArtifactoryRepoUrl, Value = finalRepoData.Repo };
Property artifactoryrepo = new() { Name = Dataconstant.Cdx_ArtifactoryRepoName, Value = finalRepoData.Repo };

Component componentVal = component;
if (componentVal.Properties?.Count == null || componentVal.Properties?.Count <= 0)
Expand Down
2 changes: 1 addition & 1 deletion src/LCT.PackageIdentifier/NpmProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ public async Task<List<Component>> GetJfrogRepoDetailsOfAComponent(List<Componen

string jfrogRepoPath = string.Empty;
AqlResult finalRepoData = GetJfrogArtifactoryRepoDetials(aqlResultList, component, bomhelper, out jfrogRepoPath);
Property artifactoryrepo = new() { Name = Dataconstant.Cdx_ArtifactoryRepoUrl, Value = finalRepoData.Repo };
Property artifactoryrepo = new() { Name = Dataconstant.Cdx_ArtifactoryRepoName, Value = finalRepoData.Repo };
Property siemensfileNameProp = new() { Name = Dataconstant.Cdx_Siemensfilename, Value = finalRepoData?.Name ?? Dataconstant.PackageNameNotFoundInJfrog };
Property jfrogRepoPathProp = new() { Name = Dataconstant.Cdx_JfrogRepoPath, Value = jfrogRepoPath };
Component componentVal = component;
Expand Down
2 changes: 1 addition & 1 deletion src/LCT.PackageIdentifier/NugetProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public async Task<List<Component>> GetJfrogRepoDetailsOfAComponent(List<Componen

string jfrogRepoPath = string.Empty;
AqlResult finalRepoData = GetJfrogArtifactoryRepoDetials(aqlResultList, component, bomhelper, out jfrogRepoPath);
Property artifactoryrepo = new() { Name = Dataconstant.Cdx_ArtifactoryRepoUrl, Value = finalRepoData.Repo };
Property artifactoryrepo = new() { Name = Dataconstant.Cdx_ArtifactoryRepoName, Value = finalRepoData.Repo };
Property siemensfileNameProp = new() { Name = Dataconstant.Cdx_Siemensfilename, Value = finalRepoData?.Name ?? Dataconstant.PackageNameNotFoundInJfrog };
Property jfrogRepoPathProp = new() { Name = Dataconstant.Cdx_JfrogRepoPath, Value = jfrogRepoPath };
Component componentVal = component;
Expand Down
2 changes: 1 addition & 1 deletion src/LCT.PackageIdentifier/PythonProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ public async Task<List<Component>> GetJfrogRepoDetailsOfAComponent(List<Componen
var hashes = aqlResultList.FirstOrDefault(x => x.Name.Contains(
jfrogpackageName, StringComparison.OrdinalIgnoreCase) && (x.Name.EndsWith(ApiConstant.PythonExtension)));

Property artifactoryrepo = new() { Name = Dataconstant.Cdx_ArtifactoryRepoUrl, Value = repoName };
Property artifactoryrepo = new() { Name = Dataconstant.Cdx_ArtifactoryRepoName, Value = repoName };
Property fileNameProperty = new() { Name = Dataconstant.Cdx_Siemensfilename, Value = jfrogPackageNameWhlExten };
Property jfrogRepoPathProperty = new() { Name = Dataconstant.Cdx_JfrogRepoPath, Value = jfrogRepoPath };
Component componentVal = component;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "Not Found in JFrogRepo"
},
{
Expand Down Expand Up @@ -119,7 +119,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "Not Found in JFrogRepo"
},
{
Expand Down Expand Up @@ -172,7 +172,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "Not Found in JFrogRepo"
},
{
Expand Down Expand Up @@ -225,7 +225,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "Not Found in JFrogRepo"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "Not Found in JFrogRepo"
},
{
Expand Down Expand Up @@ -130,7 +130,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "Not Found in JFrogRepo"
},
{
Expand Down Expand Up @@ -184,7 +184,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "Not Found in JFrogRepo"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "Not Found in JFrogRepo"
},
{
Expand Down Expand Up @@ -111,7 +111,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "Not Found in JFrogRepo"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "Not Found in JFrogRepo"
},
{
Expand Down Expand Up @@ -129,7 +129,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "Not Found in JFrogRepo"
},
{
Expand Down Expand Up @@ -170,7 +170,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "Not Found in JFrogRepo"
},
{
Expand Down Expand Up @@ -211,7 +211,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "Not Found in JFrogRepo"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "Not Found in JFrogRepo"
},
{
Expand Down Expand Up @@ -256,7 +256,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "Not Found in JFrogRepo"
},
{
Expand Down Expand Up @@ -357,7 +357,7 @@
"value": "false"
},
{
"name": "internal:siemens:clearing:repo-name",
"name": "internal:siemens:clearing:jfrog-repo-name",
"value": "Not Found in JFrogRepo"
},
{
Expand Down
Loading

0 comments on commit e3f093f

Please sign in to comment.