Skip to content

refactor(correlation): move upstream correlation under agent#2705

Merged
muddlebee merged 1 commit into
Tracer-Cloud:mainfrom
cerencamkiran:refactor/agent-correlation-layout
Jun 5, 2026
Merged

refactor(correlation): move upstream correlation under agent#2705
muddlebee merged 1 commit into
Tracer-Cloud:mainfrom
cerencamkiran:refactor/agent-correlation-layout

Conversation

@cerencamkiran

Copy link
Copy Markdown
Collaborator

Summary

Moves the upstream correlation package from app/correlation to app/agent/correlation to align with the current agent-centered layout.

Changes

  • Move correlation modules under app/agent/correlation
  • Update imports across runtime, pipeline, CLI, tests, and docs
  • Preserve existing correlation behavior and payload contracts
  • No functional changes

Validation

ruff format app tests
ruff check app tests

pytest tests/test_datadog_provider.py tests/test_datadog_adapter.py tests/test_upstream_correlation_provider.py -q

pytest tests/nodes/investigate/test_correlate_upstream.py tests/pipeline/test_correlation_config.py tests/synthetic/rds_postgres/test_observation_correlation.py -q

Ekran görüntüsü 2026-06-02 204750

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Greptile code review

This repo uses Greptile for automated review. Before merge, aim for Confidence Score: 5/5 with zero unresolved review threads — see CONTRIBUTING.md.

Run a review — add a PR comment with:

@greptile review

Give it ~5-10 minutes (sometimes longer) for results, then fix feedback and re-trigger until you reach Confidence Score: 5/5.

Optional: automate with the greploop skill.

@greptile-apps

greptile-apps Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR is a pure structural refactor that relocates the upstream correlation package from app/correlation/ to app/agent/correlation/, aligning it with the agent-centric module layout. No functional logic is changed — only import paths are updated across all consumers.

  • All 10 correlation modules (__init__, datadog_adapter, datadog_provider, models, node, providers, reporting, runtime, scoring, upstream) are renamed/moved and have their intra-package imports updated to the new path.
  • Import sites across app/pipeline/pipeline.py, app/pipeline/runners.py, app/cli/commands/tests.py, the full test suite, and the monkeypatch.setattr string target in tests/remote/test_server.py are all updated consistently; a grep for any remaining app.correlation references returns empty.

Confidence Score: 5/5

Safe to merge — this is a mechanical path rename with no logic changes and no remaining references to the old location.

Every import site across application code, CLI, pipeline, and tests has been updated to the new path. A repo-wide search for any lingering app.correlation references returns empty. The lazy import pattern used in runners.py and pipeline.py ensures the monkeypatch targets in the test suite resolve correctly at call time.

No files require special attention — all changed files are straightforward import-path updates.

Important Files Changed

Filename Overview
app/agent/correlation/init.py Package init re-exports the same public API as before; only import paths changed from app.correlation.* to app.agent.correlation.*
app/pipeline/pipeline.py Lazy imports of DatadogCorrelationAdapter, DatadogUpstreamEvidenceProvider, and node_correlate_upstream updated to new path; logic unchanged.
app/pipeline/runners.py Lazy import of node_correlate_upstream updated; because the import is inside the function body the monkeypatch in test_server.py remains effective.
tests/remote/test_server.py monkeypatch.setattr target string updated to app.agent.correlation.node.node_correlate_upstream; matches new module path correctly.
app/agent/correlation/node.py Import order re-sorted (app.agent.correlation before app.cli.support) and paths updated; no logic change.
app/cli/commands/tests.py Imports moved to new path and re-ordered alphabetically within import block; no functional change.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[app/pipeline/pipeline.py] -->|lazy import| B[app/agent/correlation/node.py]
    A -->|lazy import| C[app/agent/correlation/datadog_adapter.py]
    A -->|lazy import| D[app/agent/correlation/datadog_provider.py]
    E[app/pipeline/runners.py] -->|lazy import| B
    F[app/cli/commands/tests.py] -->|import| G[app/agent/correlation/runtime.py]
    F -->|import| H[app/agent/correlation/upstream.py]
    B -->|import| G
    B -->|import| I[app/agent/correlation/providers.py]
    G -->|import| J[app/agent/correlation/scoring.py]
    G -->|import| K[app/agent/correlation/reporting.py]
    G -->|import| L[app/agent/correlation/models.py]
    I -->|import| H
    C -->|import| H
    D -->|import| C
    D -->|import| H
    K -->|import| L
    J -->|import| L
    J -->|import| H
    M[app/agent/correlation/__init__.py] -->|re-exports| C
    M -->|re-exports| D
    M -->|re-exports| I
    M -->|re-exports| H
Loading

Reviews (1): Last reviewed commit: "refactor(correlation): move upstream cor..." | Re-trigger Greptile

@cerencamkiran cerencamkiran force-pushed the refactor/agent-correlation-layout branch from 674e433 to 75bd1b0 Compare June 2, 2026 17:54
@cerencamkiran

Copy link
Copy Markdown
Collaborator Author

Hi Anwesh, I accidentally picked up these two files when I ran:

Get-ChildItem app,tests,docs -Recurse -Include .py,.md |
ForEach-Object {
(Get-Content $.FullName) -replace 'app.correlation', 'app.agent.correlation' |
Set-Content $
.FullName
}

I think docs/good-first-issues/README.md could use an update. I'm also not sure what the current goal of tests/synthetic/rds_postgres/README_PROBLEMS.md is. It might be worth reviewing both in a separate docs PR.

@cerencamkiran cerencamkiran requested a review from muddlebee June 3, 2026 10:20
@muddlebee muddlebee merged commit 58139c8 into Tracer-Cloud:main Jun 5, 2026
14 checks passed
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

😭 Clear commit message. Green tests. Kind review. @cerencamkiran, stop making the rest of us look bad.


👋 Join us on Discord - OpenSRE : hang out, contribute, or hunt for features and issues. Everyone's welcome.

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