Skip to content

Commit

Permalink
fix my comments
Browse files Browse the repository at this point in the history
  • Loading branch information
anamnavi committed Dec 9, 2024
1 parent 84c5dd8 commit 2b372e6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/code/V2ServerAPICalls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,6 @@ private string FindAllFromTypeEndPoint(bool includePrerelease, bool isSearchingM
}

// JFrog/Artifactory requires an empty search term to enumerate all packages in the feed
// It also deems 'IsLatestVersion eq true' and 'IsAbsoluteLatestVersion eq true' in the filter to be a bad request, so we use 'IsLatestVersion' or 'IsAbsoluteLatestVersion' only
if (_isJFrogRepo) {
queryBuilder.SearchTerm = "''";

Expand All @@ -925,6 +924,7 @@ private string FindAllFromTypeEndPoint(bool includePrerelease, bool isSearchingM
}
}
else {
// For ADO, 'IsLatestVersion eq true' and 'IsAbsoluteLatestVersion eq true' in the filter create a bad request error, so we use 'IsLatestVersion' or 'IsAbsoluteLatestVersion' only
if (includePrerelease) {
queryBuilder.AdditionalParameters["includePrerelease"] = "true";
filterBuilder.AddCriterion("IsAbsoluteLatestVersion");
Expand Down Expand Up @@ -962,20 +962,21 @@ private string FindTagFromEndpoint(string[] tags, bool includePrerelease, bool i
queryBuilder.AdditionalParameters["$orderby"] = "Id desc";
}

// JFrog/Artifactory deems 'IsLatestVersion eq true' and 'IsAbsoluteLatestVersion eq true' in the filter to be a bad request, so we use 'IsLatestVersion' or 'IsAbsoluteLatestVersion' only
if (includePrerelease) {
queryBuilder.AdditionalParameters["includePrerelease"] = "true";
if (_isJFrogRepo) {
filterBuilder.AddCriterion("IsAbsoluteLatestVersion eq true");
}
else {
// For ADO, 'IsLatestVersion eq true' and 'IsAbsoluteLatestVersion eq true' in the filter create a bad request error, so we use 'IsLatestVersion' or 'IsAbsoluteLatestVersion' only
filterBuilder.AddCriterion("IsAbsoluteLatestVersion");
}
} else {
if (_isJFrogRepo) {
filterBuilder.AddCriterion("IsLatestVersion eq true");
}
else {
// For ADO, 'IsLatestVersion eq true' and 'IsAbsoluteLatestVersion eq true' in the filter create a bad request error, so we use 'IsLatestVersion' or 'IsAbsoluteLatestVersion' only
filterBuilder.AddCriterion("IsLatestVersion");
}
}
Expand Down Expand Up @@ -1010,20 +1011,21 @@ private string FindCommandOrDscResource(string[] tags, bool includePrerelease, b
queryBuilder.AdditionalParameters["$orderby"] = "Id desc";
}

// JFrog/Artifactory deems 'IsLatestVersion eq true' and 'IsAbsoluteLatestVersion eq true' in the filter to be a bad request, so we use 'IsLatestVersion' or 'IsAbsoluteLatestVersion' only
if (includePrerelease) {
queryBuilder.AdditionalParameters["includePrerelease"] = "true";
if (_isJFrogRepo) {
filterBuilder.AddCriterion("IsAbsoluteLatestVersion eq true");
}
else {
// For ADO, 'IsLatestVersion eq true' and 'IsAbsoluteLatestVersion eq true' in the filter create a bad request error, so we use 'IsLatestVersion' or 'IsAbsoluteLatestVersion' only
filterBuilder.AddCriterion("IsAbsoluteLatestVersion");
}
} else {
if (_isJFrogRepo) {
filterBuilder.AddCriterion("IsLatestVersion eq true");
}
else {
// For ADO, 'IsLatestVersion eq true' and 'IsAbsoluteLatestVersion eq true' in the filter create a bad request error, so we use 'IsLatestVersion' or 'IsAbsoluteLatestVersion' only
filterBuilder.AddCriterion("IsLatestVersion");
}
}
Expand Down Expand Up @@ -1062,20 +1064,21 @@ private string FindNameGlobbing(string packageName, ResourceType type, bool incl
queryBuilder.AdditionalParameters["$orderby"] = "Id desc";
}

// It also deems 'IsLatestVersion eq true' and 'IsAbsoluteLatestVersion eq true' in the filter to be a bad request, so we use 'IsLatestVersion' or 'IsAbsoluteLatestVersion' only
if (includePrerelease) {
queryBuilder.AdditionalParameters["includePrerelease"] = "true";
if (_isJFrogRepo) {
filterBuilder.AddCriterion("IsAbsoluteLatestVersion eq true");
}
else {
// For ADO, 'IsLatestVersion eq true' and 'IsAbsoluteLatestVersion eq true' in the filter create a bad request error, so we use 'IsLatestVersion' or 'IsAbsoluteLatestVersion' only
filterBuilder.AddCriterion("IsAbsoluteLatestVersion");
}
} else {
if (_isJFrogRepo) {
filterBuilder.AddCriterion("IsLatestVersion eq true");
}
else {
// For ADO, 'IsLatestVersion eq true' and 'IsAbsoluteLatestVersion eq true' in the filter create a bad request error, so we use 'IsLatestVersion' or 'IsAbsoluteLatestVersion' only
filterBuilder.AddCriterion("IsLatestVersion");
}
}
Expand Down Expand Up @@ -1168,20 +1171,21 @@ private string FindNameGlobbingWithTag(string packageName, string[] tags, Resour
}

// JFrog/Artifactory requires an empty search term to enumerate all packages in the feed
// It also deems 'IsLatestVersion eq true' and 'IsAbsoluteLatestVersion eq true' in the filter to be a bad request, so we use 'IsLatestVersion' or 'IsAbsoluteLatestVersion' only
if (includePrerelease) {
queryBuilder.AdditionalParameters["includePrerelease"] = "true";
if (_isJFrogRepo) {
filterBuilder.AddCriterion("IsAbsoluteLatestVersion eq true");
}
else {
// For ADO, 'IsLatestVersion eq true' and 'IsAbsoluteLatestVersion eq true' in the filter create a bad request error, so we use 'IsLatestVersion' or 'IsAbsoluteLatestVersion' only
filterBuilder.AddCriterion("IsAbsoluteLatestVersion");
}
} else {
if (_isJFrogRepo) {
filterBuilder.AddCriterion("IsLatestVersion eq true");
}
else {
// For ADO, 'IsLatestVersion eq true' and 'IsAbsoluteLatestVersion eq true' in the filter create a bad request error, so we use 'IsLatestVersion' or 'IsAbsoluteLatestVersion' only
filterBuilder.AddCriterion("IsLatestVersion");
}
}
Expand Down

0 comments on commit 2b372e6

Please sign in to comment.