Skip to content

Get rid of Ramble's dependency on spack_json#1648

Open
linsword13 wants to merge 1 commit into
GoogleCloudPlatform:developfrom
linsword13:json-util
Open

Get rid of Ramble's dependency on spack_json#1648
linsword13 wants to merge 1 commit into
GoogleCloudPlatform:developfrom
linsword13:json-util

Conversation

@linsword13

Copy link
Copy Markdown
Member

Instead, implement thin helpers under ramble.util.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request replaces the vendored spack.util.spack_json dependency with a new internal ramble.util.json_util module across the codebase, updating all references, adding unit tests, and enforcing this change via Ruff in pyproject.toml. Feedback suggests explicitly typing dump_args as Dict[str, Any] in json_util.py to improve type safety and remove the need for # type: ignore comments.

Comment thread lib/ramble/ramble/util/json_util.py Outdated
Instead, implement thin helpers under ramble.util.
@linsword13

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request replaces the dependency on spack.util.spack_json with a new internal utility ramble.util.json_util across the codebase, enforcing this restriction via pyproject.toml. However, the new utility lacks a custom serialization handler for types like set, Enum, and objects with to_dict methods, which were previously supported by spack_json. This regression could lead to runtime serialization errors and non-deterministic hashing. It is recommended to implement a custom default handler in json_util and add corresponding unit tests to verify correct behavior.

Comment thread lib/ramble/ramble/util/json_util.py
Comment thread lib/ramble/ramble/test/util/json_util.py
@ramble-pr-bot

ramble-pr-bot Bot commented Jul 1, 2026

Copy link
Copy Markdown

Ramble Performance Test Metrics

Results produced with commit: fbe9cb4

Test Name Outcome Duration (s) Most Recent Run (s) Last 5 Avg (s)
test_analyze_large_file passed 2.9109 2.9405 (1ebc534) 2.9284
test_large_template_expansion passed 2.1264 2.1471 (1ebc534) 2.1558
test_many_experiments passed 37.5218 36.5583 (1ebc534) 37.7597
test_many_objects_defaults passed 20.3769 19.4925 (1ebc534) 20.1742
test_matrix_filter_perf passed 1.6112 1.5775 (1ebc534) 1.6123

@linsword13 linsword13 marked this pull request as draft July 1, 2026 18:36
@linsword13 linsword13 marked this pull request as ready for review July 1, 2026 18:50
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.58974% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.30%. Comparing base (1ebc534) to head (fbe9cb4).

Files with missing lines Patch % Lines
lib/ramble/ramble/mirror.py 20.00% 4 Missing ⚠️
lib/ramble/ramble/repository.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1648   +/-   ##
========================================
  Coverage    93.30%   93.30%           
========================================
  Files          352      354    +2     
  Lines        34223    34256   +33     
========================================
+ Hits         31931    31964   +33     
  Misses        2292     2292           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant