Skip to content

Tighten OpenClaw docs with verify/fail-fast section (#1132)#1147

Merged
VaibhavUpreti merged 8 commits intoTracer-Cloud:mainfrom
CoderHariswar:test-aws-sdk-client
Apr 30, 2026
Merged

Tighten OpenClaw docs with verify/fail-fast section (#1132)#1147
VaibhavUpreti merged 8 commits intoTracer-Cloud:mainfrom
CoderHariswar:test-aws-sdk-client

Conversation

@CoderHariswar
Copy link
Copy Markdown
Contributor

Fixes #1132

Describe the changes you have made in this PR -

Added a concise "Verify before investigating" section to docs/openclaw.mdx.

This section helps contributors quickly validate their OpenClaw setup before debugging by including:

  • verification command (opensre integrations verify openclaw)
  • correct bridge command (openclaw mcp serve)
  • requirement for OpenClaw Gateway when using stdio bridge

The section is kept under 10 lines and reuses existing terminology from the documentation.

Demo/Screenshot for feature changes and bug fixes -

Documentation update (no UI changes)


Code Understanding and AI Usage

Did you use AI assistance (ChatGPT, Claude, Copilot, etc.) to write any part of this code?

  • No, I wrote all the code myself
  • Yes, I used AI assistance (continue below)

If you used AI assistance:

  • I have reviewed every single line of the AI-generated code
  • I can explain the purpose and logic of each function/component I added
  • I have tested edge cases and understand how the code handles them
  • I have modified the AI output to follow this project's coding standards and conventions

Explain your implementation approach:


Checklist before requesting a review

  • I have added proper PR title and linked to the issue
  • I have performed a self-review of my code
  • I can explain the purpose of every function, class, and logic block I added
  • I understand why my changes work and have tested them thoroughly
  • I have considered potential edge cases and how my code handles them
  • If it is a core feature, I have added thorough tests
  • My code follows the project's style guidelines and conventions

Note: Please check Allow edits from maintainers if you would like us to assist in the PR.

CoderHariswar and others added 6 commits April 29, 2026 20:35
Add unit tests for aws_sdk_client(Tracer-Cloud#884)
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Fix module mocking and import isolation for tests
Added a concise "Verify before investigating" section to help contributors quickly validate their OpenClaw setup before debugging.

Includes:
- verification command
- correct bridge command
- gateway check for stdio bridge

Kept the section under 10 lines and aligned with existing documentation style.
Copilot AI review requested due to automatic review settings April 30, 2026 13:44
Comment thread tests/services/test_aws_sdk_client.py Outdated
Comment on lines +1 to +11
from __future__ import annotations

import sys
from types import ModuleType
import pytest
from datetime import datetime
import botocore.exceptions


# ----------------------------
# Generic dynamic mock (handles ANY attribute)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

unrelated, please remove this

Comment thread tests/services/test_aws_sdk_client.py Outdated

import sys
from types import ModuleType
import pytest
Removal of unrelated imports
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a short fail-fast verification checklist to the OpenClaw documentation, and also introduces a new unit test suite for the generic AWS SDK client.

Changes:

  • Add a “Verify before investigating” section to docs/openclaw.mdx with key setup validation commands.
  • Add tests/services/test_aws_sdk_client.py covering _is_operation_allowed, _sanitize_response, and execute_aws_sdk_call.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
docs/openclaw.mdx Adds a concise pre-debug verification checklist for OpenClaw/OpenSRE setup.
tests/services/test_aws_sdk_client.py Adds unit tests for app.services.aws_sdk_client behavior and error handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/openclaw.mdx
Comment thread tests/services/test_aws_sdk_client.py Outdated
Comment thread tests/services/test_aws_sdk_client.py Outdated
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 30, 2026

Greptile Summary

This PR adds a "Verify before investigating" section to docs/openclaw.mdx and ships a new tests/services/test_aws_sdk_client.py covering _is_operation_allowed, _sanitize_response, and execute_aws_sdk_call.

  • The test file patches sys.modules at module import time without any teardown, which pollutes the pytest session and can silently corrupt unrelated tests that import the same service modules.
  • The two stdio-bridge-specific bullets in the new docs section are presented as universal setup validation steps, which will confuse readers who only completed the basic four-step setup.

Confidence Score: 4/5

Mergeable after the sys.modules teardown issue in the test file is resolved.

One P1 finding (session-wide sys.modules pollution in the test file) should be addressed before merge; the remaining issues are P2 style/docs concerns that do not block correctness.

tests/services/test_aws_sdk_client.py — sys.modules patching needs a scoped fixture with cleanup.

Important Files Changed

Filename Overview
docs/openclaw.mdx Adds a 'Verify before investigating' section; bullets 2–3 are stdio-bridge-specific but presented as universal checks, which may confuse basic-setup users.
tests/services/test_aws_sdk_client.py New test file for aws_sdk_client; top-level sys.modules patching contaminates the test session and the file is missing a trailing newline.

Comments Outside Diff (1)

  1. tests/services/test_aws_sdk_client.py, line 259 (link)

    P2 Missing newline at end of file

    The file ends without a trailing newline (\ No newline at end of file in the diff). This is flagged by most linters (ruff W292) and make lint must pass before merging per the project quality checklist.

Reviews (1): Last reviewed commit: "Update test_aws_sdk_client.py" | Re-trigger Greptile

Comment thread tests/services/test_aws_sdk_client.py Outdated
Comment on lines +40 to +43
MAX_LIST_ITEMS,
)

# ----------------------------
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Session-wide sys.modules pollution

These four mock registrations run at import time and are never cleaned up, so they overwrite the real modules for the entire pytest session. Any other test file that later imports app.services.coralogix, app.services.tracer_client, app.services.datadog, or app.services.elasticsearch will silently receive the mock objects instead, which can mask real failures or cause unrelated tests to break depending on collection order.

Move the registrations into a module-scoped autouse fixture with teardown:

import pytest, sys

@pytest.fixture(autouse=True, scope="module")
def _patch_imports():
    mocks = {
        "app.services.coralogix": coralogix_mock,
        "app.services.tracer_client": tracer_mock,
        "app.services.datadog": create_mock_module("app.services.datadog"),
        "app.services.elasticsearch": create_mock_module("app.services.elasticsearch"),
    }
    sys.modules.update(mocks)
    yield
    for key in mocks:
        sys.modules.pop(key, None)

Comment thread docs/openclaw.mdx
Comment on lines +55 to +57
- Run `opensre integrations verify openclaw`
- Ensure the bridge command is `openclaw mcp serve`
- Confirm the OpenClaw Gateway is running when using the stdio bridge
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Stdio-bridge-specific steps presented as universal checks

Bullets 2 and 3 only apply when the optional stdio bridge is in use (OPENCLAW_MCP_MODE=stdio). A reader who only completed the basic four-step setup has no bridge command and no Gateway to check, so these bullets will confuse them. Consider adding a qualifier like "(only if using the stdio bridge)" to those bullets.

Copy link
Copy Markdown
Member

@VaibhavUpreti VaibhavUpreti left a comment

Choose a reason for hiding this comment

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

Great @CoderHariswar !! Thanks for fixing this

@VaibhavUpreti VaibhavUpreti merged commit b472093 into Tracer-Cloud:main Apr 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔥 Another one. @CoderHariswar said "here's a PR" and maintainers said "ship it". That's how it's done.


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

@CoderHariswar CoderHariswar deleted the test-aws-sdk-client branch April 30, 2026 13:55
@CoderHariswar CoderHariswar restored the test-aws-sdk-client branch April 30, 2026 18:52
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.

Tighten docs/openclaw.mdx with a short verify/fail-fast section

4 participants