Skip to content

Commit ccdb845

Browse files
authored
Release candidate: v1.74.0 (#4925)
2 parents 526b97e + 9e324e7 commit ccdb845

161 files changed

Lines changed: 3319 additions & 558 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gemini/config.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright 2025 "Google LLC"
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
have_fun: false
16+
code_review:
17+
disable: false
18+
comment_severity_threshold: MEDIUM
19+
max_review_comments: -1
20+
pull_request_opened:
21+
help: false
22+
summary: true
23+
code_review: true
24+
include_drafts: true
25+
ignore_patterns: []

.gemini/styleguide.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Cluster Toolkit - Code Review Style Guide for Gemini
2+
3+
When reviewing Pull Requests for the Google Cloud Cluster Toolkit, please adopt the persona of an expert Software Engineer. Your primary focus should be on ensuring changes enhance the project's long-term health. Prioritize the following:
4+
5+
* **Technical Excellence:** Ensure code is well-structured, efficient, and follows best practices.
6+
* **Maintainability:** Code should be easy to understand, modify, and extend.
7+
* **Testing:** Changes must be well-tested. Encourage comprehensive unit and integration tests.
8+
* **Documentation:** Ensure documentation is updated, including in-code comments, module READMEs, and index files.
9+
10+
Pay close attention to the following specifics:
11+
12+
1. **Blueprint Authoring (YAML):**
13+
* Ensure the `use` block is preferred for module dependencies within blueprints. Explicit variable linking (e.g., `setting = $(module.output)`) should only be used when necessary to resolve ambiguity.
14+
* Verify that module sources are correct and the referenced modules exist.
15+
* Check for logical grouping of modules within `deployment_groups`.
16+
* Ensure variable usage is correct (e.g., `$(vars.name)`, `$(module.id.output)`).
17+
* Validate the overall structure and syntax of the YAML blueprint.
18+
19+
2. **Terraform Module Development (HCL):**
20+
* Verify module inputs and outputs are consistent and well-defined.
21+
* Check for clear variable definitions in `variables.tf` with descriptions, types, and sensible defaults where applicable.
22+
* Ensure resources within the module are logically structured.
23+
* Encourage the use of best practices for writing clean and maintainable Terraform code.
24+
* Ensure new modules are placed in the correct directory (`modules/` or `community/modules/`) and within the appropriate subdirectory (e.g., `compute`, `network`, `file-system`, `scheduler`, etc.).
25+
26+
3. **Go Language:**
27+
* Follow standard Go idioms and best practices (e.g., error handling, naming).
28+
* Ensure code is well-commented, especially public functions and complex logic.
29+
* Check for test coverage for new or modified Go code.
30+
31+
4. **Documentation:**
32+
* **CRITICAL:** If new modules (core or community) are added, ensure they are added to the index in `modules/README.md`.
33+
* **CRITICAL:** If new examples (core or community) are added, ensure they are added to the index in `examples/README.md`.
34+
* In-code comments should be clear and explain the *why* not just the *what*.
35+
* Module `README.md` files should be clear and provide sufficient information on usage, inputs, and outputs.
36+
37+
5. **Testing:**
38+
* New features or bug fixes should ideally be accompanied by tests.
39+
* Tests should be clear and cover both happy paths and edge cases.
40+
* Encourage the use of the existing testing frameworks and patterns within the project.
41+
42+
6. **PR Description:**
43+
* The PR description should clearly explain the purpose of the change and the problem it solves.
44+
* It should mention how the changes were tested.
45+
46+
7. **Structure:**
47+
* Confirm adherence to the project structure (e.g., core vs. community).
48+
49+
By focusing on these areas, you can help maintain the quality and consistency of the Cluster Toolkit codebase.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Copyright 2025 "Google LLC"
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Check PR Description
16+
on:
17+
pull_request:
18+
types:
19+
- opened
20+
- edited
21+
- synchronize
22+
jobs:
23+
check-description:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
- name: Check PR description
29+
env:
30+
PR_BODY: ${{ github.event.pull_request.body }}
31+
run: |
32+
TEMPLATE_PATH=".github/pull_request_template.md"
33+
34+
if [ -f "$TEMPLATE_PATH" ]; then
35+
TEMPLATE_BODY=$(cat "$TEMPLATE_PATH")
36+
else
37+
TEMPLATE_BODY=""
38+
fi
39+
40+
# Function to normalize text: removes empty lines, trims leading/trailing whitespace, and removes carriage returns
41+
normalize_text() {
42+
echo -n "$1" | tr -d '\r' | awk 'NF' | awk '{$1=$1};1'
43+
}
44+
45+
# 1. Check if the PR body is empty or contains only whitespace
46+
if [ -z "$(echo "$PR_BODY" | tr -d '[:space:]')" ]; then
47+
echo "Error: PR description is empty or contains only whitespace."
48+
exit 1
49+
fi
50+
51+
# 2. Check if the PR body is identical to the template
52+
NORMALIZED_PR_BODY=$(normalize_text "$PR_BODY")
53+
NORMALIZED_TEMPLATE_BODY=$(normalize_text "$TEMPLATE_BODY")
54+
55+
if [[ "$NORMALIZED_PR_BODY" == "$NORMALIZED_TEMPLATE_BODY" ]]; then
56+
echo "Error: PR description only contains the template text. Please add a description of your changes."
57+
exit 1
58+
fi
59+
60+
# 3. Check if at least 10 characters have been added to the description
61+
# Use `diff` to isolate the added lines between the template and the PR body.
62+
ADDED_TEXT=$(diff --changed-group-format="%>" --unchanged-group-format="" <(echo "$NORMALIZED_TEMPLATE_BODY") <(echo "$NORMALIZED_PR_BODY") || true)
63+
ADDED_TEXT_LEN=${#ADDED_TEXT}
64+
65+
if [[ "$ADDED_TEXT_LEN" -lt 10 ]]; then
66+
echo "Error: PR description must contain at least 10 added characters."
67+
exit 1
68+
fi
69+
70+
echo "PR description check passed."

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ repos:
7474
files: 'tools/cloud-build/daily-tests/builds/.*\.yaml'
7575
pass_filenames: false
7676
require_serial: true
77+
- id: validate-daily-test-builds
78+
name: validate-daily-test-builds
79+
entry: tools/cloud-build/daily-tests/validate_daily_test_builds.py
80+
language: python
81+
language_version: python3
82+
additional_dependencies: ['pyyaml']
83+
files: 'tools/cloud-build/daily-tests/builds/.*\.(yaml|yml)'
84+
pass_filenames: true
85+
require_serial: true
7786
- id: pytest-check
7887
name: pytest-check
7988
entry: python -m pytest

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ install-dev-deps: warn-terraform-version warn-packer-version check-pre-commit ch
7373
go install honnef.co/go/tools/cmd/staticcheck@latest
7474
pip install -r community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/scripts/requirements.txt
7575
pip install -r community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/scripts/requirements-dev.txt
76-
pip install mypy
76+
pip install mypy==1.18.2
7777

7878

7979
clean:

0 commit comments

Comments
 (0)