Skip to content

Refactor Connection types with codegen#549

Merged
rocktavious merged 2 commits into
mainfrom
kr/code-gen-connections
May 21, 2025
Merged

Refactor Connection types with codegen#549
rocktavious merged 2 commits into
mainfrom
kr/code-gen-connections

Conversation

@rocktavious
Copy link
Copy Markdown
Contributor

Resolves #

Problem

The connection types in our API are not generated by client-gen and thus everything for them in opslevel-go is hand crafted.

Solution

Actually generate the most common connection types that use nodes (for now excluding ones that truly need edges) and then fix up any none standard code because of this unification

Additionally I took the time to bite off the change to stop using totalCount everywhere since its unreliable between different queries (especially ones with filtering on the "list" call) So this just calculates on the client side the final total based on the final length of the nodes array after all pagination (and nested pagination) is done.

Checklist

  • I have run this code, and it appears to resolve the stated issue.
  • This PR does not reduce total test coverage
  • This PR has no user interface changes or has already received approval from product management to change the interface.
  • Does this change require a Terraform schema change?
    • If so what is the ticket or PR #
  • Make a changie entry that explains the customer facing outcome of this change

@rocktavious rocktavious self-assigned this May 19, 2025
Comment thread cache_test.go Outdated
Comment thread level_test.go Outdated
Comment thread level_test.go
client := BestTestClient(t, "rubric/level/list", testRequest)
// Act
result, _ := client.ListLevels()
result, err := client.ListLevels(nil)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the only customer facing change and since its a argument change in a type safe language customers code (or our other tools) will detect it at compile time

@rocktavious rocktavious merged commit 3446dd3 into main May 21, 2025
5 checks passed
@rocktavious rocktavious deleted the kr/code-gen-connections branch May 21, 2025 15:11
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