Skip to content

Deprecate pgr node network on3.8 #2876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 26, 2025

Conversation

cvvergara
Copy link
Member

@cvvergara cvvergara commented Apr 25, 2025

Fixes #2847 .

Changes proposed in this pull request:

  • Modifies files about deprecation of pg_nodeNetowrk
  • Will issue a warning to the user of the function
  • Created migration instructions

@pgRouting/admins

Summary by CodeRabbit

  • Documentation

    • Updated documentation to mark the pgr_nodeNetwork function as deprecated since version 3.8.0, including deprecation notices, migration guidance, and removal of references in related docs and translation files.
    • Added migration instructions recommending the use of pgr_separateTouching and/or pgr_separateCrossing as alternatives.
    • Updated release notes to include the deprecation.
  • Bug Fixes

    • Added deprecation warnings to query results and function execution for pgr_nodeNetwork.
  • Chores

    • Updated translation templates and documentation strings to reflect the deprecation status.

Copy link
Contributor

coderabbitai bot commented Apr 25, 2025

Walkthrough

The changes in this pull request focus on the deprecation of the pgr_nodeNetwork function as of pgRouting version 3.8.0. Documentation files have been updated to mark the function as deprecated, provide migration guidance, and remove references from related documentation sections. A deprecation warning is now raised in the SQL implementation, and corresponding warning messages are added to documentation query results. Translation template and localized documentation strings are updated to reflect the deprecation and migration strategy, advising users to use pgr_separateTouching and pgr_separateCrossing instead.

Changes

Files/Paths Change Summary
doc/topology/pgr_nodeNetwork.rst, doc/src/migration.rst, doc/src/release_notes.rst Marked pgr_nodeNetwork as deprecated in documentation, added migration guidance, and updated release notes.
doc/_static/page_history.js Updated filesArr entry for pgr_nodeNetwork to include version 3.8.
doc/topology/pgr_analyzeGraph.rst Removed pgr_nodeNetwork from "See Also" section.
docqueries/topology/nodeNetwork.result Added deprecation warning messages to query results involving pgr_nodeNetwork.
docqueries/utilities/separateCrossing.pg, docqueries/utilities/separateTouching.pg Removed commented-out or decorative references to pgr_nodeNetwork.
locale/en/LC_MESSAGES/pgrouting_doc_strings.po, locale/pot/pgrouting_doc_strings.pot Updated translation and documentation strings to reflect deprecation and migration advice for pgr_nodeNetwork.
sql/topology/nodeNetwork.sql Added deprecation warning in function, updated/remapped COMMENT blocks.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant pgr_nodeNetwork
    participant MigrationDocs

    User->>pgr_nodeNetwork: Call function (v3.8.0+)
    pgr_nodeNetwork-->>User: Raise deprecation warning
    User->>MigrationDocs: Consult migration guide
    MigrationDocs-->>User: Suggest pgr_separateTouching / pgr_separateCrossing
Loading

Assessment against linked issues

Objective Addressed Explanation
Mark pgr_nodeNetwork as deprecated in v3.8.0, provide migration guidance to pgr_separateTouching and/or pgr_separateCrossing (#2847)
Remove or update documentation and warning messages to reflect deprecation (#2847)
No changes to internal logic, only deprecation and migration steps (#2847)
Add deprecation warning in SQL function and documentation (#2847)

Possibly related PRs

Suggested reviewers

  • robe2
  • sanak

Poem

A hop, a skip, a doc update,
The nodeNetwork’s now out of date.
Warnings raised, migration shown,
To new utilities you’ll be flown.
Crossing and Touching, the future’s bright,
Deprecation handled—code done right!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@cvvergara cvvergara requested a review from robe2 April 25, 2025 15:52
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: 5

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 638ada4 and a1c832b.

📒 Files selected for processing (11)
  • doc/_static/page_history.js (1 hunks)
  • doc/src/migration.rst (1 hunks)
  • doc/src/release_notes.rst (1 hunks)
  • doc/topology/pgr_analyzeGraph.rst (0 hunks)
  • doc/topology/pgr_nodeNetwork.rst (3 hunks)
  • docqueries/topology/nodeNetwork.result (2 hunks)
  • docqueries/utilities/separateCrossing.pg (0 hunks)
  • docqueries/utilities/separateTouching.pg (0 hunks)
  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po (4 hunks)
  • locale/pot/pgrouting_doc_strings.pot (4 hunks)
  • sql/topology/nodeNetwork.sql (2 hunks)
💤 Files with no reviewable changes (3)
  • doc/topology/pgr_analyzeGraph.rst
  • docqueries/utilities/separateCrossing.pg
  • docqueries/utilities/separateTouching.pg
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: cvvergara
PR: pgRouting/pgrouting#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
PR: pgRouting/pgrouting#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
doc/src/release_notes.rst (3)
Learnt from: cvvergara
PR: pgRouting/pgrouting#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
PR: pgRouting/pgrouting#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
PR: pgRouting/pgrouting#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
docqueries/topology/nodeNetwork.result (2)
Learnt from: cvvergara
PR: pgRouting/pgrouting#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
PR: pgRouting/pgrouting#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
🪛 Biome (1.9.4)
doc/_static/page_history.js

[error] 212-212: expected : but instead found }

Remove }

(parse)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Check queries
  • GitHub Check: License_check
🔇 Additional comments (12)
doc/src/release_notes.rst (1)

138-139: Properly documents the deprecation of pgr_nodeNetwork

The addition to the "Deprecation of SQL functions" section correctly references issue #2847 and clearly identifies pgr_nodeNetwork as deprecated in version 3.8. This follows the project's established pattern for documenting deprecations.

docqueries/topology/nodeNetwork.result (2)

43-43: Appropriately adds deprecation warning

The added warning message clearly indicates that the pgr_nodeNetwork function is deprecated as of version 3.8.0, which aligns with the PR objectives and helps users understand that they should consider migrating to alternative functions.


145-145: Consistent deprecation warning added

The same deprecation warning is correctly added here, maintaining consistency in how deprecation messages are displayed to users throughout the codebase.

doc/src/migration.rst (1)

57-71: Well-structured migration guidance provided

The added migration section follows the established pattern of other deprecated functions in the document. It clearly:

  1. States when the deprecation begins (v3.8.0)
  2. Explains the previous behavior of the function
  3. Provides specific guidance on which functions to use as alternatives (pgr_separateTouching and pgr_separateCrossing)

This information will be valuable for users who need to migrate away from the deprecated function.

doc/topology/pgr_nodeNetwork.rst (2)

41-41: Confirm deprecation note under Availability.

The added bullet * Deprecated function. clearly flags the deprecation. Ensure this aligns with other function docs and downstream tooling picks it up correctly.


50-53: Verify include path for migration snippet.

Ensure the path migration.rst is resolvable by Sphinx. If migration.rst resides in doc/src, you may need a relative path:

- .. include:: migration.rst
+ .. include:: ../src/migration.rst

Otherwise, confirm the include search paths in conf.py.

locale/en/LC_MESSAGES/pgrouting_doc_strings.po (4)

11-11: Standard timestamp update for translation template.

The POT-Creation-Date has been updated to reflect when the translation template was last generated. This is routine maintenance when updating localization files.


4100-4103: Appropriate documentation of deprecation reference.

This addition properly documents the deprecation of pgr_nodeNetwork in version 3.8, including a reference to the relevant GitHub issue (#2847). This follows best practices for documenting deprecations in pgRouting.


4189-4201: Clear migration guidance added.

The added migration section effectively:

  1. Describes the original behavior
  2. Provides clear migration instructions
  3. References the replacement functions (pgr_separateTouching and pgr_separateCrossing)

This guidance helps users transition away from the deprecated function, which is essential when deprecating functionality.


13741-13741: Properly marked as deprecated in function description.

The function description now clearly indicates that pgr_nodeNetwork is deprecated since version 3.8.0, ensuring that users are aware of its status when they consult the documentation.

locale/pot/pgrouting_doc_strings.pot (2)

3649-3650: Addition of deprecation notice for pgr_nodeNetwork looks good.

This properly documents the issue (#2847) that tracks the deprecation of pgr_nodeNetwork in version 3.8.0, which is important for translation purposes and documentation consistency.


3724-3735: Migration guidance is clear and helpful.

The migration section properly explains what the function did before deprecation and directs users to the new recommended functions (pgr_separateTouching and pgr_separateCrossing). This aligns with best practices for deprecating functions by providing a clear migration path.

@@ -209,7 +209,7 @@ var filesArr = [
]),
new createInfo('pgr_nodeNetwork', '2.0', [
{ v: '2.1', n: 'src/common/doc/functions/node_network'},
{ v: '2.3', n: 'src/topology/doc/pgr_nodeNetwork'},
{ v: '2.3', n: 'src/topology/doc/pgr_nodeNetwork', 3.8},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Added version 3.8 to history tracking

The additional 3.8 parameter correctly marks the version when pgr_nodeNetwork was deprecated in the page history tracking system. This will help the documentation system properly represent the status of this function.

However, there appears to be a syntax error in the code. The trailing comma at the end of the line suggests there might be a problem with the structure.

Apply this fix:

-        { v: '2.3', n: 'src/topology/doc/pgr_nodeNetwork', 3.8},
+        { v: '2.3', n: 'src/topology/doc/pgr_nodeNetwork', 3.8 },

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 Biome (1.9.4)

[error] 212-212: expected : but instead found }

Remove }

(parse)

Comment on lines +11 to +12
single: Topology Family ; pgr_nodeNetwork - Deprecated since 3.8.0
single: nodeNetwork - Deprecated since 3.8.0
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Consider unifying index entries for decluttering.

Currently there are two separate .. index:: directives for pgr_nodeNetwork and nodeNetwork. You may combine them under a single directive for readability:

.. index::
   single: Topology Family ; pgr_nodeNetwork - Deprecated since 3.8.0
   single: nodeNetwork - Deprecated since 3.8.0


|

``pgr_nodeNetwork``
``pgr_nodeNetwork`` - Deprecated since 3.8.0
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Use Sphinx’s deprecated directive for consistency.

Instead of inline header text, consider adding a .. deprecated:: 3.8.0 directive to leverage Sphinx’s built‐in styling and indexing:

.. deprecated:: 3.8.0
   Use :func:`pgr_separateTouching` and :func:`pgr_separateCrossing` instead.

Comment on lines +232 to +233
COMMENT ON FUNCTION pgr_createverticestable(TEXT, TEXT, TEXT, TEXT, TEXT)
IS 'pgr_nodeNetwork deprecated function on v3.8.0';
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Correct the COMMENT target and include migration hint
The new COMMENT ON FUNCTION is applied to pgr_createverticestable, but the deprecation notice should target pgr_nodeNetwork. Additionally, the comment should advise users of the replacement API. For example:

COMMENT ON FUNCTION pgr_nodeNetwork(
  TEXT, DOUBLE PRECISION, TEXT, TEXT, TEXT, TEXT, BOOLEAN
)
IS 'Deprecated as of v3.8.0; use pgr_separateTouching and/or pgr_separateCrossing instead.';

Please update the function name and descriptive text accordingly.

@@ -63,6 +63,7 @@ DECLARE
out_table_exists BOOLEAN;

BEGIN
RAISE WARNING 'pgr_nodenetwork(text,double precision,text,text,text,text,boolean) deprecated function on v3.8.0';
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add guidance to the runtime deprecation warning
The RAISE WARNING at line 66 only flags that pgr_nodeNetwork is deprecated. To improve user experience, enhance the message to:

  • Mention the replacement functions (pgr_separateTouching and pgr_separateCrossing)
  • Use a specific SQLSTATE (e.g., 0A000 / FEATURE_NOT_SUPPORTED) so downstream clients can detect deprecation programmatically

Example diff:

-  RAISE WARNING 'pgr_nodenetwork(text,double precision,text,text,text,text,boolean) deprecated function on v3.8.0';
+  RAISE WARNING 
+    'Function pgr_nodeNetwork is deprecated as of version 3.8.0; use pgr_separateTouching and/or pgr_separateCrossing instead.'
+    USING ERRCODE = '0A000';

@cvvergara cvvergara merged commit 335c9a9 into pgRouting:main Apr 26, 2025
12 checks passed
@cvvergara cvvergara deleted the deprecate-pgr_nodeNetwork-on3.8 branch April 26, 2025 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pgr_nodeNetwork deprecation on v3.8.0
2 participants