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

Removing unused SQL/legacy files from early versions of 2.x #2734

Merged

Conversation

cvvergara
Copy link
Member

@cvvergara cvvergara commented Jan 27, 2025

Removes files in sql.legacy from early version of 2.x

@pgRouting/admins

Summary by CodeRabbit

  • Refactor

    • Removed multiple legacy SQL functions and types related to pgRouting
    • Deleted deprecated experimental functions for graph algorithms, routing, and distance calculations
    • Removed version tracking and utility functions from legacy codebase
  • Cleanup

    • Eliminated outdated Traveling Salesman Problem (TSP) implementations
    • Removed legacy vehicle routing problem (VRP) functions
    • Cleared out deprecated utility and developer-specific PostgreSQL functions

@cvvergara cvvergara added Legacy Code Cleanup Code cleanup or small refactoring labels Jan 27, 2025
@cvvergara cvvergara added this to the Release 4.0.0 milestone Jan 27, 2025
@cvvergara cvvergara requested a review from robe2 January 27, 2025 00:40
Copy link

coderabbitai bot commented Jan 27, 2025

Walkthrough

This pull request involves the comprehensive removal of several legacy SQL files from the pgRouting project's sql/legacy/ directory. The deleted files contained deprecated functions related to various routing algorithms, graph processing, version tracking, and utility functions. These removals streamline the codebase by eliminating older, unsupported implementations and encouraging users to adopt newer function signatures and approaches.

Changes

Path Change Summary
sql/legacy/alpha_shape.sql Removed pgr_alphashape function for geometric data processing
sql/legacy/legacy-developers.sql Deleted multiple utility functions for database and geometry operations
sql/legacy/legacy_experimental.sql Removed experimental graph algorithm functions like pgr_labelGraph, pgr_maxFlowPushRelabel
sql/legacy/pgrouting_version.sql Deleted pgr_version() function for version information retrieval
sql/legacy/pointsAsPolygon.sql Removed pgr_pointsAsPolygon function for creating polygons from points
sql/legacy/routing_legacy.sql Deleted custom routing types and multiple routing functions
sql/legacy/tsp/ Removed multiple Traveling Salesman Problem (TSP) related functions
sql/legacy/vrppdtw/ Deleted Vehicle Routing Problem (VRP) related functions

Possibly related PRs

Poem

🐰 Farewell, old functions, your time has passed
Legacy code now fading fast
Clean and sleek, our routing dance
Deprecated paths lose their chance
Hop forward with renewed delight! 🚀


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4918c9e and 66c47ed.

📒 Files selected for processing (12)
  • sql/legacy/alpha_shape.sql (0 hunks)
  • sql/legacy/legacy-developers.sql (0 hunks)
  • sql/legacy/legacy_experimental.sql (0 hunks)
  • sql/legacy/pgrouting_version.sql (0 hunks)
  • sql/legacy/pointsAsPolygon.sql (0 hunks)
  • sql/legacy/routing_legacy.sql (0 hunks)
  • sql/legacy/tsp/TSPeucledian.sql (0 hunks)
  • sql/legacy/tsp/_makeDistanceMatrix.sql (0 hunks)
  • sql/legacy/tsp/tsp_v2.0_coordinates.sql (0 hunks)
  • sql/legacy/tsp/tsp_v2.0_matrix.sql (0 hunks)
  • sql/legacy/vrppdtw/_gsoc_vrppdtw.sql (0 hunks)
  • sql/legacy/vrppdtw/gsoc_vrppdtw.sql (0 hunks)

🪧 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 The changes look good! This PR removes 12 unused legacy SQL files from early versions of 2.x, totaling 2,043 deleted lines. The files being removed are:

  • Legacy SQL files under sql/legacy/
  • Legacy TSP-related files under sql/legacy/tsp/
  • Legacy VRPPDTW-related files under sql/legacy/vrppdtw/

I found no references to these files in the current codebase, confirming they are indeed unused. The cleanup is well-scoped and improves the maintainability of the codebase by removing obsolete code.

🔗 Analysis chain

@cvvergara I'll analyze the changes, generate a summary, and review the PR.


🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Get PR details
gh pr view 2734 --json files,additions,deletions,title,body

# List all changed files
git diff --name-status origin/main...HEAD

# Show the content of removed files
git diff --diff-filter=D origin/main...HEAD

Length of output: 1336


Script:

#!/bin/bash
# Check if any of these files are referenced elsewhere in the codebase
echo "Searching for references to legacy files..."
rg -l "alpha_shape\.sql|legacy-developers\.sql|legacy_experimental\.sql|pgrouting_version\.sql|pointsAsPolygon\.sql|routing_legacy\.sql|TSPeucledian\.sql|_makeDistanceMatrix\.sql|tsp_v2\.0_coordinates\.sql|tsp_v2\.0_matrix\.sql|_gsoc_vrppdtw\.sql|gsoc_vrppdtw\.sql"

# Get the content of one of the files to verify it's indeed a legacy file
echo "Checking content of legacy files..."
git show HEAD:sql/legacy/legacy_experimental.sql

Length of output: 570

✅ Actions performed

Comments resolved.


Summary regeneration triggered.

@cvvergara cvvergara merged commit abfe0a7 into pgRouting:develop Jan 27, 2025
9 checks passed
@cvvergara cvvergara deleted the remove-unused-files-in-sql-legacy branch January 27, 2025 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Cleanup Code cleanup or small refactoring Legacy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant