Skip to content
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 IPAM generic client bindings #114

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

LittleFox94
Copy link
Contributor

@LittleFox94 LittleFox94 commented Mar 23, 2022

Description

Adds generic client bindings for the IPAM API.

Checklist

  • added release notes to Unreleased section in CHANGELOG.md, if user facing change

References

  • SYSENG-923

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

return url.Parse("/api/ipam/v1/prefix.json")
}

func (p *Prefix) FilterAPIRequestBody(ctx context.Context) (interface{}, error) {
Copy link

Choose a reason for hiding this comment

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

Method Prefix.FilterAPIRequestBody has 6 return statements (exceeds 4 allowed).

"go.anx.io/go-anxcloud/pkg/utils/object/filter"
)

func (a *Address) EndpointURL(ctx context.Context) (*url.URL, error) {
Copy link

Choose a reason for hiding this comment

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

Method Address.EndpointURL has 5 return statements (exceeds 4 allowed).

pkg/utils/object/filter/filter.go Outdated Show resolved Hide resolved
pkg/utils/object/filter/filter.go Outdated Show resolved Hide resolved
pkg/utils/object/filter/filter.go Outdated Show resolved Hide resolved
@codeclimate
Copy link

codeclimate bot commented Mar 23, 2022

Code Climate has analyzed commit 2579a39 and detected 3 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 3

View more on Code Climate.

@marioreggiori
Copy link

Extracted filter helper for objects into a separate PR #143

@LittleFox94 LittleFox94 force-pushed the syseng-923/ipam-generic-client branch from 17e30e7 to 0cbdf16 Compare June 10, 2022 12:01
return url.Parse("/api/ipam/v1/prefix.json")
}

func (p *Prefix) FilterAPIRequestBody(ctx context.Context) (interface{}, error) {
Copy link

Choose a reason for hiding this comment

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

Method Prefix.FilterAPIRequestBody has 7 return statements (exceeds 4 allowed).

return url.Parse("/api/ipam/v1/prefix.json")
}

func (p *Prefix) FilterAPIRequestBody(ctx context.Context) (interface{}, error) {
Copy link

Choose a reason for hiding this comment

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

Method Prefix.FilterAPIRequestBody has 69 lines of code (exceeds 50 allowed). Consider refactoring.

return url.Parse("/api/ipam/v1/prefix.json")
}

func (p *Prefix) FilterAPIRequestBody(ctx context.Context) (interface{}, error) {
Copy link

Choose a reason for hiding this comment

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

Method Prefix.FilterAPIRequestBody has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.

This is the first iteration, providing most of the old address and
prefix API. However, most of the important stuff is implemented.
Unfortunately, it took me waaay to long to get to this state, mainly due
to timeouts in the Engine and missing knowledge of the client internals.

Although the tests can run mostly parallel, we might switch to a serial
execution to ensure that the API isn't bombarded with endless requests.

Co-authored-by: Mara Sophie Grosch <mgrosch@anexia.com>
Ticket: SYSENG-923
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.

3 participants