Skip to content

Commit 56904d0

Browse files
CopilotCrow-Control
andcommitted
feat(common): Auto-generate complete-values-structure.yaml with objectname normalization (#44955)
Adds automated generation of `complete-values-structure.yaml` that aggregates all chart configurations into a normalized reference structure using placeholder values and `objectname` for variable-keyed nested objects. ## Implementation **Script:** `generate_complete_values_structure.py` - Collects 841+ values.yaml files from stable/incubator charts and common-test - Merges into comprehensive structure showing all possible configuration keys - Preserves existing comments via ruamel.yaml (falls back to PyYAML with warning) - Applies normalization post-merge **Normalization:** - Variable-named keys → `objectname` placeholder - String values → `""` - Large numbers → `0` (preserves 0-100 as likely config values) - Booleans → unchanged - Lists → first element only (structure example) **Parent keys with variable children:** ```python PARENT_KEYS_WITH_VARIABLE_CHILDREN = { 'workload', 'service', 'persistence', 'configmap', 'secret', 'ingress', 'route', 'containers', 'initContainers', 'ports', 'hosts' } ``` ## Result File reduced from 14k to 6.5k lines. Example structure: ```yaml workload: objectname: # replaces: main, backup, worker, etc. enabled: true type: '' podSpec: containers: objectname: # replaces: main, sidecar, init, etc. enabled: true imageSelector: '' service: objectname: # replaces: main, api, metrics, etc. enabled: true ports: objectname: # replaces: main, http, grpc, etc. port: 0 protocol: '' ``` ## Workflow Integration Added to schema-validation job in `.github/workflows/common-tests.yaml`: - Installs `ruamel.yaml` alongside PyYAML - Runs before `test_schema.py` - Comments persist across regenerations <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/trueforge-org/truecharts/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: PrivatePuffin <7613738+PrivatePuffin@users.noreply.github.com>
1 parent 4478685 commit 56904d0

File tree

3 files changed

+6734
-1750
lines changed

3 files changed

+6734
-1750
lines changed

.github/workflows/common-tests.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@ jobs:
156156
with:
157157
python-version: "3.10"
158158

159+
- name: Install Python dependencies
160+
run: pip install PyYAML ruamel.yaml
161+
162+
- name: Generate complete values structure
163+
run: |
164+
python3 charts/library/common/generate_complete_values_structure.py
165+
159166
- name: Run schema validation
160167
run: |
161168
python3 charts/library/common/test_schema.py --max-failures 0 --output-file stable_schema_validation.log

0 commit comments

Comments
 (0)