Skip to content

Conversation

@cvvergara
Copy link
Member

@cvvergara cvvergara commented Jan 13, 2026

Changes proposed in this pull request:

  • Function to print notice
    • This is a helper function for developing
    • Includes instructions on how to use it

@pgRouting/admins

Summary by CodeRabbit

  • New Features

    • Added a native-layer mechanism to emit standardized informational NOTICE messages, improving clarity of informational output.
  • Chores

    • Adjusted a public declaration's parameter notation; no behavioral change to existing exported interfaces.

✏️ Tip: You can customize this high-level summary in your review settings.

@cvvergara cvvergara added this to the Release 4.1.0 milestone Jan 13, 2026
@cvvergara cvvergara requested a review from robe2 January 13, 2026 04:23
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 13, 2026

Walkthrough

Added a public notice helper pgr_print_notice(const char*) (declaration in include/c_common/e_report.h, implementation in src/common/e_report.c) and removed parameter names from the pgr_global_report public declaration.

Changes

Cohort / File(s) Summary
Header updates
include/c_common/e_report.h
Added prototype void pgr_print_notice(const char*); with documentation; changed pgr_global_report declaration from void pgr_global_report(char** log_msg, char** notice_msg, char** error_msg); to void pgr_global_report(char**, char**, char**); (parameter names removed).
Implementation
src/common/e_report.c
Implemented void pgr_print_notice(const char* msg) which emits a PostgreSQL NOTICE via ereport(NOTICE, (errmsg_internal("%s", msg))); (placed alongside existing error-reporting utilities).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I hop to press a quiet key,
A notice hums across the lair,
Tiny message, clear and bright,
I print it softly in the night. 🐇✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a new developer helper function pgr_print_notice, which matches the file modifications that introduce this function in both the header and implementation files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cd6a134 and af78909.

📒 Files selected for processing (2)
  • include/c_common/e_report.h
  • src/common/e_report.c
🧰 Additional context used
🧠 Learnings (22)
📓 Common learnings
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 0
File: :0-0
Timestamp: 2025-01-27T01:49:25.212Z
Learning: In pgRouting, when deprecating internal functions:
1. Add deprecation notice in C code using ereport with ERRCODE_FEATURE_NOT_SUPPORTED
2. Update tests with version checks (min_version, min_lib_version)
3. Document changes in NEWS.md under appropriate sections
📚 Learning: 2025-01-27T01:49:25.212Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 0
File: :0-0
Timestamp: 2025-01-27T01:49:25.212Z
Learning: In pgRouting, when deprecating internal functions:
1. Add deprecation notice in C code using ereport with ERRCODE_FEATURE_NOT_SUPPORTED
2. Update tests with version checks (min_version, min_lib_version)
3. Document changes in NEWS.md under appropriate sections

Applied to files:

  • include/c_common/e_report.h
  • src/common/e_report.c
📚 Learning: 2025-02-06T20:50:07.967Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2744
File: doc/src/release_notes.rst:94-94
Timestamp: 2025-02-06T20:50:07.967Z
Learning: In pgRouting, changes to functions can happen at two levels:
1. SQL level - removal/addition of function signatures
2. C/C++ level - deprecation/changes to the underlying implementation
These are documented separately in the release notes.

Applied to files:

  • include/c_common/e_report.h
📚 Learning: 2025-02-06T20:50:00.577Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2744
File: NEWS.md:63-63
Timestamp: 2025-02-06T20:50:00.577Z
Learning: In pgRouting's NEWS.md, the "Removal of SQL deprecated internal functions" section lists SQL signatures being removed, while "Deprecation of internal C/C++ functions" section lists the underlying C/C++ implementations being deprecated. A function can appear in both sections when its SQL signature is removed while its C/C++ implementation is deprecated.

Applied to files:

  • include/c_common/e_report.h
📚 Learning: 2025-01-19T16:18:55.529Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/dijkstra/dijkstra_driver.cpp:147-148
Timestamp: 2025-01-19T16:18:55.529Z
Learning: In pgRouting, error messages should not be modified without careful consideration as they are verified by pgtap tests. Changes to error messages require corresponding updates to test cases.

Applied to files:

  • include/c_common/e_report.h
  • src/common/e_report.c
📚 Learning: 2025-01-19T13:16:52.140Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2723
File: tools/developer/run.sh:130-144
Timestamp: 2025-01-19T13:16:52.140Z
Learning: In the pgRouting project, function documentation should be kept minimal and concise, focusing on essential information only.

Applied to files:

  • include/c_common/e_report.h
📚 Learning: 2025-02-27T23:08:14.497Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2771
File: doc/topology/pgr_degree.rst:28-35
Timestamp: 2025-02-27T23:08:14.497Z
Learning: In the pgRouting documentation, historical version notes should be retained to show the evolution of functions across different versions.

Applied to files:

  • include/c_common/e_report.h
📚 Learning: 2025-01-19T13:17:09.832Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2723
File: tools/developer/run.sh:146-152
Timestamp: 2025-01-19T13:17:09.832Z
Learning: In the pgRouting project, prefer minimal documentation for shell functions unless explicitly requested otherwise. The code should be self-documenting where possible.

Applied to files:

  • include/c_common/e_report.h
📚 Learning: 2025-01-19T16:18:00.783Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/trsp/trsp_withPoints_driver.cpp:120-121
Timestamp: 2025-01-19T16:18:00.783Z
Learning: In pgRouting, modifying error messages requires updating pgtap test expectations, so such changes should be carefully considered due to the test maintenance burden.

Applied to files:

  • include/c_common/e_report.h
  • src/common/e_report.c
📚 Learning: 2025-04-25T02:12:17.271Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2871
File: include/drivers/transitiveClosure/transitiveClosure_driver.h:45-49
Timestamp: 2025-04-25T02:12:17.271Z
Learning: The pgRouting project avoids using named parameters in C header files to prevent conflicts with Doxygen documentation.

Applied to files:

  • include/c_common/e_report.h
📚 Learning: 2025-04-25T15:12:03.608Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2874
File: doc/utilities/pgr_separateCrossing.rst:26-27
Timestamp: 2025-04-25T15:12:03.608Z
Learning: In pgRouting documentation, official functions don't include version information in their index entries (`:single:` directives). Only deprecated functions include when they were deprecated in the index entries.

Applied to files:

  • include/c_common/e_report.h
📚 Learning: 2025-09-17T02:09:53.993Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2970
File: doc/contraction/pgr_contraction.rst:0-0
Timestamp: 2025-09-17T02:09:53.993Z
Learning: In pgRouting documentation, pseudocode blocks can use generic variable names that don't necessarily match the exact parameter names in the API, as decided by maintainer cvvergara for doc/contraction/pgr_contraction.rst.

Applied to files:

  • include/c_common/e_report.h
📚 Learning: 2025-04-29T18:59:06.824Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2879
File: sql/dijkstra/dijkstra.sql:56-57
Timestamp: 2025-04-29T18:59:06.824Z
Learning: The maintainer prefers not to add inline comments to internal function calls like _pgr_dijkstra, even when they contain multiple boolean and numeric flags.

Applied to files:

  • include/c_common/e_report.h
📚 Learning: 2025-02-27T23:05:28.589Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2771
File: sql/common/_checkquery.sql:33-33
Timestamp: 2025-02-27T23:05:28.589Z
Learning: When reviewing PostgreSQL/pgRouting code, respect the maintainer's preference for brevity over additional comments when variable names are descriptive.

Applied to files:

  • include/c_common/e_report.h
📚 Learning: 2025-01-19T16:18:09.359Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/trsp/trsp_driver.cpp:231-232
Timestamp: 2025-01-19T16:18:09.359Z
Learning: In pgRouting, modifications to error message handling need careful consideration as they impact pgtap test cases which verify exact error message content.

Applied to files:

  • src/common/e_report.c
📚 Learning: 2025-01-19T16:17:31.895Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/contraction/contractGraph_driver.cpp:187-187
Timestamp: 2025-01-19T16:17:31.895Z
Learning: Changes to error messages in pgRouting must carefully consider impacts on pgtap tests, as these tests verify exact message content.

Applied to files:

  • src/common/e_report.c
📚 Learning: 2025-01-19T16:17:53.496Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/coloring/edgeColoring_driver.cpp:87-87
Timestamp: 2025-01-19T16:17:53.496Z
Learning: Changes to error message handling in pgRouting functions require corresponding updates to pgtap tests to maintain test coverage.

Applied to files:

  • src/common/e_report.c
📚 Learning: 2025-01-19T16:17:46.713Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/planar/boyerMyrvold_driver.cpp:100-100
Timestamp: 2025-01-19T16:17:46.713Z
Learning: Changes to error message handling in pgRouting need to consider impact on pgtap tests, as they may have assertions that depend on specific message behavior.

Applied to files:

  • src/common/e_report.c
📚 Learning: 2025-01-19T16:19:16.974Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/trsp/trspVia_withPoints_driver.cpp:154-154
Timestamp: 2025-01-19T16:19:16.974Z
Learning: Error messages in pgRouting should be kept minimal and consistent to maintain compatibility with pgtap tests.

Applied to files:

  • src/common/e_report.c
📚 Learning: 2025-01-19T16:17:42.135Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/trsp/trspVia_driver.cpp:151-151
Timestamp: 2025-01-19T16:17:42.135Z
Learning: Modifying error messages in pgRouting requires updating the corresponding pgtap tests to match the new messages, as they verify exact string outputs.

Applied to files:

  • src/common/e_report.c
📚 Learning: 2025-01-19T16:17:38.435Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/pickDeliver/pickDeliver_driver.cpp:69-69
Timestamp: 2025-01-19T16:17:38.435Z
Learning: Error messages in pgRouting are part of pgtap test assertions and should not be modified without updating the corresponding tests.

Applied to files:

  • src/common/e_report.c
📚 Learning: 2025-04-25T00:59:52.580Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2868
File: src/contraction/contractionHierarchies_driver.cpp:47-56
Timestamp: 2025-04-25T00:59:52.580Z
Learning: In pgRouting, driver functions like `pgr_contractionHierarchies` assume that callers within the project will pass valid non-null pointers, as these functions are only used internally with well-defined call patterns. Null checks on the pointers themselves (as opposed to their dereferenced values) are considered unnecessary since the caller is guaranteed to pass references to variables.

Applied to files:

  • src/common/e_report.c
🧬 Code graph analysis (1)
include/c_common/e_report.h (1)
src/common/e_report.c (2)
  • pgr_global_report (70-110)
  • pgr_print_notice (46-51)
🪛 Cppcheck (2.19.0)
src/common/e_report.c

[information] 42-42: Include file

(missingIncludeSystem)


[style] 47-47: The function 'pgr_print_notice' is never used.

(unusedFunction)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Build (56, 3.7.1)
  • GitHub Check: Build (56, 3.8.0)
  • GitHub Check: Ubuntu Boost (56)
  • GitHub Check: Ubuntu Boost (84)
  • GitHub Check: Ubuntu clang (Release, ubuntu-22.04)
  • GitHub Check: Ubuntu Boost (86)
  • GitHub Check: Ubuntu clang (Debug, ubuntu-22.04)
  • GitHub Check: macos (macos-14)
  • GitHub Check: Ubuntu Boost (77)
  • GitHub Check: Ubuntu Boost (80)
  • GitHub Check: Ubuntu clang (Debug, ubuntu-latest)
  • GitHub Check: Ubuntu clang (Release, ubuntu-latest)
  • GitHub Check: Ubuntu Boost (76)
  • GitHub Check: Ubuntu Boost (83)
  • GitHub Check: Ubuntu Boost (79)
  • GitHub Check: Ubuntu Boost (78)
  • GitHub Check: macos (macos-latest)
  • GitHub Check: Ubuntu Boost (75)
  • GitHub Check: Ubuntu Boost (68)
  • GitHub Check: Build
🔇 Additional comments (3)
include/c_common/e_report.h (2)

67-68: LGTM on removing named parameters.

The change to unnamed parameters in the pgr_global_report declaration aligns with the pgRouting convention to avoid named parameters in C header files to prevent Doxygen conflicts. Based on learnings.


70-96: Documentation is correct and follows codebase patterns.

The documentation example accurately shows to_pg_msg(msg) where msg is an ostringstream. The function has an overload accepting const std::ostringstream& directly (defined in include/cpp_common/alloc.hpp), making the example usage correct. This pattern is used consistently throughout the codebase (e.g., to_pg_msg(log), to_pg_msg(err), to_pg_msg(notice)). No changes needed.

src/common/e_report.c (1)

42-51: LGTM! Simple and correct implementation.

The implementation is clean:

  • Null check prevents crashes when called with null pointers
  • Uses errmsg_internal consistent with other ereport calls in this file (e.g., pgr_global_report)
  • The static analysis warning about "unused function" is expected since this is a new developer helper function intended for debugging use

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 and usage tips.

Copy link
Contributor

@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

🤖 Fix all issues with AI agents
In @include/c_common/e_report.h:
- Around line 70-95: Doc example declares std::ostringstream msg but uses the
wrong identifier "notice" when streaming; update the example to use the declared
variable (replace "notice << ..." with "msg << ...") and ensure the call still
passes to_pg_msg(msg) to match the pgr_print_notice(char*) usage and the
to_pg_msg helper.

In @src/common/e_report.c:
- Around line 43-49: Update the pgr_print_notice documentation to say "notice
message" instead of "error message" and add a NULL guard like pgr_throw_error
uses: in function pgr_print_notice(char* msg) check for NULL (and return early)
before calling ereport/errmsg_internal to avoid passing NULL to errmsg_internal;
keep the function name pgr_print_notice and the ereport(NOTICE,
(errmsg_internal("%s", msg))) call otherwise unchanged.
📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9d9c911 and d6f04f4.

📒 Files selected for processing (2)
  • include/c_common/e_report.h
  • src/common/e_report.c
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 0
File: :0-0
Timestamp: 2025-01-27T01:49:25.212Z
Learning: In pgRouting, when deprecating internal functions:
1. Add deprecation notice in C code using ereport with ERRCODE_FEATURE_NOT_SUPPORTED
2. Update tests with version checks (min_version, min_lib_version)
3. Document changes in NEWS.md under appropriate sections
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2744
File: NEWS.md:63-63
Timestamp: 2025-02-06T20:50:00.577Z
Learning: In pgRouting's NEWS.md, the "Removal of SQL deprecated internal functions" section lists SQL signatures being removed, while "Deprecation of internal C/C++ functions" section lists the underlying C/C++ implementations being deprecated. A function can appear in both sections when its SQL signature is removed while its C/C++ implementation is deprecated.
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2744
File: doc/src/release_notes.rst:94-94
Timestamp: 2025-02-06T20:50:07.967Z
Learning: In pgRouting, changes to functions can happen at two levels:
1. SQL level - removal/addition of function signatures
2. C/C++ level - deprecation/changes to the underlying implementation
These are documented separately in the release notes.
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2771
File: sql/common/_checkcolumn.sql:39-53
Timestamp: 2025-02-27T23:04:38.878Z
Learning: The pgRouting codebase uses PostgreSQL's HINT feature in exception handling to provide context about SQL queries, combined with ERRCODE = SQLSTATE to preserve original error codes.
📚 Learning: 2025-01-27T01:49:25.212Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 0
File: :0-0
Timestamp: 2025-01-27T01:49:25.212Z
Learning: In pgRouting, when deprecating internal functions:
1. Add deprecation notice in C code using ereport with ERRCODE_FEATURE_NOT_SUPPORTED
2. Update tests with version checks (min_version, min_lib_version)
3. Document changes in NEWS.md under appropriate sections

Applied to files:

  • src/common/e_report.c
  • include/c_common/e_report.h
📚 Learning: 2025-01-19T16:18:55.529Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/dijkstra/dijkstra_driver.cpp:147-148
Timestamp: 2025-01-19T16:18:55.529Z
Learning: In pgRouting, error messages should not be modified without careful consideration as they are verified by pgtap tests. Changes to error messages require corresponding updates to test cases.

Applied to files:

  • src/common/e_report.c
  • include/c_common/e_report.h
📚 Learning: 2025-01-19T16:18:09.359Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/trsp/trsp_driver.cpp:231-232
Timestamp: 2025-01-19T16:18:09.359Z
Learning: In pgRouting, modifications to error message handling need careful consideration as they impact pgtap test cases which verify exact error message content.

Applied to files:

  • src/common/e_report.c
📚 Learning: 2025-02-06T20:50:00.577Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2744
File: NEWS.md:63-63
Timestamp: 2025-02-06T20:50:00.577Z
Learning: In pgRouting's NEWS.md, the "Removal of SQL deprecated internal functions" section lists SQL signatures being removed, while "Deprecation of internal C/C++ functions" section lists the underlying C/C++ implementations being deprecated. A function can appear in both sections when its SQL signature is removed while its C/C++ implementation is deprecated.

Applied to files:

  • src/common/e_report.c
📚 Learning: 2025-02-06T20:50:07.967Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2744
File: doc/src/release_notes.rst:94-94
Timestamp: 2025-02-06T20:50:07.967Z
Learning: In pgRouting, changes to functions can happen at two levels:
1. SQL level - removal/addition of function signatures
2. C/C++ level - deprecation/changes to the underlying implementation
These are documented separately in the release notes.

Applied to files:

  • include/c_common/e_report.h
🧬 Code graph analysis (1)
include/c_common/e_report.h (1)
src/common/e_report.c (2)
  • pgr_global_report (68-108)
  • pgr_print_notice (46-49)
🪛 Cppcheck (2.19.0)
src/common/e_report.c

[information] 42-42: Include file

(missingIncludeSystem)


[style] 47-47: The function 'pgr_print_notice' is never used.

(unusedFunction)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Build (56, 3.3.5)
  • GitHub Check: Build (56, 3.6.1)
  • GitHub Check: Build (56, 3.1.0)
  • GitHub Check: Ubuntu clang (Debug, ubuntu-22.04)
  • GitHub Check: Ubuntu Boost (84)
  • GitHub Check: Ubuntu clang (Release, ubuntu-latest)
  • GitHub Check: Ubuntu Boost (68)
  • GitHub Check: Ubuntu Boost (76)
  • GitHub Check: Ubuntu Boost (75)
  • GitHub Check: Ubuntu clang (Release, ubuntu-22.04)
  • GitHub Check: Ubuntu Boost (56)
  • GitHub Check: Ubuntu Boost (86)
  • GitHub Check: Ubuntu Boost (78)
  • GitHub Check: Ubuntu Boost (79)
  • GitHub Check: Ubuntu clang (Debug, ubuntu-latest)
  • GitHub Check: Ubuntu Boost (80)
  • GitHub Check: Ubuntu Boost (83)
  • GitHub Check: Ubuntu Boost (77)
  • GitHub Check: macos (macos-14)
  • GitHub Check: macos (macos-latest)
🔇 Additional comments (1)
include/c_common/e_report.h (1)

67-68: LGTM!

The existing function declaration is preserved correctly.

Copy link
Contributor

@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

🤖 Fix all issues with AI agents
In @include/c_common/e_report.h:
- Around line 70-96: The doc comment incorrectly references a nonexistent
pgr_notice; update the documentation in the comment above pgr_print_notice to
either remove the pgr_notice reference or clearly state it was an old/deprecated
name (e.g., "formerly pgr_notice") so readers aren't confused, and make the
function signature consistent with similar APIs by changing
pgr_print_notice(char*) to pgr_print_notice(const char*) and update the
corresponding implementation and any callers to accept const char* (matching
pgr_throw_error usage).

In @src/common/e_report.c:
- Around line 46-49: Change pgr_print_notice to take a const char* (match
pgr_throw_error) and add a defensive null check: if msg is NULL, return or
replace with a safe placeholder, then call ereport(NOTICE,
(errmsg_internal("%s", msg))); update the function signature (pgr_print_notice)
and any callers accordingly to use const char*.
📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d6f04f4 and b048f85.

📒 Files selected for processing (2)
  • include/c_common/e_report.h
  • src/common/e_report.c
🧰 Additional context used
🧠 Learnings (12)
📓 Common learnings
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 0
File: :0-0
Timestamp: 2025-01-27T01:49:25.212Z
Learning: In pgRouting, when deprecating internal functions:
1. Add deprecation notice in C code using ereport with ERRCODE_FEATURE_NOT_SUPPORTED
2. Update tests with version checks (min_version, min_lib_version)
3. Document changes in NEWS.md under appropriate sections
📚 Learning: 2025-01-27T01:49:25.212Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 0
File: :0-0
Timestamp: 2025-01-27T01:49:25.212Z
Learning: In pgRouting, when deprecating internal functions:
1. Add deprecation notice in C code using ereport with ERRCODE_FEATURE_NOT_SUPPORTED
2. Update tests with version checks (min_version, min_lib_version)
3. Document changes in NEWS.md under appropriate sections

Applied to files:

  • include/c_common/e_report.h
  • src/common/e_report.c
📚 Learning: 2025-02-06T20:50:07.967Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2744
File: doc/src/release_notes.rst:94-94
Timestamp: 2025-02-06T20:50:07.967Z
Learning: In pgRouting, changes to functions can happen at two levels:
1. SQL level - removal/addition of function signatures
2. C/C++ level - deprecation/changes to the underlying implementation
These are documented separately in the release notes.

Applied to files:

  • include/c_common/e_report.h
📚 Learning: 2025-02-06T20:50:00.577Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2744
File: NEWS.md:63-63
Timestamp: 2025-02-06T20:50:00.577Z
Learning: In pgRouting's NEWS.md, the "Removal of SQL deprecated internal functions" section lists SQL signatures being removed, while "Deprecation of internal C/C++ functions" section lists the underlying C/C++ implementations being deprecated. A function can appear in both sections when its SQL signature is removed while its C/C++ implementation is deprecated.

Applied to files:

  • include/c_common/e_report.h
📚 Learning: 2025-01-19T16:18:55.529Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/dijkstra/dijkstra_driver.cpp:147-148
Timestamp: 2025-01-19T16:18:55.529Z
Learning: In pgRouting, error messages should not be modified without careful consideration as they are verified by pgtap tests. Changes to error messages require corresponding updates to test cases.

Applied to files:

  • include/c_common/e_report.h
  • src/common/e_report.c
📚 Learning: 2025-01-19T16:18:00.783Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/trsp/trsp_withPoints_driver.cpp:120-121
Timestamp: 2025-01-19T16:18:00.783Z
Learning: In pgRouting, modifying error messages requires updating pgtap test expectations, so such changes should be carefully considered due to the test maintenance burden.

Applied to files:

  • include/c_common/e_report.h
  • src/common/e_report.c
📚 Learning: 2025-01-19T16:17:31.895Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/contraction/contractGraph_driver.cpp:187-187
Timestamp: 2025-01-19T16:17:31.895Z
Learning: Changes to error messages in pgRouting must carefully consider impacts on pgtap tests, as these tests verify exact message content.

Applied to files:

  • include/c_common/e_report.h
  • src/common/e_report.c
📚 Learning: 2025-01-19T16:18:09.359Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/trsp/trsp_driver.cpp:231-232
Timestamp: 2025-01-19T16:18:09.359Z
Learning: In pgRouting, modifications to error message handling need careful consideration as they impact pgtap test cases which verify exact error message content.

Applied to files:

  • include/c_common/e_report.h
  • src/common/e_report.c
📚 Learning: 2025-01-19T16:17:53.496Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/coloring/edgeColoring_driver.cpp:87-87
Timestamp: 2025-01-19T16:17:53.496Z
Learning: Changes to error message handling in pgRouting functions require corresponding updates to pgtap tests to maintain test coverage.

Applied to files:

  • src/common/e_report.c
📚 Learning: 2025-01-19T16:17:46.713Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/planar/boyerMyrvold_driver.cpp:100-100
Timestamp: 2025-01-19T16:17:46.713Z
Learning: Changes to error message handling in pgRouting need to consider impact on pgtap tests, as they may have assertions that depend on specific message behavior.

Applied to files:

  • src/common/e_report.c
📚 Learning: 2025-01-19T16:19:16.974Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/trsp/trspVia_withPoints_driver.cpp:154-154
Timestamp: 2025-01-19T16:19:16.974Z
Learning: Error messages in pgRouting should be kept minimal and consistent to maintain compatibility with pgtap tests.

Applied to files:

  • src/common/e_report.c
📚 Learning: 2025-01-19T16:17:42.135Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/trsp/trspVia_driver.cpp:151-151
Timestamp: 2025-01-19T16:17:42.135Z
Learning: Modifying error messages in pgRouting requires updating the corresponding pgtap tests to match the new messages, as they verify exact string outputs.

Applied to files:

  • src/common/e_report.c
🧬 Code graph analysis (1)
include/c_common/e_report.h (1)
src/common/e_report.c (2)
  • pgr_global_report (68-108)
  • pgr_print_notice (46-49)
🪛 Cppcheck (2.19.0)
src/common/e_report.c

[information] 42-42: Include file

(missingIncludeSystem)


[style] 47-47: The function 'pgr_print_notice' is never used.

(unusedFunction)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
  • GitHub Check: Build (56, 3.7.2)
  • GitHub Check: Build (56, 4.0.0)
  • GitHub Check: Ubuntu Boost (86)
  • GitHub Check: macos (macos-14)
  • GitHub Check: macos (macos-latest)
  • GitHub Check: Ubuntu Boost (78)
  • GitHub Check: Ubuntu Boost (84)
  • GitHub Check: Ubuntu Boost (83)
  • GitHub Check: Ubuntu Boost (80)
  • GitHub Check: Ubuntu Boost (76)
  • GitHub Check: Ubuntu clang (Debug, ubuntu-22.04)
  • GitHub Check: Ubuntu clang (Debug, ubuntu-latest)
  • GitHub Check: Ubuntu Boost (56)
  • GitHub Check: Ubuntu clang (Release, ubuntu-latest)
  • GitHub Check: Ubuntu clang (Release, ubuntu-22.04)
  • GitHub Check: Ubuntu Boost (75)
  • GitHub Check: Ubuntu Boost (77)
  • GitHub Check: Ubuntu Boost (68)
  • GitHub Check: Ubuntu Boost (79)
  • GitHub Check: Build
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (1)
include/c_common/e_report.h (1)

67-68: Parameter names removed from declaration reduces readability.

While removing parameter names from function declarations is valid C, keeping them (as in the implementation) improves API readability and self-documentation. Consider retaining the names:

void pgr_global_report(char** log, char** notice, char** err);
⛔ Skipped due to learnings
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 0
File: :0-0
Timestamp: 2025-01-27T01:49:25.212Z
Learning: In pgRouting, when deprecating internal functions:
1. Add deprecation notice in C code using ereport with ERRCODE_FEATURE_NOT_SUPPORTED
2. Update tests with version checks (min_version, min_lib_version)
3. Document changes in NEWS.md under appropriate sections
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2871
File: include/drivers/transitiveClosure/transitiveClosure_driver.h:45-49
Timestamp: 2025-04-25T02:12:17.271Z
Learning: The pgRouting project avoids using named parameters in C header files to prevent conflicts with Doxygen documentation.
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2771
File: sql/common/_checkquery.sql:33-33
Timestamp: 2025-02-27T23:05:28.589Z
Learning: When reviewing PostgreSQL/pgRouting code, respect the maintainer's preference for brevity over additional comments when variable names are descriptive.
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2744
File: NEWS.md:63-63
Timestamp: 2025-02-06T20:50:00.577Z
Learning: In pgRouting's NEWS.md, the "Removal of SQL deprecated internal functions" section lists SQL signatures being removed, while "Deprecation of internal C/C++ functions" section lists the underlying C/C++ implementations being deprecated. A function can appear in both sections when its SQL signature is removed while its C/C++ implementation is deprecated.

Copy link
Contributor

@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

🤖 Fix all issues with AI agents
In @include/c_common/e_report.h:
- Around line 70-96: The comment incorrectly refers to `pgr_notice` while the
function declared is `pgr_print_notice`; update the documentation so the
referenced function name matches the declaration (use `pgr_print_notice`) or
explicitly state that `pgr_notice` is a legacy alias for `pgr_print_notice`, and
ensure examples and the explanatory text consistently reference
`pgr_print_notice` (and any alias) so readers know which symbol to remove in
development.

In @src/common/e_report.c:
- Around line 42-49: pgr_print_notice currently passes msg directly to
errmsg_internal which can crash if msg is NULL; update pgr_print_notice to
defensively check msg (the pgr_print_notice function) before calling
errmsg_internal (or ereport), e.g., return early or substitute a safe string
like "<null>" when msg is NULL; reference callers such as to_pg_msg remain
unchanged but this guard prevents crashes during debugging.
📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b048f85 and cd6a134.

📒 Files selected for processing (2)
  • include/c_common/e_report.h
  • src/common/e_report.c
🧰 Additional context used
🧠 Learnings (18)
📓 Common learnings
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 0
File: :0-0
Timestamp: 2025-01-27T01:49:25.212Z
Learning: In pgRouting, when deprecating internal functions:
1. Add deprecation notice in C code using ereport with ERRCODE_FEATURE_NOT_SUPPORTED
2. Update tests with version checks (min_version, min_lib_version)
3. Document changes in NEWS.md under appropriate sections
📚 Learning: 2025-01-27T01:49:25.212Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 0
File: :0-0
Timestamp: 2025-01-27T01:49:25.212Z
Learning: In pgRouting, when deprecating internal functions:
1. Add deprecation notice in C code using ereport with ERRCODE_FEATURE_NOT_SUPPORTED
2. Update tests with version checks (min_version, min_lib_version)
3. Document changes in NEWS.md under appropriate sections

Applied to files:

  • src/common/e_report.c
  • include/c_common/e_report.h
📚 Learning: 2025-01-19T16:18:09.359Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/trsp/trsp_driver.cpp:231-232
Timestamp: 2025-01-19T16:18:09.359Z
Learning: In pgRouting, modifications to error message handling need careful consideration as they impact pgtap test cases which verify exact error message content.

Applied to files:

  • src/common/e_report.c
📚 Learning: 2025-01-19T16:18:55.529Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/dijkstra/dijkstra_driver.cpp:147-148
Timestamp: 2025-01-19T16:18:55.529Z
Learning: In pgRouting, error messages should not be modified without careful consideration as they are verified by pgtap tests. Changes to error messages require corresponding updates to test cases.

Applied to files:

  • src/common/e_report.c
  • include/c_common/e_report.h
📚 Learning: 2025-01-19T16:18:00.783Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/trsp/trsp_withPoints_driver.cpp:120-121
Timestamp: 2025-01-19T16:18:00.783Z
Learning: In pgRouting, modifying error messages requires updating pgtap test expectations, so such changes should be carefully considered due to the test maintenance burden.

Applied to files:

  • src/common/e_report.c
  • include/c_common/e_report.h
📚 Learning: 2025-01-19T16:17:31.895Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/contraction/contractGraph_driver.cpp:187-187
Timestamp: 2025-01-19T16:17:31.895Z
Learning: Changes to error messages in pgRouting must carefully consider impacts on pgtap tests, as these tests verify exact message content.

Applied to files:

  • src/common/e_report.c
📚 Learning: 2025-01-19T16:17:53.496Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/coloring/edgeColoring_driver.cpp:87-87
Timestamp: 2025-01-19T16:17:53.496Z
Learning: Changes to error message handling in pgRouting functions require corresponding updates to pgtap tests to maintain test coverage.

Applied to files:

  • src/common/e_report.c
📚 Learning: 2025-01-19T16:17:46.713Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/planar/boyerMyrvold_driver.cpp:100-100
Timestamp: 2025-01-19T16:17:46.713Z
Learning: Changes to error message handling in pgRouting need to consider impact on pgtap tests, as they may have assertions that depend on specific message behavior.

Applied to files:

  • src/common/e_report.c
📚 Learning: 2025-01-19T16:19:16.974Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/trsp/trspVia_withPoints_driver.cpp:154-154
Timestamp: 2025-01-19T16:19:16.974Z
Learning: Error messages in pgRouting should be kept minimal and consistent to maintain compatibility with pgtap tests.

Applied to files:

  • src/common/e_report.c
📚 Learning: 2025-01-19T16:17:42.135Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/trsp/trspVia_driver.cpp:151-151
Timestamp: 2025-01-19T16:17:42.135Z
Learning: Modifying error messages in pgRouting requires updating the corresponding pgtap tests to match the new messages, as they verify exact string outputs.

Applied to files:

  • src/common/e_report.c
📚 Learning: 2025-01-19T16:17:38.435Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2725
File: src/pickDeliver/pickDeliver_driver.cpp:69-69
Timestamp: 2025-01-19T16:17:38.435Z
Learning: Error messages in pgRouting are part of pgtap test assertions and should not be modified without updating the corresponding tests.

Applied to files:

  • src/common/e_report.c
📚 Learning: 2025-02-06T20:50:07.967Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2744
File: doc/src/release_notes.rst:94-94
Timestamp: 2025-02-06T20:50:07.967Z
Learning: In pgRouting, changes to functions can happen at two levels:
1. SQL level - removal/addition of function signatures
2. C/C++ level - deprecation/changes to the underlying implementation
These are documented separately in the release notes.

Applied to files:

  • include/c_common/e_report.h
📚 Learning: 2025-02-06T20:50:00.577Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2744
File: NEWS.md:63-63
Timestamp: 2025-02-06T20:50:00.577Z
Learning: In pgRouting's NEWS.md, the "Removal of SQL deprecated internal functions" section lists SQL signatures being removed, while "Deprecation of internal C/C++ functions" section lists the underlying C/C++ implementations being deprecated. A function can appear in both sections when its SQL signature is removed while its C/C++ implementation is deprecated.

Applied to files:

  • include/c_common/e_report.h
📚 Learning: 2025-01-19T13:16:52.140Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2723
File: tools/developer/run.sh:130-144
Timestamp: 2025-01-19T13:16:52.140Z
Learning: In the pgRouting project, function documentation should be kept minimal and concise, focusing on essential information only.

Applied to files:

  • include/c_common/e_report.h
📚 Learning: 2025-02-27T23:08:14.497Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2771
File: doc/topology/pgr_degree.rst:28-35
Timestamp: 2025-02-27T23:08:14.497Z
Learning: In the pgRouting documentation, historical version notes should be retained to show the evolution of functions across different versions.

Applied to files:

  • include/c_common/e_report.h
📚 Learning: 2025-01-19T13:17:09.832Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2723
File: tools/developer/run.sh:146-152
Timestamp: 2025-01-19T13:17:09.832Z
Learning: In the pgRouting project, prefer minimal documentation for shell functions unless explicitly requested otherwise. The code should be self-documenting where possible.

Applied to files:

  • include/c_common/e_report.h
📚 Learning: 2025-04-25T02:12:17.271Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2871
File: include/drivers/transitiveClosure/transitiveClosure_driver.h:45-49
Timestamp: 2025-04-25T02:12:17.271Z
Learning: The pgRouting project avoids using named parameters in C header files to prevent conflicts with Doxygen documentation.

Applied to files:

  • include/c_common/e_report.h
📚 Learning: 2025-04-25T15:12:03.608Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2874
File: doc/utilities/pgr_separateCrossing.rst:26-27
Timestamp: 2025-04-25T15:12:03.608Z
Learning: In pgRouting documentation, official functions don't include version information in their index entries (`:single:` directives). Only deprecated functions include when they were deprecated in the index entries.

Applied to files:

  • include/c_common/e_report.h
🧬 Code graph analysis (1)
include/c_common/e_report.h (1)
src/common/e_report.c (2)
  • pgr_global_report (68-108)
  • pgr_print_notice (46-49)
🪛 Cppcheck (2.19.0)
src/common/e_report.c

[information] 42-42: Include file

(missingIncludeSystem)


[style] 47-47: The function 'pgr_print_notice' is never used.

(unusedFunction)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Ubuntu Boost (83)
  • GitHub Check: Ubuntu Boost (75)
  • GitHub Check: Build (56, 3.2.1)
  • GitHub Check: Build (56, 3.1.0)
  • GitHub Check: Build (56, 3.3.1)
  • GitHub Check: Build (56, 3.3.4)
  • GitHub Check: Build (56, 3.6.0)
  • GitHub Check: Build (56, 3.0.0)
  • GitHub Check: Build (56, 3.7.0)
  • GitHub Check: Build (56, 3.4.2)
  • GitHub Check: Build (56, 3.6.2)
  • GitHub Check: Build (56, 4.0.0)
  • GitHub Check: Build (56, 3.7.3)
  • GitHub Check: macos (macos-latest)
  • GitHub Check: macos (macos-14)
  • GitHub Check: Ubuntu clang (Release, ubuntu-22.04)
  • GitHub Check: Ubuntu clang (Debug, ubuntu-latest)
  • GitHub Check: Ubuntu clang (Release, ubuntu-latest)
  • GitHub Check: Ubuntu clang (Debug, ubuntu-22.04)
  • GitHub Check: Build
🔇 Additional comments (1)
include/c_common/e_report.h (1)

67-68: LGTM!

Removing parameter names from the pgr_global_report declaration aligns with the project convention of avoiding named parameters in C header files to prevent conflicts with Doxygen documentation. Based on learnings.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants