newrelic / newrelic-client-go

New Relic Client for the Go programming language
https://newrelic.github.io/observability-as-code
Apache License 2.0
75 stars 95 forks source link

feat: add `organizationRevokeSharedAccount` and `accountManagementCancelAccount` mutations #1187

Closed iamsumit closed 4 months ago

iamsumit commented 4 months ago

We need these mutations for the project we're implementing this so adding it as PR. Thanks!

CLAassistant commented 4 months ago

CLA assistant check
All committers have signed the CLA.

codecov-commenter commented 4 months ago

Codecov Report

Attention: Patch coverage is 51.42857% with 17 lines in your changes missing coverage. Please review.

Project coverage is 38.40%. Comparing base (3ff4ee2) to head (bdec0ed). Report is 66 commits behind head on main.

Files Patch % Lines
pkg/accountmanagement/accountmanagement_api_.go 0.00% 13 Missing :warning:
pkg/accountmanagement/accountmanagement_api.go 81.81% 1 Missing and 1 partial :warning:
pkg/organization/organization_api.go 81.81% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1187 +/- ## ========================================== - Coverage 38.84% 38.40% -0.44% ========================================== Files 86 96 +10 Lines 5612 4822 -790 ========================================== - Hits 2180 1852 -328 + Misses 3266 2795 -471 - Partials 166 175 +9 ``` | [Flag](https://app.codecov.io/gh/newrelic/newrelic-client-go/pull/1187/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | Coverage Δ | | |---|---|---| | [unit](https://app.codecov.io/gh/newrelic/newrelic-client-go/pull/1187/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `38.40% <51.42%> (-0.44%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

pranav-new-relic commented 4 months ago

Hi @iamsumit and @coderkakarrot, thank you for submitting these additions to the New Relic Go Client. While all of the changes you've made are exactly on par with what one is supposed to do via Tutone, we've noticed a few discrepancies with the generated code (upon trying this myself), in response to which I had to make a couple of other changes to your code - just wanted to share these with you for context. This note shall also be useful for maintainers of the New Relic Go Client to take note of.

Owing to the above, we've moved duplicated code of the GetManagedAccounts() function with the above changes to a new file accountmanagement_api_.go, while accountmanagement_api.go would continue to have GetManagedAccounts() not yet updated via Tutone, so we have this causing no probable impact and you guys are unblocked too, while we evaluate if this can be brought back into Tutone scope sometime in future. Hence, if you'd like to use isCanceled with GetManagedAccounts(), please use the version of this function in accountmanagement_api_.go, GetManagedAccountsWithAdditionalArguments() for time being.

Rest assured, the functions for the new mutations you've added one each in accountmanagement and organization are untouched and shall be merged as they are.

I shall proceed with merging this PR and releasing these changes; shall keep you guys posted if we find a way sometime to bring accountmanagement_api_.go back into Tutone scope.

pranav-new-relic commented 4 months ago

@iamsumit FYI: these changes have just been released with v2.41.0 of the New Relic Go Client 🎉

iamsumit commented 4 months ago

@pranav-new-relic Thank you, @pranav-new-relic for this.