Skip to content

FFM-11164 Re-generate Client and Metrics API code, plus fixes #148

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

Merged
merged 14 commits into from
Apr 11, 2024

Conversation

erdirowlands
Copy link
Contributor

@erdirowlands erdirowlands commented Apr 10, 2024

What

The OAPI Client and Metrics API code has not been re-generated since 2021. We have a need to integrate new changes for a feature, so this PR re-generates the code using the latest spec.

  • The tool oapi-codegen was updated to v2 and I've generated using that, which resulted in some breaking changes with types returned by the auth endpoint, which I've fixed.
  • There was some drift which resulted in SDK code not compiling which I've corrected, mainly around API code now requiring params and requestEditors
  • The SDK now requires Go 1.20

Testing

TestGrid

Manual:

  • Auth
  • Polling
  • Streaming
  • Metrics

@@ -769,13 +748,49 @@ func getLogger(options ...ConfigOption) logger.Logger {
return dummyConfig.Logger
}

// findErrorInResponse parses an auth response and returns the response error if it exists
func findErrorInResponse(resp *rest.AuthenticateResponse) *rest.Error {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The types have changed here, presumably because of the v2 tool

@@ -196,8 +196,8 @@ func (e Evaluator) evaluateVariationMap(variationsMap []rest.VariationMap, targe
for _, variationMap := range variationsMap {
if variationMap.Targets != nil {
for _, t := range *variationMap.Targets {
if *t.Identifier != "" && *t.Identifier == target.Identifier {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again types have changed. Now a string instead of *String


require (
github.com/cenkalti/backoff/v4 v4.2.1
github.com/deepmap/oapi-codegen v1.11.0
github.com/getkin/kin-openapi v0.94.0
github.com/deepmap/oapi-codegen/v2 v2.1.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v2 has pretty significant benefits, mainly around reduced dependency bundle. See https://www.jvt.me/posts/2023/10/23/oapi-codegen-v2-decrease/

@erdirowlands erdirowlands merged commit aa45754 into main Apr 11, 2024
2 of 3 checks passed
@erdirowlands erdirowlands deleted the FFM-11164 branch April 14, 2024 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants