[Deps-Test] Deep-merge injected ExtraChefAttributes with the cluster config's existing ones - #7459
Merged
Merged
Conversation
…config's existing ones A test feature (e.g. gb200) may already set DevSettings.Cookbook.ExtraChefAttributes on the cluster config. The previous 'inject only if absent' guard then skipped our attributes entirely( ExtraChefAttributes (python-version,nvidia, etc.) via --extra-chef-attributes), so cluster init used the cookbook default python and failed with 'Errno::ENOENT: .../pyenv/versions/3.14.2/.../python' (the AMI carries the upgraded python). Deep-merge instead: parse the existing JSON string, recursively merge our injected attributes under it, and re-serialize. The two dicts share branch keys (cluster, cluster.nvidia) but disjoint children, so a shallow merge would drop one subtree; recursion preserves both. Test-specific attributes win on leaf conflicts (existing passed as the override arg).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #7459 +/- ##
========================================
Coverage 89.91% 89.92%
========================================
Files 180 180
Lines 16200 16226 +26
========================================
+ Hits 14567 14592 +25
- Misses 1633 1634 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
hanwen-cluster
approved these changes
Jun 29, 2026
himani2411
enabled auto-merge (rebase)
June 29, 2026 15:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
A test feature (e.g. gb200) may
already set DevSettings.Cookbook.ExtraChefAttributes on the cluster config. The
previous 'inject only if absent' guard then skipped our attributes entirely(
ExtraChefAttributes (python-version,nvidia, etc.) via --extra-chef-attributes), so
cluster init used the cookbook default python and failed with
'Errno::ENOENT: .../pyenv/versions/3.14.2/.../python' (the AMI carries the
upgraded python).
Deep-merge instead: parse the existing JSON string, recursively merge our injected attributes under it, and re-serialize. The two dicts share branch keys (cluster, cluster.nvidia) but disjoint children, so a shallow merge would drop one subtree; recursion preserves both. Test-specific attributes win on leaf conflicts (existing passed as the override arg).
Tests
References
Checklist
developadd the branch name as prefix in the PR title (e.g.[release-3.6]).Please review the guidelines for contributing and Pull Request Instructions.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.