Skip to content

[GoCyclo] Refactor Azure REST config wrapper: with builder pattern#414

Open
siddimore wants to merge 2 commits intocrossplane-contrib:mainfrom
siddimore:fix_gocyclo_lint
Open

[GoCyclo] Refactor Azure REST config wrapper: with builder pattern#414
siddimore wants to merge 2 commits intocrossplane-contrib:mainfrom
siddimore:fix_gocyclo_lint

Conversation

@siddimore
Copy link
Copy Markdown

Description of your changes

This PR refactors the Azure client’s WrapRESTConfig implementation by refactoring the code into dedicated builder types (servicePrincipalBuilder and workloadIdentityBuilder).

This cleanly separates configuration concerns, simplifies control flow, and lowers the cyclomatic complexity of the exported function.

Added, some internal helper functions to isolate parsing and validation steps.

This change removes the need for the previous nolint:gocyclo directive and aligns the implementation with more idiomatic Go patterns.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Added and ran unit tests for all new helper functions
Verified existing behavior through make reviewable test
Confirmed gocyclo passes without nolint suppression

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.

1 participant