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

cmake release dep version overrides #920

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PhilipDeegan
Copy link
Member

@PhilipDeegan PhilipDeegan commented Oct 29, 2024

Summary by CodeRabbit

  • New Features

    • Enhanced version management for several dependencies including cppdict, HighFive, Pybind11, and SAMRAI.
    • Added a new section in the release documentation to streamline the version release process.
  • Bug Fixes

    • Improved feedback during the cloning process for repositories.
  • Documentation

    • Updated RELEASE.md with a checklist for new version releases.
  • Chores

    • Added conditional checks for various dependencies to improve configurability and maintainability of the build process.
    • Updated library dependencies for the phare_diagnostic project to include HighFive.

Copy link

coderabbitai bot commented Oct 29, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes in this pull request primarily involve updates to the CMake configuration files for various dependencies in the PHARE project. Each file introduces conditional checks for version variables, replacing hardcoded values with newly defined variables. This enhances flexibility in managing dependency versions. Additionally, the RELEASE.md file has been updated to include a checklist for the release process, and the CMakeLists.txt for the phare_diagnostic project has been modified to include additional header files and dependencies.

Changes

File Path Change Summary
res/cmake/dep/cppdict.cmake Added conditional check for PHARE_CPPDICT_VERION, replacing hardcoded version in method call.
res/cmake/dep/highfive.cmake Added conditional check for PHARE_HIGHFIVE_VERSION, replacing hardcoded version in method call.
res/cmake/dep/pybind.cmake Added conditional check for PHARE_PYBIND11_VERSION, replacing hardcoded version in method call.
res/cmake/dep/samrai.cmake Added conditional check for PHARE_SAMRAI_VERSION, replacing hardcoded version in method call.
res/cmake/release.cmake Added version declarations for multiple dependencies with comments for clarity.
RELEASE.md Added a new section with a checklist for releasing a new version of PHARE.
res/cmake/def.cmake Introduced conditional checks for CMAKE_BUILD_TYPE, updated sanitizer handling, and added test functions.
res/cmake/dep.cmake Added message output in phare_git_get_or_update for cloning feedback.
src/diagnostic/CMakeLists.txt Updated library dependencies and added additional header files when HighFive is enabled.

Possibly related PRs

  • samrai assertions if not in release #862: The changes in res/cmake/dep/samrai.cmake involve updating the versioning logic for SAMRAI, which is related to the versioning changes made in the main PR for cppdict.
  • simpler dep handling + versions #887: This PR simplifies the handling of dependencies in CMake, including cppdict, which directly relates to the changes made in the main PR regarding the management of the cppdict dependency.
  • silent error on linux #904: This PR modifies the CMake configuration, including handling compiler flags and test functions, which may relate to the overall CMake structure that is also impacted by the changes in the main PR.

Suggested reviewers

  • nicolasaunai

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • 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.

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

@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 and nitpick comments (5)
res/cmake/dep/pybind.cmake (1)

12-14: Consider using a specific version tag for reproducible builds.

Using "master" as the default version can lead to inconsistent builds as it points to different commits over time. Consider using a specific version tag as the default.

Apply this diff to set a specific version:

  if(NOT DEFINED PHARE_PYBIND11_VERSION)
-   SET(PHARE_PYBIND11_VERSION "master")
+   SET(PHARE_PYBIND11_VERSION "v2.13.6")  # Or another stable version
  endif()
res/cmake/dep/samrai.cmake (1)

13-16: Consider adding a brief comment explaining the version override mechanism.

It would be helpful to add a comment explaining that this version can be overridden (e.g., in release.cmake) and what the "develop" version implies.

+# PHARE_SAMRAI_VERSION can be overridden externally (e.g., in release.cmake)
+# Defaults to "develop" for development builds
 if(NOT DEFINED PHARE_SAMRAI_VERSION)
   SET(PHARE_SAMRAI_VERSION "develop")
 endif()
src/initializer/data_provider.hpp (1)

Line range hint 57-100: Consider adding serialization format versioning.

For long-term maintainability and backward compatibility, consider adding version information to the serialized format. This will help manage future schema changes and ensure proper migration paths.

Key considerations:

  1. Add a version field to the serialized format
  2. Document the serialization format
  3. Consider providing migration utilities for future format changes
  4. Add validation for the deserialized data
tests/initializer/phare_dict.cpp (2)

84-85: Consider extracting magic numbers as named constants.

The temperature value 0.12 should be defined as a named constant for better maintainability and clarity.

constexpr double ELECTRON_TEMPERATURE = 0.12;
// ...
dict["electrons"]["pressure_closure"]["Te"] = ELECTRON_TEMPERATURE;

96-96: Remove commented code.

The commented line should be removed if it's no longer needed.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between e61b34c and 2f32ac1.

📒 Files selected for processing (7)
  • res/cmake/dep/cppdict.cmake (1 hunks)
  • res/cmake/dep/highfive.cmake (1 hunks)
  • res/cmake/dep/pybind.cmake (1 hunks)
  • res/cmake/dep/samrai.cmake (1 hunks)
  • res/cmake/release.cmake (1 hunks)
  • src/initializer/data_provider.hpp (3 hunks)
  • tests/initializer/phare_dict.cpp (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • res/cmake/release.cmake
🧰 Additional context used
📓 Path-based instructions (1)
src/initializer/data_provider.hpp (1)

Pattern **/*.hpp: Review the C++ code, point out issues relative to principles of clean code, expressiveness, and performance.

🔇 Additional comments (8)
res/cmake/dep/cppdict.cmake (1)

8-9: Verify the repository change and version selection

The change from LaboratoryOfPlasmaPhysics/cppdict to PhilipDeegan/cppdict raises several concerns:

  1. Moving from an organizational to a personal repository might impact stability and maintenance
  2. The version change from "master" to "superserial" needs justification
  3. Long-term maintenance implications should be considered

Please provide rationale for these changes and confirm if this is a temporary solution or permanent change.

Let's verify the repository and version:

✅ Verification successful

Let me gather more information about the version changes and the relationship between these repositories.


Repository change appears to be a collaborative effort with proper maintenance

Based on the verification results, the concerns about the repository change can be addressed:

  1. The personal fork (PhilipDeegan/cppdict) is actively maintained and the author (Philip Deegan) is actually a contributor to the original repository, as evidenced by his commits in both repositories.
  2. The "superserial" branch contains specific improvements tested with PHARE, as shown in the commit message "tested with phare dict" and includes serialization enhancements.
  3. The changes are well-structured, with proper code organization (moving serialization to a separate header) and added test coverage.
  • The original repository badges and CI infrastructure are preserved in the fork
  • The code quality and maintenance standards appear to be maintained
  • The version change to "superserial" adds needed functionality for PHARE
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the personal fork exists and contains the required version
gh repo view PhilipDeegan/cppdict 2>/dev/null || echo "Repository not found"
gh api repos/PhilipDeegan/cppdict/branches/superserial 2>/dev/null || echo "Branch not found"

# Check if there are any other dependencies still using the original repository
rg -l "LaboratoryOfPlasmaPhysics/cppdict" res/cmake/

Length of output: 7873


Script:

#!/bin/bash
# Check the commit history and differences between repositories
gh api repos/LaboratoryOfPlasmaPhysics/cppdict/branches/master 2>/dev/null || echo "Original repo branch not found"

# Check for version references
rg "PHARE_CPPDICT_VERION" -A 1 -B 1

# Check if there are any specific changes in the superserial branch
gh api repos/PhilipDeegan/cppdict/commits/superserial 2>/dev/null || echo "Cannot fetch commit info"

Length of output: 32322

res/cmake/dep/highfive.cmake (1)

12-12: LGTM! Good use of the configurable version variable.

The change properly integrates the new version variable, maintaining functionality while adding flexibility for version management.

res/cmake/dep/samrai.cmake (1)

14-16: LGTM! Good approach to version management.

The introduction of PHARE_SAMRAI_VERSION with a default value provides good flexibility for version control while maintaining a sensible default for development.

src/initializer/data_provider.hpp (2)

14-14: LGTM!

The serializer include is correctly placed and follows the include order convention.


93-99: ⚠️ Potential issue

Address thread safety and ownership concerns in PHAREDictHandler methods.

Several issues need attention:

  1. The singleton pattern with static methods needs thread safety guarantees
  2. The load method's ownership semantics are unclear
  3. The comment "// ?" suggests implementation uncertainty

Consider this safer implementation:

-    void dump(std::string const& filename) const { dump_phare_dict(*phareDict, filename); }
+    void dump(std::string const& filename) const
+    {
+        if (!phareDict) {
+            throw std::runtime_error("Cannot dump: dictionary not initialized");
+        }
+        dump_phare_dict(*phareDict, filename);
+    }

-    static auto& load(std::string const& filename)
+    static PHAREDict& load(std::string const& filename)
     {
-        INSTANCE().phareDict = std::make_unique<PHAREDict>();       // reset
-        return (*INSTANCE().phareDict = load_phare_dict(filename)); // ?
+        auto& instance = INSTANCE();
+        std::lock_guard<std::mutex> lock(instance.mutex_);  // Add mutex_ as class member
+        instance.phareDict = std::make_unique<PHAREDict>(load_phare_dict(filename));
+        return *instance.phareDict;
     }

Let's verify if there are any other usages of these methods that might be affected:

tests/initializer/phare_dict.cpp (3)

1-11: LGTM: Headers and namespace usage are appropriate.

The includes and type aliases are well-organized and properly scoped for the test requirements.


42-44: Verify the identical charge configuration.

Both populations are configured with charge -1.0, which seems unusual as alpha particles typically have a different charge than protons.

Please confirm if this is intentional or if it needs adjustment.

Also applies to: 72-74


107-107: Document serialization limitations.

The comment indicates that x_component is not serializable, but this limitation should be properly documented in the relevant API documentation.

res/cmake/dep/cppdict.cmake Outdated Show resolved Hide resolved
res/cmake/dep/pybind.cmake Show resolved Hide resolved
src/initializer/data_provider.hpp Outdated Show resolved Hide resolved
tests/initializer/phare_dict.cpp Outdated Show resolved Hide resolved
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: 1

🧹 Outside diff range and nitpick comments (4)
src/initializer/data_provider.hpp (2)

57-74: Reconsider using inline for I/O operations.

The inline keyword is typically used for small, frequently called functions. For I/O operations that are relatively expensive and less frequently called, using inline might not be beneficial and could potentially increase code size without performance benefits.


95-99: Improve clarity of the load method implementation.

The current implementation combines reset and assignment in a way that's not immediately clear. Consider splitting these operations for better readability:

 static auto& load(std::string const& filename)
 {
     INSTANCE().phareDict = std::make_unique<PHAREDict>();       // reset
-    return (*INSTANCE().phareDict = load_phare_dict(filename)); // ?
+    *INSTANCE().phareDict = load_phare_dict(filename);
+    return *INSTANCE().phareDict;
 }

Also, the comment "// ?" suggests uncertainty about the implementation. Please either remove it or replace it with a meaningful comment explaining the implementation choice.

tests/initializer/phare_dict.cpp (2)

96-96: Remove commented-out code.

Dead code should be removed rather than commented out. If this alternative loading method is important, consider adding it as a separate test case.


107-107: Enhance the "NOT SERIALIZABLE" comment.

The current comment lacks context about why the component is not serializable and what developers should do about it.

Consider expanding the comment:

// InitFunction types are not serializable by design - they represent runtime function objects
// This check verifies that serialization correctly handles this limitation
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 2f32ac1 and 6325940.

📒 Files selected for processing (7)
  • res/cmake/dep/cppdict.cmake (1 hunks)
  • res/cmake/dep/highfive.cmake (1 hunks)
  • res/cmake/dep/pybind.cmake (1 hunks)
  • res/cmake/dep/samrai.cmake (1 hunks)
  • res/cmake/release.cmake (1 hunks)
  • src/initializer/data_provider.hpp (3 hunks)
  • tests/initializer/phare_dict.cpp (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • res/cmake/dep/cppdict.cmake
  • res/cmake/dep/highfive.cmake
  • res/cmake/dep/pybind.cmake
  • res/cmake/dep/samrai.cmake
  • res/cmake/release.cmake
🧰 Additional context used
📓 Path-based instructions (1)
src/initializer/data_provider.hpp (1)

Pattern **/*.hpp: Review the C++ code, point out issues relative to principles of clean code, expressiveness, and performance.

🔇 Additional comments (4)
src/initializer/data_provider.hpp (2)

14-15: LGTM: Include statement is properly placed.

The serializer include follows proper include ordering and is necessary for the new functionality.


57-74: Previous review comments about documentation and error handling are still applicable.

tests/initializer/phare_dict.cpp (2)

1-11: LGTM! Headers and declarations are well organized.

The includes are appropriate for the test's requirements and the type alias improves code readability.


12-88: Consider extracting magic numbers as named constants.

The function uses magic numbers that could be better expressed as named constants:

  • 100 for nbrPartPerCell
  • 0.12 for electron temperature Te

This would improve maintainability and make the test's intent clearer.

Example:

constexpr int PARTICLES_PER_CELL = 100;
constexpr double ELECTRON_TEMPERATURE = 0.12;

tests/initializer/phare_dict.cpp Outdated Show resolved Hide resolved
@PHAREHUB PHAREHUB deleted a comment from coderabbitai bot Oct 29, 2024
Copy link
Member

@nicolasaunai nicolasaunai left a comment

Choose a reason for hiding this comment

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

I suspect this is not finished since I see cppdict points to your repo and the phare dict test is not plugged to cmake/gtest and only tests some of the dict values.

tests/initializer/phare_dict.cpp Outdated Show resolved Hide resolved
tests/initializer/phare_dict.cpp Outdated Show resolved Hide resolved
tests/initializer/phare_dict.cpp Outdated Show resolved Hide resolved
tests/initializer/phare_dict.cpp Outdated Show resolved Hide resolved
res/cmake/dep/cppdict.cmake Outdated Show resolved Hide resolved
@PhilipDeegan
Copy link
Member Author

I suspect this is not finished since I see cppdict points to your repo and the phare dict test is not plugged to cmake/gtest and only tests some of the dict values.

yes this branch is currently hijacked to test serialization in a cppdict fork

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: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 6325940 and 30ee602.

📒 Files selected for processing (9)
  • RELEASE.md (1 hunks)
  • res/cmake/def.cmake (1 hunks)
  • res/cmake/dep.cmake (1 hunks)
  • res/cmake/dep/cppdict.cmake (1 hunks)
  • res/cmake/dep/highfive.cmake (1 hunks)
  • res/cmake/dep/pybind.cmake (1 hunks)
  • res/cmake/dep/samrai.cmake (1 hunks)
  • res/cmake/release.cmake (1 hunks)
  • src/diagnostic/CMakeLists.txt (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • res/cmake/dep/cppdict.cmake
  • res/cmake/dep/highfive.cmake
  • res/cmake/dep/pybind.cmake
  • res/cmake/dep/samrai.cmake
  • res/cmake/release.cmake
🧰 Additional context used
🪛 LanguageTool
RELEASE.md

[uncategorized] ~4-~4: You might be missing the article “the” here.
Context: ...cmake/release.cmake - [ ] Update to use latest (if safe) versions - [ ] PR updates to ...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

🔇 Additional comments (4)
src/diagnostic/CMakeLists.txt (1)

Line range hint 11-19: Verify build configuration across different HighFive settings

The integration of HighFive affects both header inclusion and library linking. Let's verify the build configuration in different scenarios.

Also applies to: 24-24

✅ Verification successful

Let me gather more information to verify the build configuration thoroughly.


Let me check one more aspect to ensure proper conditional compilation.


Build configuration for HighFive appears to be properly isolated

The verification shows that:

  • HighFive is only referenced in CMake configuration files
  • No unconditional includes of HighFive headers were found
  • All HighFive-dependent code is properly contained within the h5* files that are conditionally included
  • The type writers and diagnostic writers are template-based, allowing for different backend implementations
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for potential build configuration issues

# Check if there are any direct includes of HighFive headers outside the conditional block
echo "Checking for unconditional HighFive includes..."
rg -l "include.*HighFive" src/diagnostic/

# Check for any usage of HighFive features in non-conditional code
echo "Checking for HighFive usage in main headers..."
rg -l "HighFive::" src/diagnostic/diagnostic_{manager,writer,props}.hpp

# Look for other potential dependencies on HighFive
echo "Checking for other HighFive dependencies..."
rg -l "HighFive" src/diagnostic/ --type cmake

Length of output: 554


Script:

#!/bin/bash
# Check for conditional includes and usage of HighFive in implementation files
echo "Checking for HighFive includes in implementation files..."
rg -l "#ifdef.*HighFive|#if.*HighFive|#ifndef.*HighFive" src/diagnostic/

# Check the content of h5writer.hpp to verify proper conditional compilation
echo "Checking h5writer.hpp content..."
rg -A 5 "#ifdef.*HighFive|#if.*HighFive|#ifndef.*HighFive" src/diagnostic/detail/h5writer.hpp

# Check if there are any HighFive-related symbols or types used without proper guards
echo "Checking for HighFive-related symbols..."
rg "H5::|HighFive::" src/diagnostic/

# Check for any other CMake files that might reference HighFive
echo "Checking for HighFive in parent CMake files..."
fd CMakeLists.txt -x rg -l "HighFive" {}

Length of output: 1297


Script:

#!/bin/bash
# Check the content of diagnostic headers for proper HighFive conditional compilation
echo "Checking diagnostic headers for proper guards..."
rg -C 5 "class.*Writer|struct.*Writer" src/diagnostic/detail/h5*.hpp

# Check if the HighFive-dependent types are properly guarded
echo "Checking type definitions..."
rg -C 5 "class|struct|typedef" src/diagnostic/detail/types/*.hpp

# Check for any direct dependencies in the implementation files
echo "Checking implementation files..."
fd -e cpp -e hpp . --full-path src/diagnostic/ --exec rg -l "h5writer|h5typewriter|HighFive" {}

Length of output: 8005

res/cmake/dep.cmake (2)

5-5: LGTM! The added message improves build process visibility.

The new message provides clear feedback when cloning repositories, which is consistent with the existing message for updates.


Line range hint 20-39: Verify dependency version management across included CMake files.

Since this file is the central point for dependency management and includes several dependency-specific CMake files, we should verify the version management changes mentioned in the AI summary.

✅ Verification successful

Dependency version management is properly implemented across CMake files

The verification shows that version management is well-structured across the dependency files:

  • Each dependency has a configurable version variable (e.g., PHARE_PYBIND11_VERSION, PHARE_HIGHFIVE_VERSION, PHARE_SAMRAI_VERSION)
  • Default versions are set when not explicitly defined
  • Consistent use of phare_github_get_or_update function for fetching dependencies
  • Proper version checks where needed (e.g., PYBIND_MIN_VERSION for pybind11)
  • Fallback mechanisms are in place (e.g., trying to find installed packages before downloading)

The dependency management system appears to be robust and well-maintained, with no issues requiring attention.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for version variables and their usage in dependency CMake files

# List all dependency CMake files
echo "=== Listing dependency CMake files ==="
fd -t f . "res/cmake/dep" -x echo "Found: {}"

# Check for version variables and their usage
echo -e "\n=== Checking version variables ==="
rg -A 3 "VERSION|version" "res/cmake/dep/*.cmake"

# Check for phare_git_get_or_update usage
echo -e "\n=== Checking dependency fetch calls ==="
rg -A 3 "phare_g[i]t[h]*_get_or_update" "res/cmake/dep/*.cmake"

Length of output: 761


Script:

#!/bin/bash
# Let's try with individual file paths instead of glob pattern

echo "=== Checking version variables in each dependency file ==="
for file in res/cmake/dep/pybind.cmake res/cmake/dep/highfive.cmake res/cmake/dep/phlop.cmake res/cmake/dep/caliper.cmake res/cmake/dep/cppdict.cmake res/cmake/dep/samrai.cmake; do
    echo -e "\nFile: $file"
    echo "----------------------------------------"
    rg -A 3 "VERSION|version" "$file" || echo "No version information found"
done

echo -e "\n=== Checking dependency fetch mechanisms ==="
for file in res/cmake/dep/pybind.cmake res/cmake/dep/highfive.cmake res/cmake/dep/phlop.cmake res/cmake/dep/caliper.cmake res/cmake/dep/cppdict.cmake res/cmake/dep/samrai.cmake; do
    echo -e "\nFile: $file"
    echo "----------------------------------------"
    rg -A 3 "git_clone|FetchContent|ExternalProject_Add|phare_git" "$file" || echo "No fetch mechanism found"
done

# Also check the content of these files to understand their structure
echo -e "\n=== Showing content of dependency files ==="
for file in res/cmake/dep/pybind.cmake res/cmake/dep/highfive.cmake res/cmake/dep/phlop.cmake res/cmake/dep/caliper.cmake res/cmake/dep/cppdict.cmake res/cmake/dep/samrai.cmake; do
    echo -e "\nFile: $file"
    echo "----------------------------------------"
    cat "$file"
done

Length of output: 15400

res/cmake/def.cmake (1)

90-96: Conditional inclusion of release configuration is appropriate.

Including release.cmake when CMAKE_BUILD_TYPE is set to "Release" outside of devMode ensures that release-specific configurations are applied correctly.

src/diagnostic/CMakeLists.txt Outdated Show resolved Hide resolved
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: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 30ee602 and 1b0cb75.

📒 Files selected for processing (9)
  • RELEASE.md (1 hunks)
  • res/cmake/def.cmake (1 hunks)
  • res/cmake/dep.cmake (1 hunks)
  • res/cmake/dep/cppdict.cmake (1 hunks)
  • res/cmake/dep/highfive.cmake (1 hunks)
  • res/cmake/dep/pybind.cmake (1 hunks)
  • res/cmake/dep/samrai.cmake (1 hunks)
  • res/cmake/release.cmake (1 hunks)
  • src/diagnostic/CMakeLists.txt (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (8)
  • RELEASE.md
  • res/cmake/dep.cmake
  • res/cmake/dep/cppdict.cmake
  • res/cmake/dep/highfive.cmake
  • res/cmake/dep/pybind.cmake
  • res/cmake/dep/samrai.cmake
  • res/cmake/release.cmake
  • src/diagnostic/CMakeLists.txt
🔇 Additional comments (1)
res/cmake/def.cmake (1)

93-95: Consider test implications of release version overrides

Given the PR comments about incomplete test integration, particularly for cppdict, ensure that the version overrides in release.cmake don't affect test execution. Consider:

  1. Adding test cases that verify behavior with release versions
  2. Documenting any version-specific test requirements

Let's check for version-dependent test configurations:

res/cmake/def.cmake Show resolved Hide resolved
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: 1

🧹 Outside diff range and nitpick comments (1)
tests/amr/tagging/test_tagging.cpp (1)

Line range hint 208-208: Address TODO comment for tagging tests

The comment "TODOmaybe find a way to test the tagging?" suggests that critical functionality might be untested. The commented-out test implementation below provides a good starting point for implementing these tests.

Would you like me to help implement the tagging tests based on the commented-out code structure? I can help:

  1. Uncomment and fix the existing test implementation
  2. Add additional test cases for edge cases
  3. Create a GitHub issue to track this task
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 1b0cb75 and 97fd182.

📒 Files selected for processing (10)
  • RELEASE.md (1 hunks)
  • res/cmake/def.cmake (1 hunks)
  • res/cmake/dep.cmake (1 hunks)
  • res/cmake/dep/cppdict.cmake (1 hunks)
  • res/cmake/dep/highfive.cmake (1 hunks)
  • res/cmake/dep/pybind.cmake (1 hunks)
  • res/cmake/dep/samrai.cmake (1 hunks)
  • res/cmake/release.cmake (1 hunks)
  • src/diagnostic/CMakeLists.txt (1 hunks)
  • tests/amr/tagging/test_tagging.cpp (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (8)
  • RELEASE.md
  • res/cmake/dep.cmake
  • res/cmake/dep/cppdict.cmake
  • res/cmake/dep/highfive.cmake
  • res/cmake/dep/pybind.cmake
  • res/cmake/dep/samrai.cmake
  • res/cmake/release.cmake
  • src/diagnostic/CMakeLists.txt
🔇 Additional comments (4)
tests/amr/tagging/test_tagging.cpp (3)

26-30: LGTM! Type alias update and consistent formatting

The type alias change to PHARE::solver::PHARE_Types aligns with the header reorganization. The dictionary initialization uses well-aligned assignments.


172-172: LGTM! Consistent type alias update

The type alias change to PHARE::solver::PHARE_Types maintains consistency with the previous changes.


5-5: Verify header dependencies after include path change

The change from "phare/phare.hpp" to "phare_solver.hpp" suggests a reorganization of the header structure.

✅ Verification successful

Header change is consistent with type system reorganization

The change from "phare/phare.hpp" to "phare_solver.hpp" is part of a consistent reorganization where:

  • The new header phare_solver.hpp is used in related solver components
  • All necessary type definitions are available through the new include path
  • The change aligns with the migration from PHARE::PHARE_Types to PHARE::solver::PHARE_Types namespace
  • The test file has all required dependencies through the include hierarchy
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that all necessary declarations are available in the new header
# and that it's consistently used across the codebase

# Check if old header still exists and is used elsewhere
rg -l "phare/phare\.hpp"

# Check the new header's usage pattern
rg -l "phare_solver\.hpp"

# Look for any potential include-related compilation flags or definitions
rg -l "PHARE_SOLVER|PHARE_INCLUDE" --type cmake

Length of output: 435


Script:

#!/bin/bash
# Let's analyze the content of both headers and their dependencies

# Check the content of phare_solver.hpp
rg -p "class|struct|namespace|using|typedef" "src/simulator/phare_types.hpp"

# Check the content and dependencies in the old header
rg -p "class|struct|namespace|using|typedef" "src/phare/phare.cpp"

# Check the specific types used in the test file
rg -p "PHARE::solver::PHARE_Types|PHARE::PHARE_Types" "tests/amr/tagging/test_tagging.cpp"

# Look at the include dependencies in the test file
rg -p "#include" "tests/amr/tagging/test_tagging.cpp"

Length of output: 3374

res/cmake/def.cmake (1)

90-96: Verify the integration with release.cmake

The conditional inclusion of release.cmake for Release builds is logically placed in the non-dev mode branch. However, there are a few considerations:

  1. The change assumes release.cmake exists and contains valid CMake code
  2. There's a known typo in the dependency version variable (PHARE_CPPDICT_VERION vs PHARE_CPPDICT_VERSION) that needs to be fixed

Let's verify the integration:

#!/bin/bash
# Description: Verify release.cmake integration and variable usage

# Check if release.cmake exists and show its content
if [ -f "res/cmake/release.cmake" ]; then
    echo "File exists. Content:"
    cat "res/cmake/release.cmake"
    
    # Check for version variables and their usage
    echo -e "\nChecking for version variable usage:"
    rg "PHARE_CPPDICT_VER[SI]ON" --type cmake
fi

tests/amr/tagging/test_tagging.cpp Show resolved Hide resolved
Comment on lines +93 to +95
if (CMAKE_BUILD_TYPE STREQUAL "Release")
include("${PHARE_PROJECT_DIR}/res/cmake/release.cmake")
endif()
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm undecided on this

@PHAREHUB PHAREHUB deleted a comment from coderabbitai bot Dec 13, 2024
@PhilipDeegan
Copy link
Member Author

this branch is no longer hijacked to test the dict serialization

@PhilipDeegan
Copy link
Member Author

closes #886

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.

2 participants