Skip to content

Conversation

cvvergara
Copy link
Member

@cvvergara cvvergara commented Apr 5, 2025

Fixes #2754

Changes proposed in this pull request:

  • Removed use on documentation
  • Removed use on pgtap
  • Removed references to documentation file
  • Added migration instructions

@pgRouting/admins

Summary by CodeRabbit

  • Documentation
    • Updated release notes, migration guides, and API documentation to indicate that the pgr_analyzeOneWay function is deprecated as of v3.8.0. Guidance on adjusting to these changes is now included.
  • New Features
    • Introduced new SQL queries that enhance the analysis of one-way edge conditions based on cost criteria.
  • Tests
    • Revised test cases to remove obsolete one-way analysis checks and update expected outcomes.

- Removed use on documentation
- Removed use on pgtap
- Removed references to documentation file
- Added migration instructions
@cvvergara cvvergara added this to the Release 3.8.0 milestone Apr 5, 2025
@cvvergara cvvergara requested a review from robe2 April 5, 2025 15:31
@cvvergara cvvergara self-assigned this Apr 5, 2025
Copy link
Contributor

coderabbitai bot commented Apr 5, 2025

Walkthrough

The changes update documentation and SQL scripts to deprecate the function pgr_analyzeOneWay as of version 3.8.0. Several documentation files (NEWS, release notes, migration guides, and topology docs) now include deprecation notices and migration instructions. References to the deprecated function have been removed from related documents. Additionally, new SQL queries have been introduced to analyze one-way edge conditions, and the associated test scripts and SQL functions have been updated with deprecation warnings.

Changes

File(s) Change Summary
NEWS.md, doc/src/release_notes.rst, doc/src/migration.rst, doc/topology/pgr_analyzeGraph.rst, doc/topology/pgr_analyzeOneWay.rst Added deprecation notices for pgr_analyzeOneWay (and also for pgr_analyzeGraph in index entries), plus migration guidelines and SQL examples referencing the change in version 3.8.0.
doc/topology/pgr_createTopology.rst, doc/topology/pgr_createVerticesTable.rst, doc/topology/pgr_nodeNetwork.rst Removed references and links to pgr_analyzeOneWay, simplifying related descriptions.
docqueries/src/migration.pg, docqueries/src/migration.result Introduced four new SQL queries (OneWay1–OneWay4) to identify one-way edges based on cost conditions, including one rollback query.
docqueries/topology/analyzeOneWay.result, sql/topology/analyzeOneway.sql Inserted deprecation warnings in SQL scripts; updated function comments in pgr_analyzeOneWay to indicate deprecation.
pgtap/topology/nodeNetwork/edge_cases.pg Adjusted the test plan (reducing from 30 to 28 tests) and removed tests for pgr_analyzeoneway edge case validations.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SQL_Engine
    participant pgr_analyzeOneway_Function

    User->>SQL_Engine: Execute one-way edge analysis query
    SQL_Engine->>pgr_analyzeOneway_Function: Call pgr_analyzeOneway()
    pgr_analyzeOneway_Function->>SQL_Engine: Raise deprecation warning ("deprecated function on v3.8.0")
    pgr_analyzeOneway_Function->>SQL_Engine: Process query and return results
    SQL_Engine->>User: Send analysis result
Loading

Poem

Hopping through lines of code today,
I bid farewell to functions old and gray.
With deprecation warnings in each file I roam,
New SQL queries guide me home.
A bunny’s heart leaps with every change,
Carrots and code—so wide in range!
🐇✨ Hop on, let the new era arrange!


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ae5e6fb and 6666942.

📒 Files selected for processing (2)
  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po (8 hunks)
  • locale/pot/pgrouting_doc_strings.pot (8 hunks)

Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

🪧 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

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: 3

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c7a225e and 9e0678c.

📒 Files selected for processing (15)
  • NEWS.md (1 hunks)
  • doc/src/migration.rst (1 hunks)
  • doc/src/release_notes.rst (1 hunks)
  • doc/topology/pgr_analyzeGraph.rst (2 hunks)
  • doc/topology/pgr_analyzeOneWay.rst (2 hunks)
  • doc/topology/pgr_createTopology.rst (1 hunks)
  • doc/topology/pgr_createVerticesTable.rst (1 hunks)
  • doc/topology/pgr_nodeNetwork.rst (0 hunks)
  • docqueries/src/migration.pg (1 hunks)
  • docqueries/src/migration.result (1 hunks)
  • docqueries/topology/analyzeOneWay.result (1 hunks)
  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po (8 hunks)
  • locale/pot/pgrouting_doc_strings.pot (8 hunks)
  • pgtap/topology/nodeNetwork/edge_cases.pg (1 hunks)
  • sql/topology/analyzeOneway.sql (3 hunks)
💤 Files with no reviewable changes (1)
  • doc/topology/pgr_nodeNetwork.rst
👮 Files not reviewed due to content moderation or server errors (1)
  • locale/pot/pgrouting_doc_strings.pot
⏰ Context from checks skipped due to timeout of 90000ms (16)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Ubuntu Boost (84)
  • GitHub Check: Ubuntu Boost (86)
  • GitHub Check: Ubuntu Boost (68)
  • GitHub Check: Ubuntu Boost (83)
  • GitHub Check: Ubuntu Boost (79)
  • GitHub Check: Ubuntu Boost (78)
  • GitHub Check: Ubuntu Boost (56)
  • GitHub Check: Ubuntu Boost (76)
  • GitHub Check: Ubuntu Boost (75)
  • GitHub Check: Ubuntu Boost (77)
  • GitHub Check: Ubuntu Boost (80)
  • GitHub Check: Ubuntu clang
  • GitHub Check: Check queries
  • GitHub Check: macos (macos-latest)
  • GitHub Check: macos (macos-14)
🔇 Additional comments (29)
pgtap/topology/nodeNetwork/edge_cases.pg (1)

27-27: Test plan count updated to reflect removed test cases

The plan count has been reduced from 30 to 28, corresponding to the removal of test cases related to the deprecated pgr_analyzeOneWay function. This is consistent with the PR objective to deprecate this function.

doc/src/release_notes.rst (1)

71-72: Properly documented deprecation of pgr_analyzeOneWay

The deprecation of pgr_analyzeOneWay is correctly documented in the release notes with the appropriate issue reference. This change aligns with the PR objectives and follows the established format for function deprecation.

NEWS.md (1)

39-40: Documented deprecation in NEWS file

The deprecation of pgr_analyzeOneWay is correctly added to the NEWS file with the appropriate issue reference, consistent with the release notes and following the same format as other deprecation entries.

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

11-11: No functional issues detected in POT-Creation-Date update.
All looks good here.


3962-3965: Reference to deprecation issue #2754 is consistent and clear.
These lines correctly map the deprecation note to the relevant GitHub issue.


8063-8071: No concerns with these translated strings.
References to incoming/outgoing vertices are consistent.


8177-8177: Deprecation notice for “pgr_analyzeOneWay” is clear.
No issues with the updated message.


10028-10033: Use of “AS incoming” and “AS outgoing” is consistent.
No problems found here.


13472-13472: Reference to “pgr_createTopology” is consistent with doc changes.
No issues found.

doc/topology/pgr_createTopology.rst (2)

114-114: Documentation updated to remove deprecated function reference

The reference to pgr_analyzeOneWay has been removed from the description of the ein field in the vertices table description, which aligns with the deprecation of this function (as stated in the PR objectives).


116-116: Documentation updated to remove deprecated function reference

The reference to pgr_analyzeOneWay has been removed from the description of the eout field in the vertices table description, which aligns with the deprecation of this function.

doc/topology/pgr_createVerticesTable.rst (2)

101-101: Documentation updated to remove deprecated function reference

The reference to pgr_analyzeOneWay has been removed from the description of the ein field in the vertices table description, which aligns with the deprecation of this function (as stated in the PR objectives).


103-103: Documentation updated to remove deprecated function reference

The reference to pgr_analyzeOneWay has been removed from the description of the eout field in the vertices table description, which aligns with the deprecation of this function.

docqueries/topology/analyzeOneWay.result (1)

35-35: Deprecation warning correctly implemented

A warning message has been added to notify users that pgr_analyzeOneWay is deprecated as of version 3.8.0. This effectively communicates to users that they should transition away from using this function in their code.

doc/src/migration.rst (1)

27-68: Well-structured migration guide for pgr_analyzeOneWay.

The new migration section provides a clear alternative to the deprecated function by explaining how to:

  1. Identify dead ends using pgr_extractVertices
  2. Detect bridges that are one-way
  3. Use SQL queries with practical examples

The section is properly delimited with start/end markers and follows the documentation style consistently.

sql/topology/analyzeOneway.sql (2)

147-147: Appropriate deprecation warning added.

The warning correctly informs users that the function is deprecated since version 3.8.0, which aligns with the PR objectives.


279-279: Function comment updated to reflect deprecation status.

The simplified comment clearly indicates that the function is deprecated, which is consistent with the warning message.

doc/topology/pgr_analyzeOneWay.rst (4)

11-12: Index entries correctly updated to indicate deprecation.

The index entries now include "Deprecated since 3.8.0", making it clear in search results that this function should not be used in new code.


16-16: Title updated to show deprecation status.

The function title clearly indicates it's deprecated since version 3.8.0.


26-29: Version information updated with deprecation notice.

The availability section now explicitly states the function is deprecated in version 3.8.0 while preserving the original introduction version.


34-36: Migration guide reference added.

Good inclusion of a link to the migration guidelines, making it easy for users to find alternative approaches.

doc/topology/pgr_analyzeGraph.rst (2)

11-12: Index entries updated to show deprecation status.

The index entries now include "Deprecated since 3.8.0" for consistency with other deprecated functions.


109-111: Removed references to pgr_analyzeOneWay.

The description of the 'ein' and 'eout' columns has been simplified by removing links to the deprecated pgr_analyzeOneWay function, maintaining documentation coherence.

docqueries/src/migration.result (3)

1309-1318: Added query to identify one-way dead ends.

This query effectively identifies dead ends in the graph and checks if adjacent edges are one-way, providing a direct replacement for one aspect of the deprecated pgr_analyzeOneWay function.


1320-1332: Added query to check one-way status of bridges.

Good implementation that identifies bridges in the graph and determines if they are one-way, which is a critical use case for the deprecated function.


1334-1342: Added query to find one-way bridges with their cost values.

This query extends the previous query by returning detailed cost information for one-way bridges, providing valuable diagnostic information.

docqueries/src/migration.pg (3)

405-411: Good addition of alternative technique for identifying one-way edges at deadends

This query effectively identifies one-way edges connected to deadend vertices (vertices with only one edge). It uses a Common Table Expression (CTE) to find these deadend vertices and then joins with the edges table to filter those with negative costs, which indicate one-way restrictions. This provides users with a clear migration path from the deprecated pgr_analyzeOneWay function.


412-415: Effective approach for identifying one-way bridge edges

This query combines the pgr_bridges function with a simple boolean expression to identify one-way bridge edges in the graph. This is a useful migration alternative that focuses specifically on critical edges whose one-way status might significantly impact routing.


416-420: Helpful detailed query for one-way bridge analysis

This query extends the previous approach by returning the actual cost values for one-way bridge edges, providing more detailed information for analysis. This is valuable for users who need to understand the specific cost structures of critical one-way connections in their network.

@cvvergara cvvergara force-pushed the deprecate-pgr_analyzeOneWay branch from 9e0678c to ae5e6fb Compare April 5, 2025 20:42
@cvvergara cvvergara merged commit 33d4cc6 into pgRouting:main Apr 5, 2025
1 check passed
@cvvergara cvvergara deleted the deprecate-pgr_analyzeOneWay branch April 5, 2025 21:38
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.

Deprecate pgr_analyzeOneWay in 3.8
2 participants