Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################
# Build
#############################################
FROM --platform=$BUILDPLATFORM golang:1.23-alpine as build
FROM --platform=$BUILDPLATFORM golang:1.23-alpine AS build

RUN apk upgrade --no-cache --force
RUN apk add --update build-base make git
Expand All @@ -21,7 +21,7 @@ RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} make build
#############################################
# Test
#############################################
FROM gcr.io/distroless/static as test
FROM gcr.io/distroless/static AS test
USER 0:0
WORKDIR /app
COPY --from=build /go/src/github.com/webdevops/azure-devops-exporter/azure-devops-exporter .
Expand All @@ -30,7 +30,7 @@ RUN ["./azure-devops-exporter", "--help"]
#############################################
# Final-static
#############################################
FROM gcr.io/distroless/static as final-static
FROM gcr.io/distroless/static AS final-static
ENV LOG_JSON=1
WORKDIR /
COPY --from=test /app .
Expand Down
29 changes: 29 additions & 0 deletions azure-devops-client/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ func (c *AzureDevopsClient) ListReleaseHistory(project string, minTime time.Time
url.QueryEscape(minTime.Format(time.RFC3339)),
url.QueryEscape(int64ToString(c.LimitReleasesPerProject)),
)

response, err := c.restVsrm().R().Get(url)
if err := c.checkResponse(response, err); err != nil {
error = err
Expand All @@ -197,5 +198,33 @@ func (c *AzureDevopsClient) ListReleaseHistory(project string, minTime time.Time
return
}

continuationToken := response.Header().Get("x-ms-continuationtoken")

for continuationToken != "" {
continuationUrl := fmt.Sprintf(
"%v&continuationToken=%v",
url,
continuationToken,
)

response, err = c.restVsrm().R().Get(continuationUrl)
if err := c.checkResponse(response, err); err != nil {
error = err
return
}

var tmpList ReleaseList
err = json.Unmarshal(response.Body(), &tmpList)
if err != nil {
error = err
return
}

list.Count += tmpList.Count
list.List = append(list.List, tmpList.List...)

continuationToken = response.Header().Get("x-ms-continuationtoken")
}

return
}