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

fix(entity): refactor search command to convert params to query similar to TF #1490

Closed
wants to merge 1 commit into from

Conversation

pranav-new-relic
Copy link
Member

@pranav-new-relic pranav-new-relic commented Jul 28, 2023

[WIP - incomplete solution, testing needed]

The aim of this code change: move away from GetEntitySearchWithContext to GetEntitySearchByQueryWithContext in the newrelic entity search command in the CLI, in order to

  • make it work similar to how it does in the newrelic_entity data source in Terraform; convert all specified parameters into a query and then retrieve the entity via the query, instead of building an input with all parameters.
  • fix an issue recently reported, in which the SERVICE type has been deprecated, owing to which the older method now throws an error as SERVICE is no longer an accepted type.

Update: This can fix 1292 as it would allow type/domain/other parameters to be fluid, and not confined to the values listed in their respective datatypes. 1292 describes the exact same issue (that was recently reported) mentioned above, with the SERVICE type, which seems to be appearing with types not listed in the API under type.

@pranav-new-relic pranav-new-relic marked this pull request as draft July 28, 2023 18:16
@codecov
Copy link

codecov bot commented Jul 28, 2023

Codecov Report

Merging #1490 (1e715e1) into main (fa29755) will decrease coverage by 0.04%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #1490      +/-   ##
==========================================
- Coverage   47.85%   47.81%   -0.04%     
==========================================
  Files         122      122              
  Lines        7435     7441       +6     
==========================================
  Hits         3558     3558              
- Misses       3736     3742       +6     
  Partials      141      141              
Files Changed Coverage Δ
internal/entities/command_search.go 10.97% <0.00%> (-0.87%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

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