Skip to content

[Fix] Bazel warnings - #1209

Merged
ccgsnet merged 1 commit into
masterfrom
fix-build-warns
Jul 31, 2026
Merged

[Fix] Bazel warnings#1209
ccgsnet merged 1 commit into
masterfrom
fix-build-warns

Conversation

@ccgsnet

@ccgsnet ccgsnet commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@ccgsnet ccgsnet self-assigned this Jul 30, 2026
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

  • Moves LOG_LEVEL definitions before dependent headers in several agent and profiling-test files, addressing Bazel/preprocessor warnings without changing public APIs or runtime logic.
  • Tightens compiler diagnostics and type handling: marks RAISE_ERROR as unreachable, casts Redis command counts and PostgreSQL row bounds explicitly, and removes duplicate AtomPersister batch-count accounting. These changes reduce warning risk but warrant validation of error paths and counter correctness.
  • No new allocations are introduced; the Redis batching and atom persistence hot paths retain their existing allocation behavior. The AtomPersister fix prevents inflated accounting rather than changing batch memory usage.
  • No matching behavior-focused tests are added. Existing profiling coverage is unchanged, and the Redis, persistence-counting, SQL-boundary, and macro control-flow changes should be covered by tests under src/tests/ or client suites.

Walkthrough

The changes reorder LOG_LEVEL definitions before dependent includes, correct Redis and PostgreSQL size comparisons, remove duplicate batch-count accounting, and mark RAISE_ERROR continuation as unreachable.

Changes

Core build and correctness fixes

Layer / File(s) Summary
Logging macro include ordering
src/agents/*, src/tests/cpp/profiling_test.cc
LOG_LEVEL is defined before dependent headers are included.
Batching, accounting, and row-bound corrections
src/atomdb/redis_mongodb/RedisMongoDB.cc, src/db_adapter/AtomPersister.cc, src/db_adapter/sql/postgres/PostgresWrapper.cc
Redis pending-command comparison, batch count accumulation, and PostgreSQL row-bound comparison are updated.
Error macro control flow
src/commons/Utils.h
RAISE_ERROR(msg) appends __builtin_unreachable() after the error call.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • singnet/das#1189: Overlaps RedisMongoDB::add_links while changing a different batching-related condition.

Suggested reviewers: marcocapozzoli


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error, 1 inconclusive)

Check name Status Explanation Resolution
Tests For Behavior Changes ❌ Error AtomPersister::send_batch changes behavior, but the only test edit is include-order-only profiling_test.cc; no behavior test was added. Add/update a test covering the AtomPersister count fix (and any other logic changes), or state in the PR description why tests are intentionally omitted.
Description check ❓ Inconclusive No description was provided, so the PR intent is not described beyond the title. Add a brief description of the warning fixes and any behavior impact or testing performed.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the change set, which mainly fixes build-time warnings and related compiler issues.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-build-warns

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

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.

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 `@src/db_adapter/AtomPersister.cc`:
- Line 192: Add or update a Bazel *_test.cc for AtomPersister batch accounting,
covering single and multiple successful batches, concurrent batches, and failed
batches. Verify each successful batch increments total_count exactly once and
failed batches do not affect the count; register the test with the applicable
Bazel target.
🪄 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: CHILL

Plan: Pro Plus

Run ID: 05554501-fb5d-427c-bcc3-1a54d1dbf7bf

📥 Commits

Reviewing files that changed from the base of the PR and between b76e939 and 847d9d1.

📒 Files selected for processing (8)
  • src/agents/inference_agent/InferenceAgent.cc
  • src/agents/link_creation_agent/LinkCreationAgent.cc
  • src/agents/link_creation_agent/LinkCreationRequestProcessor.cc
  • src/atomdb/redis_mongodb/RedisMongoDB.cc
  • src/commons/Utils.h
  • src/db_adapter/AtomPersister.cc
  • src/db_adapter/sql/postgres/PostgresWrapper.cc
  • src/tests/cpp/profiling_test.cc

Comment thread src/db_adapter/AtomPersister.cc
@ccgsnet
ccgsnet merged commit a636ae6 into master Jul 31, 2026
3 checks passed
@ccgsnet
ccgsnet deleted the fix-build-warns branch July 31, 2026 10:50
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