-
Notifications
You must be signed in to change notification settings - Fork 0
Auto-update doc build config #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughTwo Kubernetes Build manifest files are added to define documentation building pipelines. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.builds/doc-pr-build.yaml (1)
1-41: Consider extracting shared workspace configuration to reduce cross-file duplication.Both
.builds/doc-build.yamland.builds/doc-pr-build.yamldefine identical workspace configurations (lines 8-21). This duplication creates maintenance burden if workspace specs need updates.If the project uses Kustomize or another templating mechanism, consider extracting the shared workspace spec to a common overlay or base configuration.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.builds/doc-build.yaml(1 hunks).builds/doc-pr-build.yaml(1 hunks)
🔇 Additional comments (2)
.builds/doc-pr-build.yaml (1)
34-41: Manual verification of Katanomi template configuration required.No public documentation exists for the Katanomi "ClusterTemplate resolver" configuration. Verification of whether the
product-docs-pr-pipelinetemplate is deployed and correctly configured requires:
- Direct inspection of the cluster resources
- Confirmation that the template exists at the specified resolver path
- Validation that the
doc-baseparameter value aligns with your documentation build requirements.builds/doc-build.yaml (1)
114-121: No issues found; template references are properly configured.The code correctly uses the
katanomi.dev.clustertemplateresolver pattern. Both.builds/doc-build.yamland.builds/doc-pr-build.yamluse distinct templates (product-docs-buildandproduct-docs-pr-pipelinerespectively) for their intended purposes (production and PR builds), both accepting thedoc-baseparameter consistently. The resolver configuration is syntactically valid and follows the Tekton/Katanomi ClusterTemplate pattern. Template deployment and cluster-level RBAC are infrastructure concerns outside the scope of repository code review.
| - pipelineTaskName: build-online-docs-io | ||
| stepOverrides: | ||
| - name: build | ||
| resources: | ||
| requests: | ||
| cpu: 2 | ||
| memory: 4Gi | ||
| limits: | ||
| cpu: 4 | ||
| memory: 8Gi | ||
| - pipelineTaskName: build-online-docs-cn | ||
| stepOverrides: | ||
| - name: build | ||
| resources: | ||
| requests: | ||
| cpu: 2 | ||
| memory: 4Gi | ||
| limits: | ||
| cpu: 4 | ||
| memory: 8Gi | ||
| - pipelineTaskName: build-offline-docs | ||
| stepOverrides: | ||
| - name: build | ||
| resources: | ||
| requests: | ||
| cpu: 2 | ||
| memory: 4Gi | ||
| limits: | ||
| cpu: 4 | ||
| memory: 8Gi | ||
| - pipelineTaskName: build-exports-docs | ||
| stepOverrides: | ||
| - name: build | ||
| resources: | ||
| requests: | ||
| cpu: 2 | ||
| memory: 4Gi | ||
| limits: | ||
| cpu: 4 | ||
| memory: 8Gi | ||
| - pipelineTaskName: export-docs | ||
| stepOverrides: | ||
| - name: export | ||
| resources: | ||
| requests: | ||
| cpu: 2 | ||
| memory: 4Gi | ||
| limits: | ||
| cpu: 4 | ||
| memory: 8Gi | ||
| - pipelineTaskName: build-online-docs-russian | ||
| stepOverrides: | ||
| - name: build | ||
| resources: | ||
| requests: | ||
| cpu: 2 | ||
| memory: 4Gi | ||
| limits: | ||
| cpu: 4 | ||
| memory: 8Gi | ||
| - pipelineTaskName: build-offline-docs-russian | ||
| stepOverrides: | ||
| - name: build | ||
| resources: | ||
| requests: | ||
| cpu: 2 | ||
| memory: 4Gi | ||
| limits: | ||
| cpu: 4 | ||
| memory: 8Gi | ||
| - pipelineTaskName: build-exports-docs-russian | ||
| stepOverrides: | ||
| - name: build | ||
| resources: | ||
| requests: | ||
| cpu: 2 | ||
| memory: 4Gi | ||
| limits: | ||
| cpu: 4 | ||
| memory: 8Gi | ||
| - pipelineTaskName: export-docs-russian | ||
| stepOverrides: | ||
| - name: export | ||
| resources: | ||
| requests: | ||
| cpu: 2 | ||
| memory: 4Gi | ||
| limits: | ||
| cpu: 4 | ||
| memory: 8Gi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
Significant code duplication in taskRunSpecs—consolidate with YAML anchors or templating.
The 9 taskRunSpecs entries (lines 23-112) are nearly identical, with only pipelineTaskName and step names varying. This duplication makes maintenance difficult and error-prone. Any future resource allocation change requires updating 9 locations.
Use YAML anchors (&) and aliases (*) to reduce repetition and improve maintainability.
Apply this refactor to consolidate the resource specifications:
+_default_step_override_build: &default_build
+ resources:
+ requests:
+ cpu: 2
+ memory: 4Gi
+ limits:
+ cpu: 4
+ memory: 8Gi
+
+_default_step_override_export: &default_export
+ resources:
+ requests:
+ cpu: 2
+ memory: 4Gi
+ limits:
+ cpu: 4
+ memory: 8Gi
+
taskRunSpecs:
- pipelineTaskName: build-online-docs-io
stepOverrides:
- - name: build
- resources:
- requests:
- cpu: 2
- memory: 4Gi
- limits:
- cpu: 4
- memory: 8Gi
+ - name: build
+ <<: *default_build
- pipelineTaskName: build-online-docs-cn
stepOverrides:
- - name: build
- resources:
- requests:
- cpu: 2
- memory: 4Gi
- limits:
- cpu: 4
- memory: 8Gi
+ - name: build
+ <<: *default_build
- pipelineTaskName: build-offline-docs
stepOverrides:
- - name: build
- resources:
- requests:
- cpu: 2
- memory: 4Gi
- limits:
- cpu: 4
- memory: 8Gi
+ - name: build
+ <<: *default_build
- pipelineTaskName: build-exports-docs
stepOverrides:
- - name: build
- resources:
- requests:
- cpu: 2
- memory: 4Gi
- limits:
- cpu: 4
- memory: 8Gi
+ - name: build
+ <<: *default_build
- pipelineTaskName: export-docs
stepOverrides:
- - name: export
- resources:
- requests:
- cpu: 2
- memory: 4Gi
- limits:
- cpu: 4
- memory: 8Gi
+ - name: export
+ <<: *default_export
- pipelineTaskName: build-online-docs-russian
stepOverrides:
- - name: build
- resources:
- requests:
- cpu: 2
- memory: 4Gi
- limits:
- cpu: 4
- memory: 8Gi
+ - name: build
+ <<: *default_build
- pipelineTaskName: build-offline-docs-russian
stepOverrides:
- - name: build
- resources:
- requests:
- cpu: 2
- memory: 4Gi
- limits:
- cpu: 4
- memory: 8Gi
+ - name: build
+ <<: *default_build
- pipelineTaskName: build-exports-docs-russian
stepOverrides:
- - name: build
- resources:
- requests:
- cpu: 2
- memory: 4Gi
- limits:
- cpu: 4
- memory: 8Gi
+ - name: build
+ <<: *default_build
- pipelineTaskName: export-docs-russian
stepOverrides:
- - name: export
- resources:
- requests:
- cpu: 2
- memory: 4Gi
- limits:
- cpu: 4
- memory: 8Gi
+ - name: export
+ <<: *default_exportCommittable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In .builds/doc-build.yaml around lines 23-112 there is duplicated taskRunSpecs
for nine pipelineTaskName entries that only differ by pipelineTaskName and the
step name; consolidate by extracting the common stepOverrides -> resources ->
requests/limits block into a YAML anchor (e.g., &defaultResources) and reference
it with aliases (*) in each taskRunSpec so each entry only declares
pipelineTaskName and the step name, keeping the aliased resources block; ensure
stepOverrides structure remains valid (use the alias at the step level or the
resources level as appropriate) and remove the repeated requests/limits from
each entry.
auto update doc build config for doc pipeline
Summary by CodeRabbit