Skip to content

Conversation

cvvergara
Copy link
Member

@cvvergara cvvergara commented Jul 30, 2025

This PR will fulfill the necessary changes for starting to use std17 standard for C++
See MOTION for details

@pgRouting/admins

Summary by CodeRabbit

  • Chores

    • Updated build system to use C++17 by default and simplified Boost and Perl handling.
    • Added support for enabling Clang-Tidy static analysis during builds.
    • Introduced a new Clang-Tidy configuration file for consistent code style and analysis.
    • Removed legacy scripts and workflows related to Clang-Tidy checks.
    • Refined documentation build options and output locations.
  • Documentation

    • Updated release notes and documentation to reflect changes in build system, C++ standard, and documentation process.
    • Clarified requirements and options for building user and developer documentation.

@cvvergara cvvergara added this to the Release 4.0.0 milestone Jul 30, 2025
Copy link
Contributor

coderabbitai bot commented Jul 30, 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.

Walkthrough

This change updates the build and documentation system to modernize CMake configuration, explicitly require C++17, and add optional clang-tidy static analysis support. It introduces a .clang-tidy config, removes a custom clang-tidy script and workflow, updates documentation and release notes for new build behaviors, and clarifies documentation output and requirements.

Changes

Cohort / File(s) Change Summary
Clang-Tidy Configuration
.clang-tidy
Adds a new configuration file specifying enabled and disabled clang-tidy checks, header filters, and formatting rules for static analysis.
Clang-Tidy Script Removal
.github/scripts/tidy-vs-commit.sh
Deletes the script that previously ran clang-tidy only on files changed between commits.
Clang-Tidy Workflow Removal
.github/workflows/tidy-check.yml
Removes the GitHub Actions workflow that performed clang-tidy checks on PRs and manual triggers.
Clang Build Workflow Update
.github/workflows/clang.yml
Updates the CMake configuration in the CI workflow: splits documentation flags, adds USE_CLANG_TIDY=ON to enable static analysis.
CMake Modernization and Clang-Tidy Integration
CMakeLists.txt
Refactors and modernizes CMake setup: sets C++17 as default, simplifies Boost and Perl detection, adds optional clang-tidy integration, removes legacy C++ standard logic.
Documentation Updates for Build and Docs
NEWS.md, doc/src/release_notes.rst
Updates release notes and documentation to reflect new build defaults, C++17 standard, documentation output structure, and clang-tidy integration; removes duplicate sections.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant CMake
    participant Clang-Tidy
    participant CI Workflow

    Developer->>CMake: Configure build with -DUSE_CLANG_TIDY=ON
    CMake->>Clang-Tidy: Enable static analysis (if available)
    CMake->>CI Workflow: Build with C++17, docs, and optional clang-tidy
    CI Workflow->>Clang-Tidy: Run checks per .clang-tidy config
    Clang-Tidy-->>CI Workflow: Report analysis results
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Suggested labels

CI, Administrative

Suggested reviewers

  • robe2

Poem

A clang-tidy breeze through the code did blow,
With CMake now modern, the standards we show.
Docs build in new places, release notes refined,
Old scripts and workflows are left behind.
🐇 With static checks hopping, our code is aligned!

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 generate unit tests to generate unit tests for 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

Copy link
Contributor

coderabbitai bot commented Jul 30, 2025

@cvvergara I'll generate a summary and conduct a comprehensive review of this PR that modernizes pgRouting to use the C++17 standard and enables clang-tidy for improved code quality.


🧠 Learnings used
Learnt from: cvvergara
PR: pgRouting/pgrouting#2864
File: doc/tsp/pgr_TSPeuclidean.rst:55-56
Timestamp: 2025-04-22T22:56:39.572Z
Learning: User cvvergara prefers to handle grammar improvements in separate PRs from spelling/typo corrections.

Learnt from: cvvergara
PR: pgRouting/pgrouting#2723
File: tools/developer/run.sh:62-68
Timestamp: 2025-01-19T13:17:02.243Z
Learning: For pgRouting project, CMake configuration comments should be kept minimal and concise, avoiding extensive explanations of build options and configurations.

Learnt from: cvvergara
PR: pgRouting/pgrouting#2868
File: NEWS.md:46-47
Timestamp: 2025-04-24T23:34:23.099Z
Learning: For pgRouting, NEWS.md should be updated using the generator script (tools/release-scripts/notes2news.pl) rather than edited directly, which is the correct procedure that the project maintainers follow.

Learnt from: cvvergara
PR: pgRouting/pgrouting#0
File: :0-0
Timestamp: 2025-01-27T01:49:25.212Z
Learning: pgRouting version checks in tests:
- Use min_version() for SQL API changes
- Use min_lib_version() for C/C++ library changes
- Adjust test plans based on version conditions

Learnt from: cvvergara
PR: pgRouting/pgrouting#2764
File: locale/en/LC_MESSAGES/pgrouting_doc_strings.po:0-0
Timestamp: 2025-02-27T16:32:00.573Z
Learning: Modifications to locale files in the pgRouting project should be handled through an action commit or through the Weblate translation platform, not via direct edits.

Learnt from: cvvergara
PR: pgRouting/pgrouting#0
File: :0-0
Timestamp: 2025-01-27T01:49:25.212Z
Learning: In pgRouting, when deprecating internal functions:
1. Add deprecation notice in C code using ereport with ERRCODE_FEATURE_NOT_SUPPORTED
2. Update tests with version checks (min_version, min_lib_version)
3. Document changes in NEWS.md under appropriate sections

Learnt from: cvvergara
PR: pgRouting/pgrouting#2723
File: tools/developer/run.sh:192-194
Timestamp: 2025-01-19T13:16:44.066Z
Learning: For the pgRouting repository, keep review comments concise and avoid excessive detail in suggestions.

Learnt from: cvvergara
PR: pgRouting/pgrouting#2764
File: locale/en/LC_MESSAGES/pgrouting_doc_strings.po:2740-2740
Timestamp: 2025-02-27T16:31:49.972Z
Learning: Modifications to locale files in pgRouting (like .po files) are done through action commits or in weblate, not through direct manual edits in PRs.

Learnt from: cvvergara
PR: pgRouting/pgrouting#2764
File: sql/sigs/pgrouting--3.8.sig:274-275
Timestamp: 2025-02-27T16:34:57.518Z
Learning: The file `sql/sigs/pgrouting--3.8.sig` is auto-generated by a command and should not be modified manually.

Learnt from: cvvergara
PR: pgRouting/pgrouting#2868
File: include/drivers/contraction/contractionHierarchies_driver.h:1-73
Timestamp: 2025-04-24T23:36:04.580Z
Learning: The copyright year for pgRouting should be set to 2025 in new files, not 2024, as confirmed by the project maintainer.

Learnt from: cvvergara
PR: pgRouting/pgrouting#2725
File: src/coloring/edgeColoring_driver.cpp:87-87
Timestamp: 2025-01-19T16:17:53.496Z
Learning: Changes to error message handling in pgRouting functions require corresponding updates to pgtap tests to maintain test coverage.
✅ Actions performed

Summary regeneration triggered.

@cvvergara cvvergara added the CI Conitnuous Integration label Jul 31, 2025
@cvvergara cvvergara requested a review from robe2 August 4, 2025 15:05
@cvvergara cvvergara merged commit dee03ee into pgRouting:develop Aug 4, 2025
12 checks passed
@cvvergara cvvergara deleted the dev-use-std17-standard-and-clang-tidy-on-build branch August 4, 2025 15:19
@coderabbitai coderabbitai bot mentioned this pull request Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build CI Conitnuous Integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants