From 6bab24c888d91eb69ca441d09914518f8451a607 Mon Sep 17 00:00:00 2001 From: Eamonn Mansour <47121388+eamansour@users.noreply.github.com> Date: Thu, 22 Aug 2024 09:34:42 +0100 Subject: [PATCH] Remove includeCursor query parameter Signed-off-by: Eamonn Mansour <47121388+eamansour@users.noreply.github.com> --- pkg/runs/runsDownload_test.go | 1 - pkg/runs/runsGet.go | 6 +++--- pkg/runs/runsGet_test.go | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/runs/runsDownload_test.go b/pkg/runs/runsDownload_test.go index da726600..06d48490 100644 --- a/pkg/runs/runsDownload_test.go +++ b/pkg/runs/runsDownload_test.go @@ -250,7 +250,6 @@ func WriteMockRasRunsResponse( writer.Write([]byte(fmt.Sprintf(` { - "nextCursor": "", "pageSize": 1, "amountOfRuns": %d, "runs":[ %s ] diff --git a/pkg/runs/runsGet.go b/pkg/runs/runsGet.go index 851385c5..cd847a6d 100644 --- a/pkg/runs/runsGet.go +++ b/pkg/runs/runsGet.go @@ -222,7 +222,7 @@ func GetRunsFromRestApi( var pageNumberWanted int32 = 1 gotAllResults := false var restApiVersion string - var pageCursor string = "" + var pageCursor string restApiVersion, err = embedded.GetGalasactlRestApiVersion() @@ -233,7 +233,7 @@ func GetRunsFromRestApi( var runData *galasaapi.RunResults var httpResponse *http.Response log.Printf("Requesting page '%d' ", pageNumberWanted) - apicall := apiClient.ResultArchiveStoreAPIApi.GetRasSearchRuns(context).ClientApiVersion(restApiVersion).IncludeCursor("true") + apicall := apiClient.ResultArchiveStoreAPIApi.GetRasSearchRuns(context).ClientApiVersion(restApiVersion) if fromAgeMins != 0 { apicall = apicall.From(fromTime) } @@ -274,7 +274,7 @@ func GetRunsFromRestApi( results = append(results, runsOnThisPage...) // If the page cursor is the same, then we've gone through all pages - if pageCursor == runData.GetNextCursor() || runData.GetNextCursor() == "" { + if pageCursor == runData.GetNextCursor() || !runData.HasNextCursor() { gotAllResults = true } else { pageCursor = runData.GetNextCursor() diff --git a/pkg/runs/runsGet_test.go b/pkg/runs/runsGet_test.go index 2937fb78..1a9968c4 100644 --- a/pkg/runs/runsGet_test.go +++ b/pkg/runs/runsGet_test.go @@ -86,7 +86,6 @@ const ( EMPTY_RUNS_RESPONSE = ` { - "nextCursor": "", "pageSize": 1, "amountOfRuns": 0, "runs":[]