Skip to content

Conversation

@cvvergara
Copy link
Member

@cvvergara cvvergara commented Mar 8, 2025

Changes proposed in this pull request:

  • Add sphinx-collapse to CI
  • Use the update test in main
    • Sample data is used in update test, but not always pgr_findCloseEdges is available
  • Fixed a bug on build-extension-update-files.pl

@pgRouting/admins

Summary by CodeRabbit

  • Documentation
    • Refined sample content and navigation in documentation, ensuring clearer presentation of query examples and metrics.
    • Enhanced the documentation build process to support improved collapsible sections.
    • Updated the pgr_degree function documentation with details on its parameters and results.
  • Tests
    • Optimized testing workflows by streamlining the setup process and ensuring a cleaner, more consistent environment for running tests.
    • Introduced version-dependent logic for data insertion during tests based on PostgreSQL version.

@cvvergara cvvergara added Bug Fix CI Conitnuous Integration labels Mar 8, 2025
@cvvergara cvvergara added this to the Release 3.8.0 milestone Mar 8, 2025
@cvvergara cvvergara requested a review from robe2 March 8, 2025 15:27
@cvvergara cvvergara self-assigned this Mar 8, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 8, 2025

Walkthrough

This pull request updates several GitHub Actions workflows to install the new Python package sphinx-collapse and modifies the database setup in the update workflow by renaming a job and repositioning commands. It also adjusts documentation by altering directive parameters and index entries. In addition, new PL/pgSQL blocks were added in SQL files to conditionally insert data based on PostgreSQL version checks, and the upgrade script’s version checks were simplified.

Changes

File(s) Change Summary
.github/workflows/release.yml, .github/workflows/update-locale.yml, .github/workflows/website.yml Added pip install sphinx-collapse to dependency installation steps.
.github/.../update.yml Renamed job from build to update-ver; repositioned database creation, extension setup, and test execution to ensure a clean database state.
doc/src/sampledata.rst Updated literalinclude directive parameters (:start-after: from -- p5 to -- p6; :end-before: from -- p6 to -- p7).
docqueries/src/sampledata.result, tools/testers/sampledata.sql Introduced new PL/pgSQL blocks that extract PostgreSQL version and conditionally insert geometrical points; updated comment marker in sampledata.sql.
sql/scripts/build-extension-update-files.pl Revised conditional checks for dropping functions during upgrade; simplified version comparisons and added POD documentation markers.
doc/metrics/pgr_degree.rst Modified index entries and section headers to shift emphasis from combined edges and vertices to a distinct focus on edges.

Sequence Diagram(s)

sequenceDiagram
    participant Script as PL/pgSQL Script
    participant DB as PostgreSQL
    Script->>DB: Call pgr_version()
    DB-->>Script: Return version string
    Script->>Script: Extract version number (v)
    alt v > 3.4
        Script->>DB: Execute INSERTs for new geometric points
    else v <= 3.4
        Script->>DB: Execute alternative INSERTs
    end
Loading
sequenceDiagram
    participant Runner as GitHub Runner
    participant DB as PostgreSQL Service
    Runner->>DB: Start PostgreSQL service
    Runner->>DB: Create database and add extension (pre-test)
    Runner->>DB: Run tests for the old version
    Runner->>DB: Drop and recreate database for a clean state
    Runner->>DB: Run tests for the current version
Loading

Poem

I’m a little rabbit in a code-filled glen,
Hopping through workflows again and again.
Pip commands now install a new surprise,
And databases are reset before tests arise.
With conditional blocks and updates embraced,
I cheer each change with a joyful bunny pace! 🐇


📜 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 db51a68 and 196a517.

📒 Files selected for processing (2)
  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po (22 hunks)
  • locale/pot/pgrouting_doc_strings.pot (22 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 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: 7

🔭 Outside diff range comments (1)
.github/workflows/update.yml (1)

130-134: 🧹 Nitpick (assertive)

Confirm Validity of Extension Update Target Version
The step that updates the pgrouting extension to '3.8.0' should be double-checked to ensure that this target version is both intended and compatible with your test environment. Adding conditional checks or enhanced logging could help catch unexpected version mismatches during the upgrade process.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0020b47 and 96315e1.

📒 Files selected for processing (10)
  • .github/workflows/release.yml (1 hunks)
  • .github/workflows/update-locale.yml (1 hunks)
  • .github/workflows/update.yml (3 hunks)
  • .github/workflows/website.yml (1 hunks)
  • doc/src/sampledata.rst (1 hunks)
  • docqueries/src/sampledata.result (3 hunks)
  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po (22 hunks)
  • locale/pot/pgrouting_doc_strings.pot (22 hunks)
  • sql/scripts/build-extension-update-files.pl (4 hunks)
  • tools/testers/sampledata.sql (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (17)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Ubuntu Boost (86)
  • GitHub Check: documentation (en)
  • GitHub Check: Ubuntu Boost (79)
  • GitHub Check: Ubuntu Boost (78)
  • GitHub Check: Ubuntu Boost (84)
  • GitHub Check: Ubuntu Boost (80)
  • GitHub Check: Ubuntu Boost (83)
  • GitHub Check: Ubuntu Boost (56)
  • GitHub Check: Ubuntu clang
  • GitHub Check: Ubuntu Boost (77)
  • GitHub Check: Ubuntu Boost (68)
  • GitHub Check: Ubuntu Boost (76)
  • GitHub Check: Ubuntu Boost (75)
  • GitHub Check: macos (macos-14)
  • GitHub Check: macos (macos-latest)
  • GitHub Check: Check queries
🔇 Additional comments (38)
locale/pot/pgrouting_doc_strings.pot (9)

11-11: LGTM!

The update to the POT-Creation-Date reflects the latest modifications to the translation template.


5413-5432: Great documentation enhancement on dead ends!

The added explanation about what constitutes a dead end in a graph is thorough and helpful. It clarifies edge cases and acknowledges that interpretation depends on the application context.


5449-5452: Valuable optimization tip added!

Good addition about using contraction-family functions to optimize processing when dealing with many dead ends.


5461-5464: Useful clarification on linear vertices!

The explanation of when linear vertices are meaningful (speed bumps, stop signals) and the optimization tip with contraction-family functions improves the documentation.


8758-8785: Comprehensive update to pgr_degree documentation!

The detailed documentation for the promoted pgr_degree function includes clear definitions, edge cases, and usage examples. This aligns with its promotion from proposed to official status.


8794-8815: Good examples for pgr_degree with different signatures!

The examples for both the simplified signature (Edges only) and the more complex one (Edges and Vertices) provide useful guidance for users.


8881-8896: Clear explanation of isolated vertices behavior!

The documentation now explicitly states how isolated vertices are handled in the result set, which is important for users to understand.


8917-8929: Helpful additions for identifying special vertex types!

The sections on finding dead ends (degree 1) and linear vertices (degree 2) provide practical use cases for the pgr_degree function.


15217-15217: Clearer explanation of the Via category!

The added description makes it much easier to understand what the Via category does - "find a continuous route that visits all the vertices in the order given".

doc/src/sampledata.rst (1)

244-245: Updated documentation query boundaries to match code changes.

The range of queries shown in "The points of interest" section has been adjusted to reflect the new code organization in the underlying SQL files, with markers changed from p5-p6 to p6-p7.

tools/testers/sampledata.sql (2)

90-139: Good version-dependent implementation for pointsOfInterest data.

This change elegantly addresses the PR objective about pgr_findCloseEdges not always being available by implementing version-dependent code paths. For versions > 3.4, the code uses pgr_findCloseEdges, while for older versions it directly inserts the data with pre-calculated values.


146-146: Updated boundary marker to align with documentation.

Correctly updated the marker from p6 to p7 to maintain consistency with the documentation file changes.

docqueries/src/sampledata.result (1)

153-202: Good version check implementation for test results.

The PL/pgSQL block correctly mirrors the implementation in the main SQL file, ensuring that the test results will be consistent regardless of the pgRouting version being used.

sql/scripts/build-extension-update-files.pl (6)

225-227: Simplified version check for 3.4 update.

The condition has been streamlined to only check if $old_minor < 3.4 rather than checking both major and minor versions, making the code more maintainable.


230-234: Simplified version check for 3.5 update.

Similar to the 3.4 update change, this simplifies the condition to only check the minor version.


237-250: Simplified version check for 3.6 update.

Consistent simplification of the version checking logic for version 3.6.


253-270: Updated version check for 3.7 update.

This condition now checks that the old major version is at least 3.0 AND the minor version is less than 3.7, which is more specific and correct.


273-276: Added version check for 3.8 special cases.

New condition that specifically addresses the pgr_findcloseedges function mentioned in the PR objectives, applicable when upgrading from versions between 3.4 and 3.8.


288-292: Added POD documentation markers.

Added proper Perl documentation markers around the version 3.0.0 special case code, improving code documentation.

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

11-11: Timestamp updated correctly.

The POT-Creation-Date has been updated to reflect the current date.


406-406: Documentation improvement.

This addition helps set the right expectations about community feedback requirements.


3545-3545: Clear function description.

The updated description for pgr_dijkstraVia clearly communicates its purpose.


3632-3632: Mathematical notation improvement.

The addition of proper mathematical notation for graph definitions improves documentation precision.

Also applies to: 3657-3657


3787-3787: Better document organization.

The new section headers improve the documentation structure and organization.

Also applies to: 3950-3950


4015-4015: Important behavioral clarification.

This addition helps users understand a key constraint of the flow algorithm.


4311-4314: Clear pgr_degree function description.

The new description accurately explains what the function does.


4426-4429: Properly documented API change.

The promotion of pgr_degree to official status and its new signature is clearly documented.


4432-4435: API change aligned with PR objectives.

The removal of the "partial" option from pgr_findCloseEdges is properly documented, aligning with what was mentioned in the PR objectives about this function not always being available.


6187-6209: Comprehensive dead end documentation.

This expanded explanation about dead ends provides valuable context and considerations for users.


6233-6238: Helpful implementation guidance.

The suggestion about using contraction functions for many dead ends provides practical optimization advice.


10251-10286: Excellent pgr_degree function documentation.

The comprehensive documentation covers all aspects of the function including:

  • Definition and mathematical background
  • Behavior with loops and isolated vertices
  • Usage notes and "dryrun" capabilities

This thorough documentation will greatly help users understand and properly use the function.


10304-10319: Good usage examples and performance advice.

The addition of practical usage examples and the recommendation to prepare vertex tables beforehand for better performance is very helpful.


10334-10337: Clear parameter documentation for different signatures.

The separate explanations for the dryrun parameter with different function signatures helps prevent confusion.


10389-10419: Thorough examples for degree calculation.

The detailed examples, including subgraph behavior and isolated vertices handling, will help users understand the function's behavior in different scenarios.


10433-10454: Practical application guidance.

The documentation about using the function to find dead ends and linear vertices provides excellent practical application examples.


13007-13007: Fixed typo.

Corrected "vaule" to "value" in the documentation.


18189-18189: Improved documentation structure.

The clarification about categories within the Traversal family helps with documentation organization.


18205-18205: Clearer explanation.

The rewording improves the clarity of the explanation about continuous routes.

@cvvergara cvvergara force-pushed the ci-update-test-fix branch from 96315e1 to deadf76 Compare March 8, 2025 15:40
@cvvergara cvvergara force-pushed the ci-update-test-fix branch from 63a1129 to db51a68 Compare March 8, 2025 16:34
@cvvergara cvvergara merged commit 5d7128f into pgRouting:main Mar 8, 2025
1 check passed
@cvvergara cvvergara deleted the ci-update-test-fix branch March 22, 2025 14:47
@coderabbitai coderabbitai bot mentioned this pull request Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Fix CI Conitnuous Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants