microsoft / microsoft/azure-devops-go-api

GetPolicyConfigurations returns a continuationToken but it is not taking the token back in the request

Open
#156 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
223
Forks
92
PR merge metrics
No merged PRs in 30d

Description

The api

GetPolicyConfigurations(ctx context.Context, args GetPolicyConfigurationsArgs) (*GetPolicyConfigurationsResponseValue, error)

returns the type GetPolicyConfigurationsResponseValue:

// Return type for the GetPolicyConfigurations function
type GetPolicyConfigurationsResponseValue struct {
	Value             []PolicyConfiguration
	ContinuationToken string
}

However, the args model GetPolicyConfigurationsArgs does not takes the token back:

type GetPolicyConfigurationsArgs struct {
	// (required) Project ID or project name
	Project *string
	// (optional) [Provided for legacy reasons] The scope on which a subset of policies is defined.
	Scope *string
	// (optional) Filter returned policies to only this type
	PolicyType *uuid.UUID
}

I can manually replicate the api in my application and implement the continuationToken, for now, but, ideally, can you fix this API to be similar to the other APIs that uses continuation token? And even better, if you can add the pager like: https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/azcore/runtime/pager.go#L44

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the GetPolicyConfigurations API and its GetPolicyConfigurationsArgs and GetPolicyConfigurationsResponseValue types, then compare nearby APIs that already accept continuation tokens. Done means the request can pass the returned token and retrieve subsequent results; assess separately whether a pager-style helper is appropriate.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.