We have > 100 labels in the security repo, and we were not paginating the call to retrieve them. Previously, this was working because the labels we wanted to apply to an issue (typically Kibana, snyk, and triage_needed) were within the first 100 results, but as new labels were created, some of the labels are now in the second page of results (specifically "triage_needed"). This caused ensureLabelsAreCreated to throw when attempting to create an existing label.
This PR adds pagination of the listLabelsForRepo API call.
Additionally, this PR replaces the deprecated snyk List all projects v1 API with the newer REST API. The v1 API EOL is December 22, 2023. See the official statement for more information.
We have > 100 labels in the security repo, and we were not paginating the call to retrieve them. Previously, this was working because the labels we wanted to apply to an issue (typically
Kibana
,snyk
, andtriage_needed
) were within the first 100 results, but as new labels were created, some of the labels are now in the second page of results (specifically "triage_needed"). This causedensureLabelsAreCreated
to throw when attempting to create an existing label.This PR adds pagination of the
listLabelsForRepo
API call.Additionally, this PR replaces the deprecated snyk List all projects v1 API with the newer REST API. The v1 API EOL is December 22, 2023. See the official statement for more information.