Skip to content

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
@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