Skip to content

Commit

Permalink
Merge branch 'main' into feature/merge_check
Browse files Browse the repository at this point in the history
  • Loading branch information
karthika-g committed Sep 4, 2024
2 parents 498a12e + 538cd81 commit 1eeb442
Show file tree
Hide file tree
Showing 35 changed files with 103 additions and 878 deletions.
29 changes: 1 addition & 28 deletions src/ArtifactoryUploader/Model/DisplayPackagesInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@
// SPDX-License-Identifier: MIT
// --------------------------------------------------------------------------------------------------------------------
using LCT.APICommunications.Model;
using Newtonsoft.Json;
using System.Collections.Generic;

namespace LCT.ArtifactoryUploader.Model
{
/// <summary>
/// The Model class for DisplayPackagesInfo
/// The Model class for UnkmownPackagesAll
/// </summary>

[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public class DisplayPackagesInfo
{
public List<ComponentsToArtifactory> UnknownPackagesNpm { get; set; }
Expand Down Expand Up @@ -42,28 +39,4 @@ public class DisplayPackagesInfo
public List<ComponentsToArtifactory> SuccessfullPackagesMaven { get; set; }

}
public class ProjectResponse
{
[JsonProperty("npm")]
public List<JsonComponents> Npm { get; set; }
[JsonProperty("nuget")]
public List<JsonComponents> Nuget { get; set; }
[JsonProperty("conan")]
public List<JsonComponents> Conan { get; set; }
[JsonProperty("python")]
public List<JsonComponents> Python { get; set; }
[JsonProperty("debian")]
public List<JsonComponents> Debian { get; set; }
[JsonProperty("maven")]
public List<JsonComponents> Maven { get; set; }

}

public class JsonComponents
{
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("version")]
public string Version { get; set; }
}
}
248 changes: 15 additions & 233 deletions src/ArtifactoryUploader/PackageUploadHelper.cs

Large diffs are not rendered by default.

24 changes: 8 additions & 16 deletions src/ArtifactoryUploader/PackageUploader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,23 +130,15 @@ public static void DisplayAllSettings(List<Component> m_ComponentsInBOM, CommonA

private static void PackageSettings(Config project)
{
string includeList = string.Empty;
string excludeList = string.Empty;
if (project.Include != null)
{
includeList = string.Join(",", project.Include?.ToList());
}
if (project.Exclude != null)
{
excludeList = string.Join(",", project.Exclude?.ToList());
}

Logger.Logger.Log(null, Level.Notice, $"\tDEVDEP_REPO_NAME:\t{project.JfrogDevDestRepoName}\n\t" +
$"THIRD_PARTY_REPO_NAME:\t{project.JfrogThirdPartyDestRepoName}\n\t" +
$"INTERNAL_REPO_NAME:\t{project.JfrogInternalDestRepoName}\n\t" +
$"Config:\n\t" +
$"Exclude:\t\t{excludeList}\n\t" +
$"Include: \t\t{includeList}\n", null);
Logger.Logger.Log(null, Level.Notice, $"\tDEVDEP_REPO_NAME:\t`{project.JfrogDevDestRepoName}`\n\t" +
$"THIRD_PARTY_REPO_NAME:\t`{project.JfrogThirdPartyDestRepoName}`\n\t" +
$"INTERNAL_REPO_NAME:\t`{project.JfrogInternalDestRepoName}`\n\t" +
$"Config:\n\t" +
$"Include: \t", null);
project.Include?.ToList().ForEach(x => Logger.Logger.Log(null, Level.Notice, $"\t\t\t\t`{x}`\t", null));
Logger.Logger.Log(null, Level.Notice, $"\tExclude:", null);
project.Exclude?.ToList().ForEach(x => Logger.Logger.Log(null, Level.Notice, $"\t\t\t\t`{x}`\n\t", null));
}
}
}
1 change: 1 addition & 0 deletions src/ArtifactoryUploader/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ static async Task Main(string[] args)
$"CaToolVersion\t\t {caToolInformation.CatoolVersion}\n\t" +
$"CaToolRunningPath\t {caToolInformation.CatoolRunningLocation}\n\t" +
$"JFrogUrl:\t\t {appSettings.JFrogApi}\n\t" +
$"Artifactory User:\t {appSettings.ArtifactoryUploadUser}\n\t" +
$"Release:\t\t {appSettings.Release}\n\t" +
$"LogFolderPath:\t\t {Path.GetFullPath(FolderPath)}\n", null);

Expand Down
2 changes: 1 addition & 1 deletion src/LCT.APICommunications/JfrogAqlApiCommunication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public async Task<HttpResponseMessage> GetInternalComponentDataByRepo(string rep
StringBuilder query = new();
query.Append("items.find({\"repo\":\"");
query.Append($"{repoName}");
query.Append("\"}).include(\"repo\", \"path\", \"name\", \"actual_sha1\",\"actual_md5\",\"sha256\")");
query.Append("\"}).include(\"repo\", \"path\", \"name\")");

string aqlQueryToBody = query.ToString();
string uri = $"{DomainName}{ApiConstant.JfrogArtifactoryApiSearchAql}";
Expand Down
9 changes: 0 additions & 9 deletions src/LCT.APICommunications/Model/AQL/AqlResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,5 @@ public class AqlResult

[JsonProperty("name")]
public string Name { get; set; }

[JsonProperty("actual_md5")]
public string MD5 { get; set; }

[JsonProperty("actual_sha1")]
public string SHA1 { get; set; }

[JsonProperty("sha256")]
public string SHA256 { get; set; }
}
}
2 changes: 0 additions & 2 deletions src/LCT.Common/Constants/FileConstant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,5 @@ public static class FileConstant
public const string CycloneDXFileExtension = ".cdx.json";
public const string SBOMTemplateFileExtension = "CATemplate.cdx.json";
public const string NugetAssetFile = "project.assets.json";
public const string multipleversionsFileName = "Multipleversions.json";
public const string artifactoryReportNotApproved = "ReportNotApproved.json";
}
}
3 changes: 1 addition & 2 deletions src/LCT.Common/CycloneDXBomParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static void CheckValidComponentsForProjectType(List<Component> bom, strin
foreach (var component in bom.ToList())
{
if (!string.IsNullOrEmpty(component.Name) && !string.IsNullOrEmpty(component.Version)
&& !string.IsNullOrEmpty(component.Purl) &&
&& !string.IsNullOrEmpty(component.Purl) &&
component.Purl.Contains(Dataconstant.PurlCheck()[projectType.ToUpper()]))
{
//Taking Valid Components for perticular projects
Expand All @@ -92,6 +92,5 @@ public static void CheckValidComponentsForProjectType(List<Component> bom, strin
}
}
}

}
}
4 changes: 2 additions & 2 deletions src/LCT.Common/ExceptionHandling.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ public static void FossologyException(HttpRequestException ex)
{
if (500 <= Convert.ToInt32(ex.StatusCode) && Convert.ToInt32(ex.StatusCode) <= 599)
{
Logger.Logger.Log(null, Level.Error, $"\tThe exception may arise because fossology is currently unresponsive:{ex.Message} Please try again later", null);
Logger.Logger.Log(null, Level.Error, $"The exception may arise because fossology is currently unresponsive:{ex.Message} Please try again later", null);
}
else
{
Logger.Logger.Log(null, Level.Error, $"\tThe exception may be caused by an incorrect or missing token for fossology :{ex.Message} Please ensure that a valid token is provided and try again", null);
Logger.Logger.Log(null, Level.Error, $"The exception may be caused by an incorrect or missing token for fossology :{ex.Message} Please ensure that a valid token is provided and try again", null);
}
}

Expand Down
18 changes: 0 additions & 18 deletions src/LCT.Common/Interface/IFileOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,5 @@ public interface IFileOperations
/// <param name="dataToWrite">comparisonBOM data</param>
/// <param name="filePath">filePath</param>
public string WriteContentToCycloneDXFile<T>(T dataToWrite, string filePath, string fileNameWithExtension);

/// <summary>
/// Writes the given content to the file
/// </summary>
/// <typeparam name="T">Any type</typeparam>
/// <param name="dataToWrite">Data to write</param>
/// <param name="folderPath">Folder path to save the file</param>
/// <param name="fileNameWithExtension">File Name with Extension</param>
public string WriteContentToReportNotApprovedFile<T>(T dataToWrite, string folderPath, string fileNameWithExtension, string name);

/// <summary>
/// Writes the given content to the file
/// </summary>
/// <typeparam name="T">Any type</typeparam>
/// <param name="dataToWrite">Data to write</param>
/// <param name="folderPath">Folder path to save the file</param>
/// <param name="fileNameWithExtension">File Name with Extension</param>
public string WriteContentToMultipleVersionsFile<T>(T dataToWrite, string folderPath, string fileNameWithExtension, string projectName);
}
}
30 changes: 0 additions & 30 deletions src/LCT.Common/Model/MultipleVersionValues.cs

This file was deleted.

Loading

0 comments on commit 1eeb442

Please sign in to comment.