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 New Relic Infrastructure alert condition support #30

Merged

Conversation

paul91
Copy link
Contributor

@paul91 paul91 commented Mar 27, 2018

My attempt at adding support for New Relic Infrastructure alert conditions. Adding this was complicated by the fact that New Relic has a separate endpoint for anything Infrastructure related.

I basically just forked paultyng/go-newrelic into paul91/go-newrelic-infra and made it Infrastructure specific. This allowed me to export it as a secondary client for the provider.

Happy to fix/change whatever. Thanks!

@vancluever vancluever added the enhancement New feature or request label Mar 28, 2018
@smithclay
Copy link
Contributor

smithclay commented Apr 4, 2018

Hey Paul, thanks for the PR!

I have contributor access to paultyng/go-newrelic and happy to take a look at the API client PR changes there to reduce the number of golang API clients and cut down on the size of this PR.

There's a separate issue open that discusses just merging paultyng/go-newrelic directly into this repo, but generally seems like it's preferred to keep it as a separate project.

@paul91
Copy link
Contributor Author

paul91 commented Apr 19, 2018

Hello! The only reason I forked paultyng/go-newrelic into its own Infra specific client was that I wasn't able to figure out a clean way to make the original one support both API endpoints.

I am happy to revisit that challenge if it's the preferred path going forward. I will see what I can do when I have some spare time, thanks for taking a look.

@Thadir
Copy link

Thadir commented May 15, 2018

Im realy interested in this option. Seeing that I really want any of our new relic config to be in terraform code.

@petewilcock
Copy link

@smithclay Any progress on this? Would you be willing to merge this PR to a 1.0.1 release with a view to refactor later? It'd be really great to have this in official mainline now that Servers has been fully EOL by NewRelic.

@paul91
Copy link
Contributor Author

paul91 commented May 16, 2018

I unfortunately haven't had time to refactor the API part of this as I've also been dealing with the Servers EOL. I will hopefully have time to revisit this by early next week.

@paul91
Copy link
Contributor Author

paul91 commented May 16, 2018

Attempted to move the Infra API CLI stuff into the original paultyng/go-newrelic project. Once this is reviewed/merged I will refactor this PR on top of it.

paultyng/go-newrelic#15

@petewilcock
Copy link

Many thanks @paul91 really appreciate your efforts here! :)

@paul91
Copy link
Contributor Author

paul91 commented May 22, 2018

paultyng/go-newrelic#15 was merged. I will begin refactoring this to make use of it and will resubmit once ready for another review.

@petewilcock
Copy link

petewilcock commented May 22, 2018 via email

@paul91 paul91 force-pushed the feature/newrelic-infra-conditions branch from 9e5647f to a2e0202 Compare June 1, 2018 15:54
@paul91
Copy link
Contributor Author

paul91 commented Jun 1, 2018

PR updated to be based on the changes to paultyng/go-newrelic

@petewilcock
Copy link

@smithclay Another nudge here :) We've got a bunch of Infrastructure alert-condition stubs set up in Terraform currently that are crying out for the new provider version 🤞

Copy link
Contributor

@smithclay smithclay left a comment

Choose a reason for hiding this comment

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

This is looking really good, thanks! Just one request to finish the //TODO test case.

@@ -84,7 +83,7 @@ func TestAccNewRelicNrqlAlertCondition_Basic(t *testing.T) {
// TODO: func_ TestAccNewRelicNrqlAlertCondition_Multi(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Finished fest case for this one would be a nice-to-have :)

Copy link
Contributor Author

@paul91 paul91 Jun 5, 2018

Choose a reason for hiding this comment

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

I will take a look at it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am actually unsure what the intention of that test case was as it isn't related to my changes or Infra. It looks like it was also copy pasted from a different test file: https://github.com/terraform-providers/terraform-provider-newrelic/blob/master/newrelic/resource_newrelic_alert_condition_test.go#L111

Copy link
Contributor

@smithclay smithclay Jun 6, 2018

Choose a reason for hiding this comment

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

Fair enough (see the some other TODOs as well). Approving this and merging after running the acceptance tests.

@smithclay smithclay merged commit 98a81d0 into newrelic:master Jun 6, 2018
@smithclay
Copy link
Contributor

This has now been released in provider version v1.0.1.

@paul91 Thanks very much for your contribution!

kidk pushed a commit to aminoz007/terraform-provider-newrelic that referenced this pull request Oct 12, 2021
…ditions

Add New Relic Infrastructure alert condition support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new-resource
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants