Skip to content

chore: address Sonar scan issues#91

Open
willkill07 wants to merge 5 commits into
NVIDIA:mainfrom
willkill07:wkk_fix-sonar-scan-issues
Open

chore: address Sonar scan issues#91
willkill07 wants to merge 5 commits into
NVIDIA:mainfrom
willkill07:wkk_fix-sonar-scan-issues

Conversation

@willkill07
Copy link
Copy Markdown
Member

@willkill07 willkill07 commented May 13, 2026

Overview

Addresses current Sonar scan maintainability findings by reducing flagged cognitive complexity and duplicate literals without changing public behavior.

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.
  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Details

  • Split the CLI banner renderer into focused helpers for width calculation, grid construction, dock-tag overlay, and styled cell rendering.
  • Split setup config generation into exporter and agent table helpers.
  • Added Go test constants/helpers to remove duplicated literals and reduce branch-heavy observability test flow.
  • Breaking changes: none.

Validation:

  • go test -run 'Test(AtofExporter|ObservabilityPlugin|ObservabilityAtif)' ./...
  • cargo test -p nemo-flow-cli
  • just test-go
  • just test-rust
  • go fmt ./...
  • cargo clippy --workspace --all-targets -- -D warnings
  • git diff --check
  • uv run pre-commit run --files crates/cli/src/banner.rs crates/cli/src/setup.rs go/nemo_flow/atof_test.go go/nemo_flow/observability_plugin_test.go was run; all relevant Rust/Go hooks passed, with only the pre-existing generated-doc lychee failure remaining.

Where should the reviewer start?

Start with crates/cli/src/banner.rs for the largest complexity refactor, then review the Go test helper extraction in go/nemo_flow/observability_plugin_test.go.

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • Relates to: none

Summary by CodeRabbit

  • Refactor

    • Modularized banner rendering and configuration generation for clearer, more maintainable behavior.
  • Tests

    • Added and updated unit tests; introduced shared test helpers and constants for consistent assertions.
    • New test verifies exporter config omits an unused endpoint when its backend is not selected.
  • Style

    • Standardized test constants and helper utilities to reduce duplication and improve clarity.

Review Change Stack

Signed-off-by: Will Killian <wkillian@nvidia.com>
@willkill07 willkill07 requested a review from a team as a code owner May 13, 2026 01:19
@github-actions github-actions Bot added size:L PR is large Maintenance CI or Build or general repository maintenance lang:go PR changes/introduces Go code lang:rust PR changes/introduces Rust code labels May 13, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 1d30a857-6622-43d6-b12f-d058a01f82c5

📥 Commits

Reviewing files that changed from the base of the PR and between 22e52a4 and 025a5ba.

📒 Files selected for processing (1)
  • go/nemo_flow/observability_plugin_test.go
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (16)
go/nemo_flow/**/*.go

📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)

Format changed Go packages with cd go/nemo_flow && go fmt ./...

Use PascalCase naming convention for Go API implementations

For Go binding changes, run go fmt ./... within the Go module to format all Go files

Files:

  • go/nemo_flow/observability_plugin_test.go
**/*.go

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.go: Use gofmt for Go code formatting
Use go vet ./... for Go static analysis
Use PascalCase naming convention for Go code

Files:

  • go/nemo_flow/observability_plugin_test.go
**/*.{rs,go,js,ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Include SPDX license headers in all Rust, Go, JavaScript, and TypeScript source files using C-style comment syntax

Files:

  • go/nemo_flow/observability_plugin_test.go
**/*.{rs,py,go,js,ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use SONAR_IGNORE_START / SONAR_IGNORE_END markers only for documented false positives that cannot be resolved in code; keep ignored blocks small, add explanatory comments, and require reviewer sign-off

Files:

  • go/nemo_flow/observability_plugin_test.go
**/*.{md,markdown,py,sh,bash,js,ts,java,cpp,go,rust}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Keep package names, repo references, and build commands current in documentation

Files:

  • go/nemo_flow/observability_plugin_test.go
{crates/adaptive/**,python/nemo_flow/{adaptive,plugin}.py,go/nemo_flow/{adaptive,**}/*.go,**/*.{ts,js,wasm}}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Keep adaptive config schema, plugin lifecycle, and bindings in sync across crates/adaptive, core, bindings, Python (python/nemo_flow/adaptive.py and python/nemo_flow/plugin.py), Go (go/nemo_flow/adaptive and go/nemo_flow), and Node/WebAssembly helpers

Files:

  • go/nemo_flow/observability_plugin_test.go
{crates/adaptive/**/*.rs,python/nemo_flow/adaptive.py,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{helper,constructor,builder}.{ts,tsx,js}}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Ensure typed helper constructors map cleanly to the same config document without divergence

Files:

  • go/nemo_flow/observability_plugin_test.go
{crates/adaptive/**/*.rs,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{plugin,lifecycle}.{ts,tsx,js}}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Maintain consistent plugin lifecycle across all language bindings (Rust, Python, Go, Node/WebAssembly)

Files:

  • go/nemo_flow/observability_plugin_test.go
{crates/adaptive/**/*.rs,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{context,plugin}.{ts,tsx,js,rs}}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Keep plugin context surfaces aligned across all language implementations

Files:

  • go/nemo_flow/observability_plugin_test.go
{docs/**,examples/**,crates/adaptive/**,python/nemo_flow/**,go/nemo_flow/**,**/{example,component}.{ts,tsx,js,rs,py,go}}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Any new adaptive component kind must have documentation, examples, and binding coverage across all supported languages

Files:

  • go/nemo_flow/observability_plugin_test.go
**/*.{js,ts,tsx,jsx,py,rs,go,java,c,cpp,h,cc,cxx,cs,rb,php,swift,kt}

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

Changed files must be formatted with the language-native formatter

Files:

  • go/nemo_flow/observability_plugin_test.go
go/**/*.go

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If Go language surface changed, always run Go test target even when Rust core did not change

Files:

  • go/nemo_flow/observability_plugin_test.go
**/*.{py,js,ts,tsx,go,rs,md}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

Format changed files with the language-native formatter before the final lint/test pass

Files:

  • go/nemo_flow/observability_plugin_test.go
**/*.{rs,py,js,ts,tsx,go}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

During iteration, prefer uv run pre-commit run --files <changed files...> for targeted validation

Files:

  • go/nemo_flow/observability_plugin_test.go
go/nemo_flow/**/*

⚙️ CodeRabbit configuration file

go/nemo_flow/**/*: Review Go binding changes for cgo memory ownership, race safety, callback cleanup, idiomatic exported APIs, and parity with Rust/FFI behavior.
Any API change should include focused Go tests and consider race-test behavior.

Files:

  • go/nemo_flow/observability_plugin_test.go
{crates/**/tests/**,python/tests/**,go/nemo_flow/**/*_test.go}

⚙️ CodeRabbit configuration file

{crates/**/tests/**,python/tests/**,go/nemo_flow/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.

Files:

  • go/nemo_flow/observability_plugin_test.go
🔇 Additional comments (1)
go/nemo_flow/observability_plugin_test.go (1)

14-21: LGTM!

Also applies to: 53-57, 63-64, 74-75, 83-84, 97-98, 100-101, 105-106, 120-150, 186-190, 198-199, 205-206, 216-256


Walkthrough

Decomposes the Rust CLI banner renderer into internal helpers and types, moves setup TOML exporters/agents assembly into builder helpers with a test for OpenInference omission, and consolidates Go test constants and helper assertions for ATOF/ATIF tests.

Changes

Rust CLI Refactoring

Layer / File(s) Summary
Banner types and entry point refactoring
crates/cli/src/banner.rs
DockTagSpan and CellStyle types added; render_frame_inner now orchestrates rendering via helper functions.
Banner rendering helper functions
crates/cli/src/banner.rs
Extracted frame_width, build_grid, padded_row, overlay_dock_tag, push_grid_row, push_vertical_border, push_cell, push_styled_char, and cell_style to centralize grid building and per-cell styling/ANSI application.
Setup config builder refactoring
crates/cli/src/setup.rs, crates/cli/tests/coverage/setup_tests.rs
build_config delegates exporters/agents TOML construction to build_exporters_table and build_agents_table with per-backend inserters; added test build_config_ignores_openinference_endpoint_when_backend_not_selected.

Go Test Infrastructure Consolidation

Layer / File(s) Summary
ATOF test constants and assertion helpers
go/nemo_flow/atof_test.go
Added eventsJSONLFilename constant and test helpers requireNoError and generic requireEqual[T]; updated lifecycle and append/overwrite tests to use the constants and helpers.
Observability plugin test refactoring and helpers
go/nemo_flow/observability_plugin_test.go
Added shared error-message and TrajectoryFilenamePrefix constants; introduced helpers InitializeAtifPlugin, EmitAgentStart, EmitAgentEnd, EmitAgentTrajectory, and TrajectoryFilePath; updated tests to use these helpers and filename constants.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.71% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Title follows Conventional Commits format with 'chore' type and concise imperative summary under 72 characters.
Description check ✅ Passed Description covers all required template sections with specific details on changes, validation steps, and reviewer guidance.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/cli/src/setup.rs`:
- Around line 142-144: The insertion of the OpenInference exporter is
unconditional when answers.openinference_endpoint is present, which can add the
exporter even if the chosen backend is not ObservabilityBackend::OpenInference;
change the logic around insert_openinference_exporter so it only runs when the
selected backend equals ObservabilityBackend::OpenInference (check the answers'
backend selection field used elsewhere), i.e., guard the call to
insert_openinference_exporter(&mut exporters, endpoint) with a match/if that
verifies the backend enum variant before inserting to avoid serializing
unintended exporters.

In `@go/nemo_flow/observability_plugin_test.go`:
- Around line 210-223: initializeAtifPlugin sets global plugin state but doesn't
guarantee cleanup on test exit; add a t.Cleanup registration at the start of
initializeAtifPlugin to call ClearPluginConfiguration() so plugin state is
always cleared even if the test fails. Specifically, inside initializeAtifPlugin
(near t.Helper()), call t.Cleanup(func(){ requireNoError(t,
ClearPluginConfiguration(), clearPluginConfigurationFailed) }) and remove or
keep the current ClearPluginConfiguration() call as appropriate so state is
reset when the test finishes; reference functions: initializeAtifPlugin and
ClearPluginConfiguration and the requireNoError helper.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 4c8c8b5a-d4bb-438d-bc6b-4ea44c4cf061

📥 Commits

Reviewing files that changed from the base of the PR and between 43db71b and 0eb1dc5.

📒 Files selected for processing (4)
  • crates/cli/src/banner.rs
  • crates/cli/src/setup.rs
  • go/nemo_flow/atof_test.go
  • go/nemo_flow/observability_plugin_test.go
📜 Review details
🧰 Additional context used
📓 Path-based instructions (17)
go/nemo_flow/**/*.go

📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)

Format changed Go packages with cd go/nemo_flow && go fmt ./...

Use PascalCase naming convention for Go API implementations

For Go binding changes, run go fmt ./... within the Go module to format all Go files

Files:

  • go/nemo_flow/atof_test.go
  • go/nemo_flow/observability_plugin_test.go
**/*.go

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.go: Use gofmt for Go code formatting
Use go vet ./... for Go static analysis
Use PascalCase naming convention for Go code

Files:

  • go/nemo_flow/atof_test.go
  • go/nemo_flow/observability_plugin_test.go
**/*.{rs,go,js,ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Include SPDX license headers in all Rust, Go, JavaScript, and TypeScript source files using C-style comment syntax

Files:

  • go/nemo_flow/atof_test.go
  • crates/cli/src/setup.rs
  • crates/cli/src/banner.rs
  • go/nemo_flow/observability_plugin_test.go
**/*.{rs,py,go,js,ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use SONAR_IGNORE_START / SONAR_IGNORE_END markers only for documented false positives that cannot be resolved in code; keep ignored blocks small, add explanatory comments, and require reviewer sign-off

Files:

  • go/nemo_flow/atof_test.go
  • crates/cli/src/setup.rs
  • crates/cli/src/banner.rs
  • go/nemo_flow/observability_plugin_test.go
**/*.{md,markdown,py,sh,bash,js,ts,java,cpp,go,rust}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Keep package names, repo references, and build commands current in documentation

Files:

  • go/nemo_flow/atof_test.go
  • go/nemo_flow/observability_plugin_test.go
{crates/adaptive/**,python/nemo_flow/{adaptive,plugin}.py,go/nemo_flow/{adaptive,**}/*.go,**/*.{ts,js,wasm}}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Keep adaptive config schema, plugin lifecycle, and bindings in sync across crates/adaptive, core, bindings, Python (python/nemo_flow/adaptive.py and python/nemo_flow/plugin.py), Go (go/nemo_flow/adaptive and go/nemo_flow), and Node/WebAssembly helpers

Files:

  • go/nemo_flow/atof_test.go
  • go/nemo_flow/observability_plugin_test.go
{crates/adaptive/**/*.rs,python/nemo_flow/adaptive.py,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{helper,constructor,builder}.{ts,tsx,js}}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Ensure typed helper constructors map cleanly to the same config document without divergence

Files:

  • go/nemo_flow/atof_test.go
  • go/nemo_flow/observability_plugin_test.go
{crates/adaptive/**/*.rs,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{plugin,lifecycle}.{ts,tsx,js}}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Maintain consistent plugin lifecycle across all language bindings (Rust, Python, Go, Node/WebAssembly)

Files:

  • go/nemo_flow/atof_test.go
  • go/nemo_flow/observability_plugin_test.go
{crates/adaptive/**/*.rs,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{context,plugin}.{ts,tsx,js,rs}}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Keep plugin context surfaces aligned across all language implementations

Files:

  • go/nemo_flow/atof_test.go
  • go/nemo_flow/observability_plugin_test.go
{docs/**,examples/**,crates/adaptive/**,python/nemo_flow/**,go/nemo_flow/**,**/{example,component}.{ts,tsx,js,rs,py,go}}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Any new adaptive component kind must have documentation, examples, and binding coverage across all supported languages

Files:

  • go/nemo_flow/atof_test.go
  • go/nemo_flow/observability_plugin_test.go
**/*.{js,ts,tsx,jsx,py,rs,go,java,c,cpp,h,cc,cxx,cs,rb,php,swift,kt}

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

Changed files must be formatted with the language-native formatter

Files:

  • go/nemo_flow/atof_test.go
  • crates/cli/src/setup.rs
  • crates/cli/src/banner.rs
  • go/nemo_flow/observability_plugin_test.go
go/**/*.go

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If Go language surface changed, always run Go test target even when Rust core did not change

Files:

  • go/nemo_flow/atof_test.go
  • go/nemo_flow/observability_plugin_test.go
**/*.{py,js,ts,tsx,go,rs,md}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

Format changed files with the language-native formatter before the final lint/test pass

Files:

  • go/nemo_flow/atof_test.go
  • crates/cli/src/setup.rs
  • crates/cli/src/banner.rs
  • go/nemo_flow/observability_plugin_test.go
**/*.{rs,py,js,ts,tsx,go}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

During iteration, prefer uv run pre-commit run --files <changed files...> for targeted validation

Files:

  • go/nemo_flow/atof_test.go
  • crates/cli/src/setup.rs
  • crates/cli/src/banner.rs
  • go/nemo_flow/observability_plugin_test.go
go/nemo_flow/**/*

⚙️ CodeRabbit configuration file

go/nemo_flow/**/*: Review Go binding changes for cgo memory ownership, race safety, callback cleanup, idiomatic exported APIs, and parity with Rust/FFI behavior.
Any API change should include focused Go tests and consider race-test behavior.

Files:

  • go/nemo_flow/atof_test.go
  • go/nemo_flow/observability_plugin_test.go
{crates/**/tests/**,python/tests/**,go/nemo_flow/**/*_test.go}

⚙️ CodeRabbit configuration file

{crates/**/tests/**,python/tests/**,go/nemo_flow/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.

Files:

  • go/nemo_flow/atof_test.go
  • go/nemo_flow/observability_plugin_test.go
**/*.rs

📄 CodeRabbit inference engine (.agents/skills/test-ffi-surface/SKILL.md)

**/*.rs: Run cargo fmt --all for FFI work as it is Rust work
Run just test-rust for FFI validation
Run cargo clippy --workspace --all-targets -- -D warnings to enforce warnings-as-errors linting

When Rust files changed as part of Python work, run cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for Rust code formatting
Run cargo clippy --workspace --all-targets -- -D warnings to enforce Rust linting with no warnings
Run just test-rust as the shared-runtime build/test wrapper for Rust changes

Use Rust snake_case naming convention for Rust code

**/*.rs: Any Rust change must run just test-rust
Any Rust change must run cargo fmt --all
Any Rust change must run cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for Rust code formatting when Node changes touch Rust files
Run cargo clippy --workspace --all-targets -- -D warnings to enforce strict linting when Rust files changed as part of Node work

**/*.rs: Always run just test-rust when any Rust code changes
Always run cargo fmt --all when any Rust code changes
Always run cargo clippy --workspace --all-targets -- -D warnings when any Rust code changes

Files:

  • crates/cli/src/setup.rs
  • crates/cli/src/banner.rs
🔇 Additional comments (5)
crates/cli/src/banner.rs (3)

105-123: Clean orchestration in render_frame_inner.

The refactor into width/grid/overlay/row-render steps is clear and keeps the control flow easy to audit.


130-166: Width and dock-tag placement logic is well-factored.

frame_width + overlay_dock_tag form a coherent contract, and the span metadata keeps placement intent explicit.


168-224: Cell-style routing is a solid maintainability improvement.

Centralizing border/cell/style handling removes duplicated branching and makes future styling changes safer.

crates/cli/src/setup.rs (1)

119-125: Good conditional top-level table emission

Nice improvement: only writing [exporters] / [agents] when present keeps generated TOML minimal and avoids empty sections.

go/nemo_flow/atof_test.go (1)

15-54: Good refactor of repetitive test assertions

The shared filename constant and requireNoError/requireEqual helpers reduce duplication without changing behavior in the lifecycle and mode tests.

Also applies to: 136-149

Comment thread crates/cli/src/setup.rs Outdated
Comment thread go/nemo_flow/observability_plugin_test.go Outdated
willkill07 and others added 2 commits May 12, 2026 21:51
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@go/nemo_flow/observability_plugin_test.go`:
- Around line 14-21: Constants and helper identifiers in this file use
lowerCamelCase but must be PascalCase per repo Go rules: rename
clearPluginConfigurationFailed → ClearPluginConfigurationFailed,
initializePluginsFailed → InitializePluginsFailed, trajectoryFilenamePrefix →
TrajectoryFilenamePrefix, firstAgentName → FirstAgentName, nestedAgentName →
NestedAgentName, secondAgentName → SecondAgentName, and likewise rename any
helper functions/variables in the 118-146, 134-146 and 210-250 ranges to
PascalCase; update every reference/usages in the package to the new names to
keep builds/tests passing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 67588b3d-baf5-4248-b3e8-eede3b11d60e

📥 Commits

Reviewing files that changed from the base of the PR and between 0eb1dc5 and 1e61026.

📒 Files selected for processing (3)
  • crates/cli/src/setup.rs
  • crates/cli/tests/coverage/setup_tests.rs
  • go/nemo_flow/observability_plugin_test.go
📜 Review details
🧰 Additional context used
📓 Path-based instructions (17)
**/*.rs

📄 CodeRabbit inference engine (.agents/skills/test-ffi-surface/SKILL.md)

**/*.rs: Run cargo fmt --all for FFI work as it is Rust work
Run just test-rust for FFI validation
Run cargo clippy --workspace --all-targets -- -D warnings to enforce warnings-as-errors linting

When Rust files changed as part of Python work, run cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for Rust code formatting
Run cargo clippy --workspace --all-targets -- -D warnings to enforce Rust linting with no warnings
Run just test-rust as the shared-runtime build/test wrapper for Rust changes

Use Rust snake_case naming convention for Rust code

**/*.rs: Any Rust change must run just test-rust
Any Rust change must run cargo fmt --all
Any Rust change must run cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for Rust code formatting when Node changes touch Rust files
Run cargo clippy --workspace --all-targets -- -D warnings to enforce strict linting when Rust files changed as part of Node work

**/*.rs: Always run just test-rust when any Rust code changes
Always run cargo fmt --all when any Rust code changes
Always run cargo clippy --workspace --all-targets -- -D warnings when any Rust code changes

Files:

  • crates/cli/tests/coverage/setup_tests.rs
  • crates/cli/src/setup.rs
**/*.{rs,go,js,ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Include SPDX license headers in all Rust, Go, JavaScript, and TypeScript source files using C-style comment syntax

Files:

  • crates/cli/tests/coverage/setup_tests.rs
  • crates/cli/src/setup.rs
  • go/nemo_flow/observability_plugin_test.go
**/*.{rs,py,go,js,ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use SONAR_IGNORE_START / SONAR_IGNORE_END markers only for documented false positives that cannot be resolved in code; keep ignored blocks small, add explanatory comments, and require reviewer sign-off

Files:

  • crates/cli/tests/coverage/setup_tests.rs
  • crates/cli/src/setup.rs
  • go/nemo_flow/observability_plugin_test.go
**/*.{js,ts,tsx,jsx,py,rs,go,java,c,cpp,h,cc,cxx,cs,rb,php,swift,kt}

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

Changed files must be formatted with the language-native formatter

Files:

  • crates/cli/tests/coverage/setup_tests.rs
  • crates/cli/src/setup.rs
  • go/nemo_flow/observability_plugin_test.go
**/*.{py,js,ts,tsx,go,rs,md}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

Format changed files with the language-native formatter before the final lint/test pass

Files:

  • crates/cli/tests/coverage/setup_tests.rs
  • crates/cli/src/setup.rs
  • go/nemo_flow/observability_plugin_test.go
**/*.{rs,py,js,ts,tsx,go}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

During iteration, prefer uv run pre-commit run --files <changed files...> for targeted validation

Files:

  • crates/cli/tests/coverage/setup_tests.rs
  • crates/cli/src/setup.rs
  • go/nemo_flow/observability_plugin_test.go
{crates/**/tests/**,python/tests/**,go/nemo_flow/**/*_test.go}

⚙️ CodeRabbit configuration file

{crates/**/tests/**,python/tests/**,go/nemo_flow/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.

Files:

  • crates/cli/tests/coverage/setup_tests.rs
  • go/nemo_flow/observability_plugin_test.go
go/nemo_flow/**/*.go

📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)

Format changed Go packages with cd go/nemo_flow && go fmt ./...

Use PascalCase naming convention for Go API implementations

For Go binding changes, run go fmt ./... within the Go module to format all Go files

Files:

  • go/nemo_flow/observability_plugin_test.go
**/*.go

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.go: Use gofmt for Go code formatting
Use go vet ./... for Go static analysis
Use PascalCase naming convention for Go code

Files:

  • go/nemo_flow/observability_plugin_test.go
**/*.{md,markdown,py,sh,bash,js,ts,java,cpp,go,rust}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Keep package names, repo references, and build commands current in documentation

Files:

  • go/nemo_flow/observability_plugin_test.go
{crates/adaptive/**,python/nemo_flow/{adaptive,plugin}.py,go/nemo_flow/{adaptive,**}/*.go,**/*.{ts,js,wasm}}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Keep adaptive config schema, plugin lifecycle, and bindings in sync across crates/adaptive, core, bindings, Python (python/nemo_flow/adaptive.py and python/nemo_flow/plugin.py), Go (go/nemo_flow/adaptive and go/nemo_flow), and Node/WebAssembly helpers

Files:

  • go/nemo_flow/observability_plugin_test.go
{crates/adaptive/**/*.rs,python/nemo_flow/adaptive.py,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{helper,constructor,builder}.{ts,tsx,js}}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Ensure typed helper constructors map cleanly to the same config document without divergence

Files:

  • go/nemo_flow/observability_plugin_test.go
{crates/adaptive/**/*.rs,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{plugin,lifecycle}.{ts,tsx,js}}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Maintain consistent plugin lifecycle across all language bindings (Rust, Python, Go, Node/WebAssembly)

Files:

  • go/nemo_flow/observability_plugin_test.go
{crates/adaptive/**/*.rs,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{context,plugin}.{ts,tsx,js,rs}}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Keep plugin context surfaces aligned across all language implementations

Files:

  • go/nemo_flow/observability_plugin_test.go
{docs/**,examples/**,crates/adaptive/**,python/nemo_flow/**,go/nemo_flow/**,**/{example,component}.{ts,tsx,js,rs,py,go}}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Any new adaptive component kind must have documentation, examples, and binding coverage across all supported languages

Files:

  • go/nemo_flow/observability_plugin_test.go
go/**/*.go

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If Go language surface changed, always run Go test target even when Rust core did not change

Files:

  • go/nemo_flow/observability_plugin_test.go
go/nemo_flow/**/*

⚙️ CodeRabbit configuration file

go/nemo_flow/**/*: Review Go binding changes for cgo memory ownership, race safety, callback cleanup, idiomatic exported APIs, and parity with Rust/FFI behavior.
Any API change should include focused Go tests and consider race-test behavior.

Files:

  • go/nemo_flow/observability_plugin_test.go
🔇 Additional comments (4)
crates/cli/src/setup.rs (2)

130-149: Good backend-to-exporter gating.

openinference is now emitted only when ObservabilityBackend::OpenInference is selected and an endpoint exists, which prevents stale endpoint-only serialization.


181-199: Helper split for agent table is clean and behavior-preserving.

The None fast-path for empty agents and the Hermes-only hooks_path insertion keep output minimal and deterministic.

crates/cli/tests/coverage/setup_tests.rs (1)

117-132: Nice regression test for backend/endpoint decoupling.

This test protects the exact contract: endpoint presence alone must not produce [exporters.openinference].

go/nemo_flow/observability_plugin_test.go (1)

210-226: Good hardening: helper now guarantees plugin-state cleanup.

Adding t.Cleanup(...) in initializeAtifPlugin prevents cross-test state leakage on early failures and closes the earlier teardown gap.

Comment thread go/nemo_flow/observability_plugin_test.go
mnajafian-nv
mnajafian-nv previously approved these changes May 13, 2026
Copy link
Copy Markdown
Contributor

@mnajafian-nv mnajafian-nv left a comment

Choose a reason for hiding this comment

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

LGTM. I checked the setup exporter gating, banner refactor, and Go test cleanup changes.

Signed-off-by: Will Killian <wkillian@nvidia.com>
@willkill07 willkill07 added this to the 0.2.0 milestone May 13, 2026
@willkill07 willkill07 self-assigned this May 13, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@go/nemo_flow/observability_plugin_test.go`:
- Around line 51-55: The initial ClearPluginConfiguration call in
TestObservabilityPluginAtofAndAtifFiles (and the other direct-initialization
test around the second block) only runs at test start and can leak global plugin
state on early failures; register an unconditional cleanup by calling t.Cleanup
with a function that calls ClearPluginConfiguration() so the global state is
cleared regardless of test outcome, keeping the existing initial error check
(t.Fatalf on initial ClearPluginConfiguration error) and adding the
t.Cleanup(...) registration immediately after the successful initialization in
both tests.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 412464d4-2806-41ca-9813-b0883cc64e79

📥 Commits

Reviewing files that changed from the base of the PR and between 1e61026 and 22e52a4.

📒 Files selected for processing (1)
  • go/nemo_flow/observability_plugin_test.go
📜 Review details
🧰 Additional context used
📓 Path-based instructions (16)
go/nemo_flow/**/*.go

📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)

Format changed Go packages with cd go/nemo_flow && go fmt ./...

Use PascalCase naming convention for Go API implementations

For Go binding changes, run go fmt ./... within the Go module to format all Go files

Files:

  • go/nemo_flow/observability_plugin_test.go
**/*.go

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.go: Use gofmt for Go code formatting
Use go vet ./... for Go static analysis
Use PascalCase naming convention for Go code

Files:

  • go/nemo_flow/observability_plugin_test.go
**/*.{rs,go,js,ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Include SPDX license headers in all Rust, Go, JavaScript, and TypeScript source files using C-style comment syntax

Files:

  • go/nemo_flow/observability_plugin_test.go
**/*.{rs,py,go,js,ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use SONAR_IGNORE_START / SONAR_IGNORE_END markers only for documented false positives that cannot be resolved in code; keep ignored blocks small, add explanatory comments, and require reviewer sign-off

Files:

  • go/nemo_flow/observability_plugin_test.go
**/*.{md,markdown,py,sh,bash,js,ts,java,cpp,go,rust}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Keep package names, repo references, and build commands current in documentation

Files:

  • go/nemo_flow/observability_plugin_test.go
{crates/adaptive/**,python/nemo_flow/{adaptive,plugin}.py,go/nemo_flow/{adaptive,**}/*.go,**/*.{ts,js,wasm}}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Keep adaptive config schema, plugin lifecycle, and bindings in sync across crates/adaptive, core, bindings, Python (python/nemo_flow/adaptive.py and python/nemo_flow/plugin.py), Go (go/nemo_flow/adaptive and go/nemo_flow), and Node/WebAssembly helpers

Files:

  • go/nemo_flow/observability_plugin_test.go
{crates/adaptive/**/*.rs,python/nemo_flow/adaptive.py,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{helper,constructor,builder}.{ts,tsx,js}}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Ensure typed helper constructors map cleanly to the same config document without divergence

Files:

  • go/nemo_flow/observability_plugin_test.go
{crates/adaptive/**/*.rs,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{plugin,lifecycle}.{ts,tsx,js}}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Maintain consistent plugin lifecycle across all language bindings (Rust, Python, Go, Node/WebAssembly)

Files:

  • go/nemo_flow/observability_plugin_test.go
{crates/adaptive/**/*.rs,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{context,plugin}.{ts,tsx,js,rs}}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Keep plugin context surfaces aligned across all language implementations

Files:

  • go/nemo_flow/observability_plugin_test.go
{docs/**,examples/**,crates/adaptive/**,python/nemo_flow/**,go/nemo_flow/**,**/{example,component}.{ts,tsx,js,rs,py,go}}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Any new adaptive component kind must have documentation, examples, and binding coverage across all supported languages

Files:

  • go/nemo_flow/observability_plugin_test.go
**/*.{js,ts,tsx,jsx,py,rs,go,java,c,cpp,h,cc,cxx,cs,rb,php,swift,kt}

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

Changed files must be formatted with the language-native formatter

Files:

  • go/nemo_flow/observability_plugin_test.go
go/**/*.go

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If Go language surface changed, always run Go test target even when Rust core did not change

Files:

  • go/nemo_flow/observability_plugin_test.go
**/*.{py,js,ts,tsx,go,rs,md}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

Format changed files with the language-native formatter before the final lint/test pass

Files:

  • go/nemo_flow/observability_plugin_test.go
**/*.{rs,py,js,ts,tsx,go}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

During iteration, prefer uv run pre-commit run --files <changed files...> for targeted validation

Files:

  • go/nemo_flow/observability_plugin_test.go
go/nemo_flow/**/*

⚙️ CodeRabbit configuration file

go/nemo_flow/**/*: Review Go binding changes for cgo memory ownership, race safety, callback cleanup, idiomatic exported APIs, and parity with Rust/FFI behavior.
Any API change should include focused Go tests and consider race-test behavior.

Files:

  • go/nemo_flow/observability_plugin_test.go
{crates/**/tests/**,python/tests/**,go/nemo_flow/**/*_test.go}

⚙️ CodeRabbit configuration file

{crates/**/tests/**,python/tests/**,go/nemo_flow/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.

Files:

  • go/nemo_flow/observability_plugin_test.go
🔇 Additional comments (1)
go/nemo_flow/observability_plugin_test.go (1)

14-21: LGTM!

Also applies to: 60-71, 97-102, 117-147, 210-250

Comment thread go/nemo_flow/observability_plugin_test.go
Signed-off-by: Will Killian <wkillian@nvidia.com>
Copy link
Copy Markdown
Contributor

@mnajafian-nv mnajafian-nv left a comment

Choose a reason for hiding this comment

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

Re-reviewed latest head. CodeRabbit’s cleanup feedback is addressed now: both direct-initialization tests register t.Cleanup(...), and CI is green. LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang:go PR changes/introduces Go code lang:rust PR changes/introduces Rust code Maintenance CI or Build or general repository maintenance size:L PR is large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants