Skip to content

Ensure model name does not override machine type - #1719

Open
linsword13 wants to merge 2 commits into
GoogleCloudPlatform:developfrom
linsword13:upload-metadata
Open

Ensure model name does not override machine type#1719
linsword13 wants to merge 2 commits into
GoogleCloudPlatform:developfrom
linsword13:upload-metadata

Conversation

@linsword13

Copy link
Copy Markdown
Member

No description provided.

@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 refactors the determine_node_type function to ensure that "machine-type" is prioritized over "Model name" regardless of their order in the contexts, and adds corresponding unit tests. The feedback suggests adding a defensive guard contexts or [] to prevent potential TypeError exceptions if contexts is None, and refactoring the unit tests using pytest.mark.parametrize to reduce redundancy and improve readability.

Comment thread lib/ramble/ramble/uploader.py
Comment thread lib/ramble/ramble/test/uploader.py Outdated
@ramble-pr-bot

ramble-pr-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

Ramble Performance Test Metrics

Results produced with commit: 3295ec9

Test Name Outcome Duration (s) Most Recent Run (s) Last 5 Avg (s)
test_analyze_large_file passed 2.2208 2.1005 (de4ccce) 2.0984
test_large_template_expansion passed 1.8401 1.6327 (de4ccce) 1.6532
test_many_experiments passed 28.2539 24.6595 (de4ccce) 25.4157
test_many_objects_defaults passed 14.2418 14.4773 (de4ccce) 14.4945
test_matrix_filter_perf passed 1.2399 1.1632 (de4ccce) 1.1704

@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.49%. Comparing base (de4ccce) to head (3295ec9).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1719      +/-   ##
===========================================
+ Coverage    93.48%   93.49%   +0.01%     
===========================================
  Files          367      367              
  Lines        35916    35922       +6     
===========================================
+ Hits         33575    33586      +11     
+ Misses        2341     2336       -5     

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

experiment.node_type = fom["value"]
continue
return
elif "Model name" in fom["name"] and node_type == default_node_type_val:

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.

Does machine-type and Model name only come from modifiers like lscpu and gcp-metadata? If so, is there anything special or protected about these names? Does that mean if those modifiers are changed for some reason this code would break?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah this is currently only a best-effort for getting the machine type.

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