Skip to content

refactor: Bump min json ver, make json keys static#2968

Closed
paulgessinger wants to merge 12 commits intoacts-project:mainfrom
paulgessinger:refactor/json-keys
Closed

refactor: Bump min json ver, make json keys static#2968
paulgessinger wants to merge 12 commits intoacts-project:mainfrom
paulgessinger:refactor/json-keys

Conversation

@paulgessinger
Copy link
Copy Markdown
Member

@paulgessinger paulgessinger commented Feb 20, 2024

Summary by CodeRabbit

  • Refactor

    • Improved efficiency and readability by replacing mutable JSON key structs with compile-time string constants for JSON serialization.
    • Updated internal usage of JSON keys to use new static constants, simplifying code and reducing overhead.
  • Chores

    • Updated the minimum required version and checksum for the nlohmann_json dependency in the build configuration.

@paulgessinger paulgessinger added this to the next milestone Feb 20, 2024
@github-actions github-actions bot added the Component - Plugins Affects one or more Plugins label Feb 20, 2024
@paulgessinger paulgessinger changed the title refactor: Use constexpr string_views for json keys refactor: Bump min json ver, make json keys static Feb 20, 2024
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 20, 2024

📊: Physics performance monitoring for 4df7b1b

Full contents

physmon summary

@paulgessinger paulgessinger marked this pull request as draft February 20, 2024 13:10
@github-actions github-actions bot removed the Component - Plugins Affects one or more Plugins label Feb 20, 2024
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.86%. Comparing base (4b480b7) to head (dbc3c50).

Current head dbc3c50 differs from pull request most recent head 9c4e443

Please upload reports for the commit 9c4e443 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2968      +/-   ##
==========================================
+ Coverage   47.26%   48.86%   +1.59%     
==========================================
  Files         510      493      -17     
  Lines       30096    29058    -1038     
  Branches    14605    13798     -807     
==========================================
- Hits        14226    14200      -26     
+ Misses       5378     4962     -416     
+ Partials    10492     9896     -596     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot added the Component - Plugins Affects one or more Plugins label Mar 11, 2024
@github-actions github-actions bot added Stale and removed Stale labels Apr 10, 2024
@github-actions github-actions bot added Stale and removed Stale labels May 10, 2024
@github-actions github-actions bot added the Stale label Jun 9, 2024
@github-actions github-actions bot added the Infrastructure Changes to build tools, continous integration, ... label Jun 21, 2024
@github-actions github-actions bot removed the Stale label Jun 21, 2024
@github-actions github-actions bot added the Stale label Jul 21, 2024
@paulgessinger paulgessinger marked this pull request as ready for review July 23, 2024 06:56
@github-actions github-actions bot removed the Stale label Jul 23, 2024
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
37.79% Line Coverage on New Code (required ≥ 50%)

See analysis details on SonarCloud

@paulgessinger paulgessinger added the 🛑 blocked This item is blocked by another item label Aug 22, 2024
@paulgessinger paulgessinger marked this pull request as draft August 22, 2024 13:38
@github-actions github-actions bot added the Stale label Sep 21, 2024
@sonarqubecloud
Copy link
Copy Markdown

@github-actions github-actions bot removed the Stale label Sep 24, 2024
@github-actions github-actions bot added Stale and removed Stale labels Oct 24, 2024
@github-actions github-actions bot added the Stale label Nov 30, 2024
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 30, 2024

Important

Review skipped

Auto incremental reviews are disabled on this repository.

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

Updated, the nlohmann_json dependency version and checksum are. Refactored, JSON key storage is, from struct members to static constexpr string_views in a namespace. Adjusted, all usages of these keys in material and volume JSON converters are. No logic or control flow changed, hmmm.

Changes

File(s) Change Summary
CMakeLists.txt, cmake/ActsExternSources.cmake Updated nlohmann_json version and SHA256 checksum in build configuration.
Plugins/Json/include/Acts/Plugins/Json/GeometryJsonKeys.hpp Refactored JSON key storage: removed struct, added namespace with static constexpr string_view constants.
Plugins/Json/src/MaterialJsonConverter.cpp, Plugins/Json/src/VolumeJsonConverter.cpp Replaced old struct-based JSON key accesses with new namespace static constants throughout serialization code.

Poem

🌟
Refactored keys, now swift as light,
In namespace deep, their values right.
The JSON flows, with clarity’s might,
Dependency updated, checksums tight.
Yoda approves—change strong, code bright!
🌟


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 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.

@andiwand
Copy link
Copy Markdown
Contributor

andiwand commented Dec 6, 2024

still relevant @paulgessinger ?

@github-actions github-actions bot removed the Stale label Dec 7, 2024
@github-actions github-actions bot added the Stale label Jan 6, 2025
@sonarqubecloud
Copy link
Copy Markdown

@github-actions github-actions bot removed the Stale label Jun 10, 2025
@paulgessinger paulgessinger marked this pull request as ready for review June 10, 2025 18:18
Copy link
Copy Markdown

@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: 0

🧹 Nitpick comments (1)
Plugins/Json/src/MaterialJsonConverter.cpp (1)

457-469: Guard the lookup, safer it becomes.

jMaterial[Acts::JsonKey::kMaterialMap] used without contains() check; when key absent, default-constructs null and still compares, undefined logic it invites. Prefer explicit guard:

-if (jMaterial[Acts::JsonKey::kMaterialMap] == false) {
+if (!jMaterial.contains(Acts::JsonKey::kMaterialMap) ||
+    jMaterial[Acts::JsonKey::kMaterialMap] == false) {
     return;
 }

Also applies to: 590-598

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ad8e2a9 and ac0af34.

📒 Files selected for processing (5)
  • CMakeLists.txt (1 hunks)
  • Plugins/Json/include/Acts/Plugins/Json/GeometryJsonKeys.hpp (1 hunks)
  • Plugins/Json/src/MaterialJsonConverter.cpp (13 hunks)
  • Plugins/Json/src/VolumeJsonConverter.cpp (1 hunks)
  • cmake/ActsExternSources.cmake (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (150)
  • GitHub Check: CI Bridge / lcg_107: [alma9, clang19]
  • GitHub Check: CI Bridge / build_gnn_tensorrt
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc13]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, clang16]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc13]
  • GitHub Check: CI Bridge / build_exatrkx_cpu
  • GitHub Check: CI Bridge / clang_tidy
  • GitHub Check: CI Bridge / lcg_105: [alma9, gcc13]
  • GitHub Check: CI Bridge / linux_ubuntu_2204
  • GitHub Check: CI Bridge / lcg_105: [alma9, clang16]
  • GitHub Check: CI Bridge / build_exatrkx
  • GitHub Check: CI Bridge / build_linux_ubuntu
  • GitHub Check: CI Bridge / linux_ubuntu_2404_clang19
  • GitHub Check: CI Bridge / lcg_107: [alma9, clang19]
  • GitHub Check: CI Bridge / build_gnn_tensorrt
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc13]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, clang16]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc13]
  • GitHub Check: CI Bridge / build_exatrkx_cpu
  • GitHub Check: CI Bridge / clang_tidy
  • GitHub Check: CI Bridge / lcg_105: [alma9, gcc13]
  • GitHub Check: CI Bridge / linux_ubuntu_2204
  • GitHub Check: CI Bridge / lcg_105: [alma9, clang16]
  • GitHub Check: CI Bridge / build_exatrkx
  • GitHub Check: CI Bridge / build_linux_ubuntu
  • GitHub Check: CI Bridge / linux_ubuntu_2404_clang19
  • GitHub Check: CI Bridge / lcg_107: [alma9, clang19]
  • GitHub Check: CI Bridge / build_gnn_tensorrt
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc13]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, clang16]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc13]
  • GitHub Check: CI Bridge / build_exatrkx_cpu
  • GitHub Check: CI Bridge / clang_tidy
  • GitHub Check: CI Bridge / lcg_105: [alma9, gcc13]
  • GitHub Check: CI Bridge / linux_ubuntu_2204
  • GitHub Check: CI Bridge / lcg_105: [alma9, clang16]
  • GitHub Check: CI Bridge / build_exatrkx
  • GitHub Check: CI Bridge / build_linux_ubuntu
  • GitHub Check: CI Bridge / linux_ubuntu_2404_clang19
  • GitHub Check: CI Bridge / lcg_107: [alma9, clang19]
  • GitHub Check: CI Bridge / build_gnn_tensorrt
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc13]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, clang16]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc13]
  • GitHub Check: CI Bridge / build_exatrkx_cpu
  • GitHub Check: CI Bridge / clang_tidy
  • GitHub Check: CI Bridge / lcg_105: [alma9, gcc13]
  • GitHub Check: CI Bridge / linux_ubuntu_2204
  • GitHub Check: CI Bridge / lcg_105: [alma9, clang16]
  • GitHub Check: CI Bridge / build_exatrkx
  • GitHub Check: CI Bridge / build_linux_ubuntu
  • GitHub Check: CI Bridge / linux_ubuntu_2404_clang19
  • GitHub Check: CI Bridge / lcg_107: [alma9, clang19]
  • GitHub Check: CI Bridge / build_gnn_tensorrt
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc13]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, clang16]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc13]
  • GitHub Check: CI Bridge / build_exatrkx_cpu
  • GitHub Check: CI Bridge / clang_tidy
  • GitHub Check: CI Bridge / lcg_105: [alma9, gcc13]
  • GitHub Check: CI Bridge / linux_ubuntu_2204
  • GitHub Check: CI Bridge / lcg_105: [alma9, clang16]
  • GitHub Check: CI Bridge / build_exatrkx
  • GitHub Check: CI Bridge / build_linux_ubuntu
  • GitHub Check: CI Bridge / linux_ubuntu_2404_clang19
  • GitHub Check: CI Bridge / lcg_107: [alma9, clang19]
  • GitHub Check: CI Bridge / build_gnn_tensorrt
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc13]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, clang16]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc13]
  • GitHub Check: CI Bridge / build_exatrkx_cpu
  • GitHub Check: CI Bridge / clang_tidy
  • GitHub Check: CI Bridge / lcg_105: [alma9, gcc13]
  • GitHub Check: CI Bridge / linux_ubuntu_2204
  • GitHub Check: CI Bridge / lcg_105: [alma9, clang16]
  • GitHub Check: CI Bridge / build_exatrkx
  • GitHub Check: CI Bridge / build_linux_ubuntu
  • GitHub Check: CI Bridge / linux_ubuntu_2404_clang19
  • GitHub Check: CI Bridge / lcg_107: [alma9, clang19]
  • GitHub Check: CI Bridge / build_gnn_tensorrt
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc13]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, clang16]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc13]
  • GitHub Check: CI Bridge / build_exatrkx_cpu
  • GitHub Check: CI Bridge / clang_tidy
  • GitHub Check: CI Bridge / lcg_105: [alma9, gcc13]
  • GitHub Check: CI Bridge / linux_ubuntu_2204
  • GitHub Check: CI Bridge / lcg_105: [alma9, clang16]
  • GitHub Check: CI Bridge / build_exatrkx
  • GitHub Check: CI Bridge / build_linux_ubuntu
  • GitHub Check: CI Bridge / linux_ubuntu_2404_clang19
  • GitHub Check: CI Bridge / lcg_107: [alma9, clang19]
  • GitHub Check: CI Bridge / build_gnn_tensorrt
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc13]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, clang16]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc13]
  • GitHub Check: CI Bridge / build_exatrkx_cpu
  • GitHub Check: CI Bridge / clang_tidy
  • GitHub Check: CI Bridge / lcg_105: [alma9, gcc13]
  • GitHub Check: CI Bridge / linux_ubuntu_2204
  • GitHub Check: CI Bridge / lcg_105: [alma9, clang16]
  • GitHub Check: CI Bridge / build_exatrkx
  • GitHub Check: CI Bridge / build_linux_ubuntu
  • GitHub Check: CI Bridge / linux_ubuntu_2404_clang19
  • GitHub Check: CI Bridge / lcg_107: [alma9, clang19]
  • GitHub Check: CI Bridge / build_gnn_tensorrt
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc13]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, clang16]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc13]
  • GitHub Check: CI Bridge / build_exatrkx_cpu
  • GitHub Check: CI Bridge / clang_tidy
  • GitHub Check: CI Bridge / lcg_105: [alma9, gcc13]
  • GitHub Check: CI Bridge / linux_ubuntu_2204
  • GitHub Check: CI Bridge / lcg_105: [alma9, clang16]
  • GitHub Check: CI Bridge / build_exatrkx
  • GitHub Check: CI Bridge / build_linux_ubuntu
  • GitHub Check: CI Bridge / linux_ubuntu_2404_clang19
  • GitHub Check: CI Bridge / lcg_107: [alma9, clang19]
  • GitHub Check: CI Bridge / build_gnn_tensorrt
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc13]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, clang16]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc13]
  • GitHub Check: CI Bridge / build_exatrkx_cpu
  • GitHub Check: CI Bridge / clang_tidy
  • GitHub Check: CI Bridge / lcg_105: [alma9, gcc13]
  • GitHub Check: CI Bridge / linux_ubuntu_2204
  • GitHub Check: CI Bridge / lcg_105: [alma9, clang16]
  • GitHub Check: CI Bridge / build_exatrkx
  • GitHub Check: CI Bridge / build_linux_ubuntu
  • GitHub Check: CI Bridge / linux_ubuntu_2404_clang19
🔇 Additional comments (5)
CMakeLists.txt (1)

280-280: Bumped the force, you have; environment update, verify must.

Version 3.11.2 set, yet CI speaks of LCG105 holding 3.10.5. Build shall fail, hmm? Ensure container or module upgraded before merge, you should.

cmake/ActsExternSources.cmake (1)

50-52: Checksum matches the new reality, confirm we must.

Digest updated; good this seems. Still, run sha256sum on the tarball to be certain, you could. A corrupted archive, avoid we must.

Plugins/Json/src/VolumeJsonConverter.cpp (1)

19-25: Static key usage, elegant this is.

Compile-time constant over dynamic struct, faster and safer. Change clean, nothing else to note.

Plugins/Json/src/MaterialJsonConverter.cpp (1)

90-96: Static keys embraced, consistency brought.

Refactor clear, performance neutral, readability improved. Approve, I do.

Plugins/Json/include/Acts/Plugins/Json/GeometryJsonKeys.hpp (1)

11-33: Constexpr string_view, strong with the force it is.

Memory saved, initialization order issues vanished. Good change.

@github-actions github-actions bot added the Stale label Jul 14, 2025
@paulgessinger paulgessinger marked this pull request as draft August 8, 2025 12:15
@github-actions github-actions bot removed the Stale label Aug 9, 2025
@github-actions github-actions bot added the Stale label Sep 11, 2025
@andiwand
Copy link
Copy Markdown
Contributor

still relevant @paulgessinger ?

@github-actions github-actions bot removed the Stale label Sep 23, 2025
@github-actions github-actions bot added the Stale label Oct 24, 2025
@andiwand andiwand modified the milestones: next, v45.0.0 Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component - Plugins Affects one or more Plugins Infrastructure Changes to build tools, continous integration, ... Stale 🛑 blocked This item is blocked by another item

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants