Skip to content
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

reverting some changes from c1b21c2fc8 #2736

Merged

Conversation

cvvergara
Copy link
Member

@cvvergara cvvergara commented Jan 27, 2025

After a second thought:
Reverting some changes from #c1b21c2fc8
Basically because a lot of changes on pgtap tests would be needed.

@pgRouting/admins

Summary by CodeRabbit

Release Notes for pgRouting 4.0.0

  • New Features

    • Promoted several routing functions to official status, including pgr_trsp, pgr_withPoints, and pgr_aStar
    • Added official support for combination-based routing signatures
  • Improvements

    • Simplified and streamlined internal function implementations
    • Enhanced function signatures for better clarity and usability
  • Deprecations

    • Removed several deprecated SQL functions and internal functions
    • Deprecated some internal C/C++ functions
  • Breaking Changes

    • Significant updates to function signatures across multiple routing algorithms
    • Removed legacy function implementations

@cvvergara cvvergara added this to the Release 4.0.0 milestone Jan 27, 2025
Copy link

coderabbitai bot commented Jan 27, 2025

Walkthrough

This pull request introduces significant updates to pgRouting 4.0.0, focusing on function and signature management. The changes involve promoting several functions to official status, removing deprecated SQL functions, and streamlining internal C/C++ implementations. Key modifications include updating the _pgr_dijkstra function, removing _pgr_dijkstrav4, and adjusting function signatures across multiple SQL and C files to enhance code consistency and maintainability.

Changes

File Change Summary
NEWS.md Updated release notes for pgRouting 4.0.0, detailing function promotions and removals
doc/src/release_notes.rst Documented function signature changes and deprecations
sql/dijkstra/* Replaced _pgr_dijkstrav4 calls with _pgr_dijkstra across multiple function implementations
src/dijkstra/dijkstra.c Removed _pgr_dijkstrav4 function implementation
sql/sigs/pgrouting--4.0.sig Updated function signatures, added new functions, removed deprecated ones

Suggested labels

Code Cleanup, Legacy, C/C++

Suggested reviewers

  • robe2

Possibly related PRs

Poem

🐰 Routing rabbits hop with glee,
Old functions fade, new paths run free
Dijkstra's algorithm takes flight
Cleaner code, a programmer's delight!
pgRouting 4.0 hops into view 🚀


🪧 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. (Beta)
  • @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 review
@coderabbitai summary

Copy link

coderabbitai bot commented Jan 27, 2025

@cvvergara I'll help review the changes. First, here's a summary of the PR:

This PR reverts some changes from commit c1b21c2 that were aimed at simplifying the Dijkstra algorithm implementation. The main changes include:

  • Reverting the function rename from _pgr_dijkstrav4 back to _pgr_dijkstra
  • Removing new function signatures from documentation
  • Modifying SQL files to use the original function names
  • Removing code changes in dijkstra.c

The reversion is being done to avoid extensive changes that would be needed in the pgtap test suite.

Let me review the changes in detail.

🔗 Analysis chain
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Get the PR details
gh pr view 2736 --json files,commits,body

# Get the commit details
git show c1b21c2fc8 --name-status

# Get the diff of the current PR
git diff HEAD^1 HEAD

# Look for pgtap test files that might be affected
fd -e sql . | grep -i "pgtap"

Length of output: 19588

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@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 41e90fe and da78a43.

📒 Files selected for processing (10)
  • NEWS.md (0 hunks)
  • doc/src/release_notes.rst (0 hunks)
  • sql/dijkstra/_dijkstra.sql (2 hunks)
  • sql/dijkstra/dijkstra.sql (5 hunks)
  • sql/dijkstra/dijkstraCost.sql (5 hunks)
  • sql/dijkstra/dijkstraCostMatrix.sql (1 hunks)
  • sql/dijkstra/dijkstraNear.sql (4 hunks)
  • sql/dijkstra/dijkstraNearCost.sql (4 hunks)
  • sql/sigs/pgrouting--4.0.sig (1 hunks)
  • src/dijkstra/dijkstra.c (0 hunks)
💤 Files with no reviewable changes (3)
  • src/dijkstra/dijkstra.c
  • NEWS.md
  • doc/src/release_notes.rst
⏰ Context from checks skipped due to timeout of 90000ms (17)
  • GitHub Check: Ubuntu Boost (86)
  • GitHub Check: Ubuntu Boost (84)
  • GitHub Check: Ubuntu Boost (83)
  • GitHub Check: Ubuntu Boost (80)
  • GitHub Check: Ubuntu Boost (79)
  • GitHub Check: Ubuntu Boost (78)
  • GitHub Check: Ubuntu Boost (77)
  • GitHub Check: Ubuntu Boost (76)
  • GitHub Check: Ubuntu Boost (75)
  • GitHub Check: macos (macos-14)
  • GitHub Check: macos (macos-latest)
  • GitHub Check: Ubuntu Boost (68)
  • GitHub Check: documentation (en)
  • GitHub Check: Ubuntu clang
  • GitHub Check: Check queries
  • GitHub Check: Ubuntu Boost (56)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (10)
sql/sigs/pgrouting--4.0.sig (2)

123-123: Confirm consistency with rest of codebase.
The parameters match the reverted _pgr_dijkstra signature, but please ensure downstream references and tests remain synchronized, especially regarding the new boolean and bigint parameters.


128-128: 🧹 Nitpick (assertive)

Validate parameter order and ensure documentation is current.
Keep an eye on potential confusion between the multiple boolean parameters. Consider clarifying or documenting each parameter’s purpose in the official docs.

sql/dijkstra/dijkstraCostMatrix.sql (1)

45-45: Confirm that passing the same array for start and end vertices is desired.
Here, $2 is used for both start_vids and end_vids. While valid, it may produce unexpected results if the query is intended to generate distinct start-end pairs. Otherwise, this looks consistent with the updated _pgr_dijkstra signature.

sql/dijkstra/_dijkstra.sql (3)

52-54: Evaluate STRICT usage.
Marking the function as STRICT ensures it won’t be called with any NULL arguments, which can prevent potential errors but might limit flexibility. Confirm that all callers provide valid, non-null inputs.


81-82: Added comment for _pgr_dijkstra(…TEXT…).
Consistent documentation annotations are essential. Make sure usage or design notes are accessible for contributors.


55-75: 🧹 Nitpick (assertive)

Second _pgr_dijkstra variant.
Having two variants with slightly different parameter sets can be helpful but can also cause confusion. Double-check consistency across the code (in SQL definitions, C implementations, and doc references).

sql/dijkstra/dijkstraNearCost.sql (1)

47-47: Function calls updated consistently with reversion.

The changes correctly revert the function calls from _pgr_dijkstrav4 back to _pgr_dijkstra while maintaining the same parameter structure and functionality.

Also applies to: 69-69, 92-92, 114-114

sql/dijkstra/dijkstraCost.sql (1)

46-46: Function calls consistently reverted across all variants.

The changes successfully revert the implementation back to using _pgr_dijkstra while preserving the correct parameter passing and functionality for all variants (ONE to ONE, ONE to MANY, MANY to ONE, MANY to MANY, and Combinations).

Also applies to: 69-69, 93-93, 117-117, 137-137

sql/dijkstra/dijkstraNear.sql (1)

52-52: Function calls properly reverted with parameter consistency.

The changes correctly revert to using _pgr_dijkstra while maintaining proper parameter passing and functionality across all variants. The boolean flags and cap parameters are correctly preserved.

Also applies to: 79-79, 107-107, 134-134

sql/dijkstra/dijkstra.sql (1)

56-56: Core Dijkstra implementation successfully reverted.

The changes correctly revert the core implementation back to using _pgr_dijkstra. All function variants maintain proper parameter passing and expected functionality.

Let's verify that all calls to _pgr_dijkstrav4 have been properly removed:

Also applies to: 82-82, 108-108, 134-134, 159-159

✅ Verification successful

Verified: Complete removal of _pgr_dijkstrav4 confirmed

The codebase has been thoroughly checked and shows:

  • No remaining references to _pgr_dijkstrav4
  • Consistent usage of _pgr_dijkstra across all function variants
  • Proper parameter passing in all implementations
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify complete removal of _pgr_dijkstrav4 references
echo "Checking for any remaining references to _pgr_dijkstrav4..."
rg "_pgr_dijkstrav4"

Length of output: 149


Script:

#!/bin/bash
# Description: Comprehensive verification of Dijkstra implementation
echo "Checking SQL files for any variations of dijkstrav4..."
rg -t sql "dijkstrav\w+" 

echo -e "\nVerifying correct _pgr_dijkstra usage in SQL files..."
rg -t sql "_pgr_dijkstra\s*\(" -A 1

echo -e "\nChecking for any CREATE FUNCTION statements with dijkstra..."
rg -t sql "CREATE(\s+OR\s+REPLACE)?\s+FUNCTION.*dijkstra.*"

Length of output: 7738

sql/dijkstra/_dijkstra.sql Show resolved Hide resolved
sql/dijkstra/_dijkstra.sql Show resolved Hide resolved
sql/dijkstra/_dijkstra.sql Show resolved Hide resolved
@cvvergara cvvergara merged commit b8aa244 into pgRouting:develop Jan 27, 2025
26 checks passed
@cvvergara cvvergara deleted the reverting-some-changes-from-c1b21c2fc8 branch January 27, 2025 03:58
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.

1 participant