Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Npm and Python bug fixes #224

Merged
merged 14 commits into from
Jan 10, 2025
Merged

Npm and Python bug fixes #224

merged 14 commits into from
Jan 10, 2025

Conversation

crvreddy
Copy link
Collaborator

@crvreddy crvreddy commented Jan 2, 2025

Bug fixes:

CATool not able to Identify few Python packages which are already present in the JFROG.
CATool not able to Identify few Npm packages which are already present in the JFROG.
CATool not able to Identify few of the NPM packages exact names

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the method IsInternalNpmComponent still checks by the old way, it also needs to be updated to use the new way

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UT does not look to be updated

@adityanarayanp
Copy link
Collaborator

@ragavareddychalapala : Please also provide a screen shot of all the UT and IT passing

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IsInternalPythonComponent not updated to the latest logic

string nameVerison = string.Empty;
string jfrogcomponentName = $"{name}-{version}";
nameVerison = aqlResultList.FirstOrDefault(x => x.Name.Contains(
jfrogcomponentName, StringComparison.OrdinalIgnoreCase))?.Name ?? string.Empty;
nameVerison = aqlResultList.FirstOrDefault(x => x.properties.Any(p => p.key == "pypi.normalized.name" && p.value == name) && x.properties.Any(p => p.key == "pypi.version" && p.value == version))?.Name ?? string.Empty;
if (string.IsNullOrEmpty(nameVerison))
{
jfrogcomponentName = $"{name}_{version}";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this required as the search is now done on the name and not a combination of both

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to do this twice
if (string.IsNullOrEmpty(nameVerison))
{
jfrogcomponentName = $"{name}_{version}";
nameVerison = aqlResultList.FirstOrDefault(x => x.properties.Any(p => p.key == "pypi.normalized.name" && p.value == name) && x.properties.Any(p => p.key == "pypi.version" && p.value == version))?.Name ?? string.Empty;

}

Property projectType = new() { Name = Dataconstant.Cdx_ProjectType, Value = appSettings.ProjectType };
List<Component> modifiedBOM = new List<Component>();

foreach (var component in componentsForBOM)
{
string jfrogPackageNameWhlExten = Dataconstant.PackageNameNotFoundInJfrog;
string jfrogRepoPath = Dataconstant.JfrogRepoPathNotFound;
string jfrogRepoPath = Dataconstant.JfrogRepoPathNotFound;
string repoName = GetArtifactoryRepoName(aqlResultList, component, bomhelper, out jfrogPackageNameWhlExten, out jfrogRepoPath);
string jfrogpackageName = $"{component.Name}-{component.Version}";
var hashes = aqlResultList.FirstOrDefault(x => x.Name.Contains(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

search still done in the old way

@@ -27,13 +27,38 @@ public void GetJfrogArtifactoryRepoDetials_RepoPathFound_ReturnsAqlResultWithRep
{
// Arrange
Mock<ICycloneDXBomParser> cycloneDXBomParser = new Mock<ICycloneDXBomParser>();
AqlProperty property1 = new AqlProperty
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please give valid variable names

@@ -52,13 +77,38 @@ public void GetJfrogArtifactoryRepoDetials_RepoPathNotFound_ReturnsAqlResultWith
{
// Arrange
Mock<ICycloneDXBomParser> cycloneDXBomParser = new Mock<ICycloneDXBomParser>();
AqlProperty property1 = new AqlProperty
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please provide a valid variable data name

@adityanarayanp adityanarayanp merged commit 11bcece into development Jan 10, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants