newrelic / terraform-provider-newrelic

Terraform provider for New Relic
https://registry.terraform.io/providers/newrelic/newrelic/latest/docs
Mozilla Public License 2.0
202 stars 245 forks source link

fix(entity): add argument `ignore_not_found` to ignore "not found" errors #2628

Closed pranav-new-relic closed 6 months ago

pranav-new-relic commented 6 months ago

New Relic Internal

Jira

Summary

This PR proposes the addition of a new attribute ignore_not_found to the newrelic_entity data source in order to "ignore" not found errors if set true in the configuration, thereby stopping automated Terraform pipelines from halting if the entity is lost, which is useful in cases when the entity abruptly expires (see original usecase proposed by the customer in #2599).

Testing

The changes have been manually verified multifold. The test cases could not be updated because they fail with an "id" not found error, since the data source fetches no entity, which we try validating (without the expectation of an error being thrown, instead).

codecov-commenter commented 6 months ago

Codecov Report

Attention: Patch coverage is 0% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 33.78%. Comparing base (e6a5d8e) to head (43214e8).

Files Patch % Lines
newrelic/data_source_newrelic_entity.go 0.00% 13 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2628 +/- ## ========================================== + Coverage 32.83% 33.78% +0.95% ========================================== Files 98 98 Lines 26872 26884 +12 ========================================== + Hits 8824 9084 +260 + Misses 17890 17600 -290 - Partials 158 200 +42 ```

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