azure-devops-python-api icon indicating copy to clipboard operation
azure-devops-python-api copied to clipboard

"filter_contains" argument causes get_refs to find no matches

Open yoelai opened this issue 6 years ago • 1 comments

Hi,

I have a piece of code that uses get_refs with a prefix filter argument. I observed the results and then I put in filter_contains a character that I can see exists in all the refs returned from the first call to get_refs. The call with the filter_contains returns 0 refs.

refs = self._connection.clients_v5_1.get_git_client().get_refs(repository_id = repo_id,
                                      project = project_id,
                                      filter = prefix_filter,
                                      peel_tags = True,
                                      include_statuses = True,
                                      latest_statuses_only = True,
                                      top = 100,
                                      continuation_token = continuation_token)

In this example, all relevant ref name field contain the character 'V'. The call:

refs = self._connection.clients_v5_1.get_git_client().get_refs(repository_id = repo_id,
                                      project = project_id,
                                      filter = prefix_filter,
                                      peel_tags = True,
                                      include_statuses = True,
                                      latest_statuses_only = True,
                                      top = 100,
                                      continuation_token = continuation_token,
                                      filter_contains = "V")

results in refs containing 0 results, and the call returns almost immediately, as opposed to taking several seconds in the first call.

Thanks.

yoelai avatar Dec 31 '19 10:12 yoelai

This question seams to be related to the endpoint behavior on the service rather than the behavior of the SDK. I sent a mail to the team that owns the git endpoints, so hopefully you will hear back something soon. You can also post your question on the REST documentation page here, which should get routed directly to that team:

https://docs.microsoft.com/en-us/rest/api/azure/devops/git/?view=azure-devops-rest-5.1

tedchamb avatar Jan 02 '20 19:01 tedchamb