Skip to content

Conversation

@cvvergara
Copy link
Member

Fixes #2906

Changes proposed in this pull request:

  • SQL changes
  • Migration section
    • This section will be used for other similar migrations in the future
  • Update build scripts
  • Update NEWS and release notes

@pgRouting/admins

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 31, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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
Copy link
Member Author

@coderabbitai summary
@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 31, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@cvvergara I'll gather the PR information and perform both a summary and review for you. Let me start by examining the PR details and changes.


🏁 Script executed:

#!/bin/bash
# Get PR information
gh pr view 2912 --json title,body,files,commits,additions,deletions,state,baseRefName,headRefName

# Get the diff for this PR
gh pr diff 2912

# Get list of files changed
gh pr view 2912 --json files | jq -r '.files[].path'

Length of output: 42918


@cvvergara Here's the summary and review for PR #2912:

Summary

PR #2912: Standardize pgr_bdDijkstra output columns

This PR implements a breaking change to standardize the output columns of the pgr_bdDijkstra function as part of pgRouting v4.0.0. The function output is being standardized from the old format (seq, path_seq, node, edge, cost, agg_cost) to the new standardized format (seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost).

Key Changes:

  • SQL Function Updates: Modified three function signatures (One-to-One, One-to-Many, Many-to-One) to include start_vid and end_vid columns
  • Migration Documentation: Added comprehensive migration guide with examples showing how to filter columns to maintain backward compatibility
  • Test Updates: Updated all test result files and pgTAP tests
  • Documentation: Updated function documentation, release notes, and NEWS file
  • Build Scripts: Enhanced extension update scripts to properly handle function signature changes

Detailed Review

Strengths

  1. Comprehensive Migration Support

    • Excellent migration documentation in doc/src/migration.rst with practical examples
    • Shows users exactly how to filter out new columns to maintain old behavior
    • Provides before/after comparisons for each function signature
  2. Thorough Implementation

    • All three function variants properly updated
    • Consistent with pgRouting's standardization efforts
    • Proper handling in build scripts for function recreation during upgrades
  3. Complete Test Coverage

    • All test result files updated to match new output format
    • pgTAP tests updated with version checks
    • Documentation query examples updated
  4. Clear Documentation

    • Release notes properly updated with issue references
    • Function documentation reflects new output format
    • Migration section will help users with other similar migrations

🔍 Technical Implementation Review

SQL Changes (sql/bdDijkstra/bdDijkstra.sql):

-- Old signature (One-to-One)
OUT seq INTEGER, OUT path_seq INTEGER, OUT node BIGINT, OUT edge BIGINT, OUT cost FLOAT, OUT agg_cost FLOAT

-- New signature (One-to-One)  
OUT seq INTEGER, OUT path_seq INTEGER, OUT start_vid BIGINT, OUT end_vid BIGINT, OUT node BIGINT, OUT edge BIGINT, OUT cost FLOAT, OUT agg_cost FLOAT

The implementation correctly:

  • Adds both start_vid and end_vid to One-to-One signature (was missing both)
  • Adds start_vid to One-to-Many signature (was missing start_vid)
  • Adds end_vid to Many-to-One signature (was missing end_vid)

Build Script Updates:
The addition of function drops in build-extension-update-files.pl is essential since PostgreSQL cannot automatically handle OUT parameter changes:

push @commands, drop_special_case_function("pgr_bddijkstra(text,bigint,bigint,boolean)");
push @commands, drop_special_case_function("pgr_bddijkstra(text,anyarray,bigint,boolean)");
push @commands, drop_special_case_function("pgr_bddijkstra(text,bigint,anyarray,boolean)");

🎯 Migration Strategy

The migration guide provides clear examples for users to maintain compatibility:

-- New format
SELECT * FROM pgr_bdDijkstra(...);

-- To get old format, filter columns:
SELECT seq, path_seq, node, edge, cost, agg_cost 
FROM pgr_bdDijkstra(...);

Overall Assessment

This is a well-executed breaking change that:

  • Aligns with pgRouting's v4.0.0 standardization goals
  • Provides excellent migration support for users
  • Maintains consistency with other pgRouting functions
  • Includes comprehensive testing and documentation

Recommendation: ✅ APPROVE

The PR successfully standardizes the pgr_bdDijkstra output columns while providing users with clear migration paths. The implementation is thorough and follows pgRouting's established patterns for function standardization.

   (\   /)
  ( ._. )
 o_(")(")  Looking good! This standardization will make pgRouting more consistent.

@cvvergara cvvergara marked this pull request as draft May 31, 2025 15:47
@cvvergara cvvergara marked this pull request as ready for review May 31, 2025 21:22
Copy link
Contributor

@Saloni-2005 Saloni-2005 left a comment

Choose a reason for hiding this comment

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

I’ve reviewed the function signatures, test coverage, migration guide, and release documentation. The additions of start_vid and end_vid follow pgRouting standardization efforts. Migration paths are clear and the update is well-documented. This is a solid step for v4.0.0.

@cvvergara cvvergara merged commit 7d62acb into pgRouting:develop Jun 2, 2025
26 checks passed
@cvvergara cvvergara deleted the work-standardize-bdDijkstra-output-columns branch June 2, 2025 16:25
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.

4 participants