Skip to content

Commit 13d8bc6

Browse files
authored
remove trailing commas and set consistent yaml width (#210)
# Summary This pull request includes updates to improve YAML file handling and fixes a minor issue in the `update_standalone` function. The most important changes are grouped below: ### YAML Handling Improvements: * [`scripts/evergreen/release/helm_files_handler.py`](diffhunk://#diff-3e4bf7eb043336f19b2029c2f2b0c2d3497902c0b116255fc99fe6467ae1e453R81): Added a new configuration to set the YAML line width to 4096 in the `update_standalone_installer` function to prevent inconsistent line wrapping in the CI and locally ### Bug Fix in Function Logic: * [`scripts/evergreen/release/update_helm_values_files.py`](diffhunk://#diff-362db66ba4c033cb3e6d12456bb89ac5782882ffc6f393e8f7d8d36b69aee0ffL60-R62): Fixed the `update_standalone` function by removing trailing commas, which were causing unintended behavior when calling the `update_standalone_installer` function multiple times. ## Proof of Work - consistent yaml formatting for linter (passing unit test variant) ## Checklist - [x] Have you linked a jira ticket and/or is the ticket in the title? - [x] Have you checked whether your jira ticket required DOCSP changes? - [ ] Have you checked for release_note changes? ## Reminder (Please remove this when merging) - Please try to Approve or Reject Changes the PR, keep PRs in review as short as possible - Our Short Guide for PRs: [Link](https://docs.google.com/document/d/1T93KUtdvONq43vfTfUt8l92uo4e4SEEvFbIEKOxGr44/edit?tab=t.0) - Remember the following Communication Standards - use comment prefixes for clarity: * **blocking**: Must be addressed before approval. * **follow-up**: Can be addressed in a later PR or ticket. * **q**: Clarifying question. * **nit**: Non-blocking suggestions. * **note**: Side-note, non-actionable. Example: Praise * --> no prefix is considered a question
1 parent a9fce45 commit 13d8bc6

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

scripts/evergreen/release/helm_files_handler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def update_standalone_installer(yaml_file_path: str, version: str):
7878
yaml.explicit_start = True # Ensure explicit `---` in the output
7979
yaml.indent(mapping=2, sequence=4, offset=2) # Align with tab width produced by Helm
8080
yaml.preserve_quotes = True # Preserve original quotes in the YAML file
81+
yaml.width = 4096 # Set a very large line width to prevent inconsistent line wrapping
8182

8283
with open(yaml_file_path, "r") as fd:
8384
data = list(yaml.load_all(fd)) # Convert the generator to a list

scripts/evergreen/release/update_helm_values_files.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,13 @@ def main() -> int:
5757

5858

5959
def update_standalone(operator_version):
60-
update_standalone_installer("public/mongodb-kubernetes.yaml", operator_version),
61-
update_standalone_installer("public/mongodb-kubernetes-openshift.yaml", operator_version),
62-
update_standalone_installer("public/mongodb-kubernetes-multi-cluster.yaml", operator_version),
60+
file_paths = [
61+
"public/mongodb-kubernetes.yaml",
62+
"public/mongodb-kubernetes-openshift.yaml",
63+
"public/mongodb-kubernetes-multi-cluster.yaml",
64+
]
65+
for file_path in file_paths:
66+
update_standalone_installer(file_path, operator_version)
6367

6468

6569
def update_helm_charts(operator_version, release):

0 commit comments

Comments
 (0)