Use templates for defining coverage threshold in gotests#145
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughSwitched several Changesgotests template + sync mappings
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@workflows_examples/gotests.yaml`:
- Around line 11-14: The YAML linter fails because
workflows_examples/gotests.yaml contains Jinja templating and is processed by
the check-yaml hook; update the pre-commit configuration to exclude that
directory or move the templated examples out of lint scope: modify the
check-yaml hook in .pre-commit-config.yaml (the hook named check-yaml) to add an
exclude pattern matching workflows_examples/ (or add a specific exclude for
workflows_examples/gotests.yaml), or alternatively relocate the templated
file(s) so they are not covered by the check-yaml hook.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: bed79766-cdd5-4d38-aa7e-906d6562d477
📒 Files selected for processing (2)
.github/sync.ymlworkflows_examples/gotests.yaml
6f0056e to
874801b
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/sync.yml:
- Around line 8-9: The sync entries that map "source:
workflows_examples/gotests.yaml.tmpl" to various "dest:
.github/workflows/gotests.yaml" are missing the required template rendering
flag; for each occurrence of that mapping add "template: true" alongside the
source/dest pair so the BetaHuhn/repo-file-sync-action will render the Jinja2
before writing; update all ten entries that reference
workflows_examples/gotests.yaml.tmpl (the ones listed in the review) to include
template: true.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: 8c80a80b-8b55-4158-9d23-b73915ac54b1
📒 Files selected for processing (2)
.github/sync.ymlworkflows_examples/gotests.yaml.tmpl
✅ Files skipped from review due to trivial changes (1)
- workflows_examples/gotests.yaml.tmpl
| - source: workflows_examples/gotests.yaml.tmpl | ||
| dest: .github/workflows/gotests.yaml |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find the workflow(s) that consume sync.yml and identify the sync action used
rg -n "repo-file-sync\|sync-action\|BetaHuhn\|sync\.yml" --type yaml -A3 -B3
# Also check for any custom scripts that might pre-process .tmpl files
fd -e sh -e py | xargs rg -l "tmpl\|nunjucks\|jinja" 2>/dev/nullRepository: RedHatInsights/processing-tools
Length of output: 59
🏁 Script executed:
# Find all GitHub Actions workflows
find .github/workflows -name "*.yml" -o -name "*.yaml" 2>/dev/null | head -20Repository: RedHatInsights/processing-tools
Length of output: 457
🏁 Script executed:
# Search for any references to sync.yml or sync action in workflows
cat .github/workflows/*.yml .github/workflows/*.yaml 2>/dev/null | grep -E "sync|\.yml" -i -A2 -B2 | head -50Repository: RedHatInsights/processing-tools
Length of output: 734
🏁 Script executed:
# Check if there's documentation about sync configuration
find . -name "README*" -o -name "*.md" | xargs grep -l "sync\|workflow" 2>/dev/null | head -10Repository: RedHatInsights/processing-tools
Length of output: 185
🏁 Script executed:
# Read the sync.yml file to see all entries and their configuration
cat .github/sync.ymlRepository: RedHatInsights/processing-tools
Length of output: 7444
🏁 Script executed:
# Check the gotests.yaml.tmpl to see if it has template directives
cat workflows_examples/gotests.yaml.tmplRepository: RedHatInsights/processing-tools
Length of output: 443
🏁 Script executed:
# Check the workflows_examples README for context
cat workflows_examples/README.mdRepository: RedHatInsights/processing-tools
Length of output: 231
Add template: true to all 10 entries syncing gotests.yaml.tmpl.
The file workflows_examples/gotests.yaml.tmpl contains Jinja2 template directives ({% if coverage_threshold is defined %}, {{ coverage_threshold }}) that must be processed before deployment. The BetaHuhn/repo-file-sync-action requires an explicit template: true field to enable template rendering—the .tmpl file extension alone does not trigger processing.
Without template: true, the raw template syntax will be written verbatim to .github/workflows/gotests.yaml in all 10 target repositories, producing invalid YAML and breaking those GitHub Actions workflows.
Required fix: add template: true to each of these entries
- source: workflows_examples/gotests.yaml.tmpl
dest: .github/workflows/gotests.yaml
+ template: trueApply to all 10 affected repositories:
- ccx-notification-service (line 8)
- ccx-notification-writer (line 18)
- content-service (line 48)
- insights-operator-gathering-conditions-service (line 115)
- insights-operator-utils (line 125)
- insights-results-aggregator-cleaner (line 143)
- insights-results-aggregator-exporter (line 156)
- insights-results-aggregator-mock (line 166)
- insights-results-smart-proxy (line 189)
- parquet-factory (line 205)
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - source: workflows_examples/gotests.yaml.tmpl | |
| dest: .github/workflows/gotests.yaml | |
| - source: workflows_examples/gotests.yaml.tmpl | |
| dest: .github/workflows/gotests.yaml | |
| template: true |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/sync.yml around lines 8 - 9, The sync entries that map "source:
workflows_examples/gotests.yaml.tmpl" to various "dest:
.github/workflows/gotests.yaml" are missing the required template rendering
flag; for each occurrence of that mapping add "template: true" alongside the
source/dest pair so the BetaHuhn/repo-file-sync-action will render the Jinja2
before writing; update all ten entries that reference
workflows_examples/gotests.yaml.tmpl (the ones listed in the review) to include
template: true.
There was a problem hiding this comment.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
7ffcf3e to
adb7708
Compare
adb7708 to
de00f84
Compare
Description
Using templates for define the coverage threshold in some of the synced gotests.yaml files across repositories.
Type of change
Testing steps
To be tested in CI