-
-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add options to GetIssuesForSprint #353
Conversation
The CHange is looking good. Thanks @oriser! I will keep it open for a few days to provide the opportunity for other contributors to review it. |
Hi, sorry if I'm wrong. Maybe it's a good idea to make a new function along the lines of "GetIssuesForSprintWithOptions", so it would not be a breaking change and possibly add a "MaxResults" option to the options? Then other options, such as "MaxResults" and "StartAt" could also be implemented? |
@gueldenstone has a good point. One way this could be done is by something like this Update the SearchOptions struct to implement the Then add a new struct type for the Then update the API for GetIssuesForSprintWithContext so that it looks like this func (s *SprintService) GetIssuesForSprintWithContext(ctx context.Context, sprintID int, encoders ...query.Encoder) ([]Issue, *Response, error) {
...
url := apiEndpoint
for _, encoder := range encoders {
url, err := addOptions(url, encoder)
}
... Since the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change would also require the implementation of the query.Encoder interface for the SearchOptions struct which is not in the current set of changed files.
See comment: #353 (comment)
@benjivesterby I can do it NP, but IMHO it better like the original PR, as I saw the rest of the calls are look like this and I think it better to keep the same conventions.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After reviewing the query library used the Encoder option is not viable. I do not like the fact that this breaks the API as it will likely affect a number of users. I would prefer that the parameter added was variadic in nature and perhaps implemented a type defined in this package for example.
type QueryValues map[string]string
This way multiple query values could be passed while keeping the initial implementation if a user doesn't update their function signature. I'm open to suggestions but I feel like breaking the API for this change is unnecessary.
Description
Adding query options to
GetIssuesForSprint
andGetIssueWithContext
Information that is useful here:
GetIssuesForSprint
andGetIssueWithContext
GetIssuesForSprint
and will update to this version, will need to passnil
(or real query if he wish)Example:
Let us know how users can use or test this functionality.
Checklist