Skip to content

Commit 4aa8f33

Browse files
committed
add comment indicating the 'IsLatestVersion eq true' solution applies to JFrog but may also apply to other PMPs
1 parent 2b372e6 commit 4aa8f33

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/code/V2ServerAPICalls.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,8 +918,10 @@ private string FindAllFromTypeEndPoint(bool includePrerelease, bool isSearchingM
918918

919919
if (includePrerelease) {
920920
queryBuilder.AdditionalParameters["includePrerelease"] = "true";
921+
// note: we add 'eq true' because some PMPs (currently we know of JFrog, but others may do this too) will proxy the query unedited to the upstream remote and if that's PSGallery, it doesn't handle IsAbsoluteLatestVersion correctly
921922
filterBuilder.AddCriterion("IsAbsoluteLatestVersion eq true");
922923
} else {
924+
// note: we add 'eq true' because some PMPs (currently we know of JFrog, but others may do this too) will proxy the query unedited to the upstream remote and if that's PSGallery, it doesn't handle IsLatestVersion correctly
923925
filterBuilder.AddCriterion("IsLatestVersion eq true");
924926
}
925927
}
@@ -965,6 +967,7 @@ private string FindTagFromEndpoint(string[] tags, bool includePrerelease, bool i
965967
if (includePrerelease) {
966968
queryBuilder.AdditionalParameters["includePrerelease"] = "true";
967969
if (_isJFrogRepo) {
970+
// note: we add 'eq true' because some PMPs (currently we know of JFrog, but others may do this too) will proxy the query unedited to the upstream remote and if that's PSGallery, it doesn't handle IsAbsoluteLatestVersion correctly
968971
filterBuilder.AddCriterion("IsAbsoluteLatestVersion eq true");
969972
}
970973
else {
@@ -1014,6 +1017,7 @@ private string FindCommandOrDscResource(string[] tags, bool includePrerelease, b
10141017
if (includePrerelease) {
10151018
queryBuilder.AdditionalParameters["includePrerelease"] = "true";
10161019
if (_isJFrogRepo) {
1020+
// note: we add 'eq true' because some PMPs (currently we know of JFrog, but others may do this too) will proxy the query unedited to the upstream remote and if that's PSGallery, it doesn't handle IsAbsoluteLatestVersion correctly
10171021
filterBuilder.AddCriterion("IsAbsoluteLatestVersion eq true");
10181022
}
10191023
else {
@@ -1022,6 +1026,7 @@ private string FindCommandOrDscResource(string[] tags, bool includePrerelease, b
10221026
}
10231027
} else {
10241028
if (_isJFrogRepo) {
1029+
// note: we add 'eq true' because some PMPs (currently we know of JFrog, but others may do this too) will proxy the query unedited to the upstream remote and if that's PSGallery, it doesn't handle IsLatestVersion correctly
10251030
filterBuilder.AddCriterion("IsLatestVersion eq true");
10261031
}
10271032
else {
@@ -1067,6 +1072,7 @@ private string FindNameGlobbing(string packageName, ResourceType type, bool incl
10671072
if (includePrerelease) {
10681073
queryBuilder.AdditionalParameters["includePrerelease"] = "true";
10691074
if (_isJFrogRepo) {
1075+
// note: we add 'eq true' because some PMPs (currently we know of JFrog, but others may do this too) will proxy the query unedited to the upstream remote and if that's PSGallery, it doesn't handle IsAbsoluteLatestVersion correctly
10701076
filterBuilder.AddCriterion("IsAbsoluteLatestVersion eq true");
10711077
}
10721078
else {
@@ -1075,6 +1081,7 @@ private string FindNameGlobbing(string packageName, ResourceType type, bool incl
10751081
}
10761082
} else {
10771083
if (_isJFrogRepo) {
1084+
// note: we add 'eq true' because some PMPs (currently we know of JFrog, but others may do this too) will proxy the query unedited to the upstream remote and if that's PSGallery, it doesn't handle IsLatestVersion correctly
10781085
filterBuilder.AddCriterion("IsLatestVersion eq true");
10791086
}
10801087
else {
@@ -1174,6 +1181,7 @@ private string FindNameGlobbingWithTag(string packageName, string[] tags, Resour
11741181
if (includePrerelease) {
11751182
queryBuilder.AdditionalParameters["includePrerelease"] = "true";
11761183
if (_isJFrogRepo) {
1184+
// note: we add 'eq true' because some PMPs (currently we know of JFrog, but others may do this too) will proxy the query unedited to the upstream remote and if that's PSGallery, it doesn't handle IsAbsoluteLatestVersion correctly
11771185
filterBuilder.AddCriterion("IsAbsoluteLatestVersion eq true");
11781186
}
11791187
else {
@@ -1182,6 +1190,7 @@ private string FindNameGlobbingWithTag(string packageName, string[] tags, Resour
11821190
}
11831191
} else {
11841192
if (_isJFrogRepo) {
1193+
// note: we add 'eq true' because some PMPs (currently we know of JFrog, but others may do this too) will proxy the query unedited to the upstream remote and if that's PSGallery, it doesn't handle IsLatestVersion correctly
11851194
filterBuilder.AddCriterion("IsLatestVersion eq true");
11861195
}
11871196
else {

0 commit comments

Comments
 (0)