Skip to content

feat(pipelinecontrol): add OttlTransform field and make NRQL nullable on PipelineCloudRuleEntity - #1474

Open
pranav-new-relic wants to merge 1 commit into
mainfrom
feat/pipeline-cloud-rule-ottl-nullable-nrql
Open

feat(pipelinecontrol): add OttlTransform field and make NRQL nullable on PipelineCloudRuleEntity#1474
pranav-new-relic wants to merge 1 commit into
mainfrom
feat/pipeline-cloud-rule-ottl-nullable-nrql

Conversation

@pranav-new-relic

Copy link
Copy Markdown
Member

Summary

Prepares pkg/pipelinecontrol for the NGEP schema change in ep-next-gen-api PR #1860, which relaxes PipelineCloudRuleEntity.nrql from Nrql! to Nrql and adds a new ottlTransform sibling field to support OTTL-based pipeline cloud rules alongside existing NRQL rules.

Changes

  • EntityManagementPipelineCloudRuleEntity.NRQL: nrdb.NRQL*nrdb.NRQL with omitempty — null responses from NGEP now deserialise to nil instead of silently coercing to empty string
  • OttlTransform field added to EntityManagementPipelineCloudRuleEntity with a new EntityManagementPipelineCloudRuleEntityOttlTransform struct (logStatements, eventStatements, metricStatements, traceStatements)
  • getEntityQuery and getEntitySearchQuery updated to fetch ottlTransform { ... } in the ... on EntityManagementPipelineCloudRuleEntity inline fragment
  • Create/Update input types are intentionally unchanged — they still carry NRQL nrdb.NRQL (non-pointer) for NRQL-based rules; OTTL input support is deferred until the backend ships

Test plan

  • go build ./pkg/pipelinecontrol/... passes (verified locally)
  • Existing NRQL-based integration tests pass unchanged (NRQL rules always return non-null nrql)
  • After ep-next-gen-api PR #1860 merges and NGEP schema is live: end-to-end read of an OTTL rule returns populated OttlTransform and nil NRQL

🤖 Generated with Claude Code

… on PipelineCloudRuleEntity

PipelineCloudRuleEntity.NRQL is changing from Nrql! to Nrql in
ep-next-gen-api (PR #1860) to support a new OTTL-based rule type
alongside existing NRQL rules. This commit prepares the Go client:

- NRQL field: nrdb.NRQL -> *nrdb.NRQL with omitempty so null
  responses from NGEP deserialise to nil rather than empty string
- OttlTransform field added to EntityManagementPipelineCloudRuleEntity
  with a new EntityManagementPipelineCloudRuleEntityOttlTransform struct
  (logStatements, eventStatements, metricStatements, traceStatements)
- getEntityQuery and getEntitySearchQuery updated to fetch ottlTransform
  from the inline PipelineCloudRuleEntity fragment
- Create/Update input types are intentionally unchanged: they always
  carry NRQL for NRQL-based rules and OTTL inputs are not yet supported

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 32.75%. Comparing base (6773d0a) to head (40bbd0c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1474      +/-   ##
==========================================
+ Coverage   32.71%   32.75%   +0.04%     
==========================================
  Files         148      148              
  Lines        6939     6939              
==========================================
+ Hits         2270     2273       +3     
+ Misses       4455     4454       -1     
+ Partials      214      212       -2     
Flag Coverage Δ
unit 32.75% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants