DNM/TEST: OTE: Improve downstream sync PR diagnostics#80164
Conversation
Enhancements to the downstream sync automation to provide better diagnostics when issues occur: 1. Merge Conflict Reporting: - Capture conflicted files when merge fails - Add conflict details to PR description with expandable sections - Skip go mod tidy and test sync when conflicts exist 2. Enhanced PR Handling: - Mark PRs as draft when conflicts or failures occur - Update PR title with failure types - Add /hold comment with resolution steps - Include all diagnostic info in PR body for easier triage 3. JSON Escaping Fix: - Use jq to properly build JSON payloads for API calls - Prevents issues with special characters in titles/bodies Signed-off-by: Jamo Luhrsen <jluhrsen@gmail.com> Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
/pj-rehearse |
|
@jluhrsen: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis PR updates the downstream-sync script to capture conflicted file names and set ChangesMerge-conflict handling and GitHub API integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels: Suggested reviewers:
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jluhrsen The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
ci-operator/step-registry/github/downstream-sync/github-downstream-sync-commands.sh (1)
221-224:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winLiteral
\nstrings won't render as line breaks in the GitHub comment.Using
\nin bash string concatenation produces literal backslash-n characters. When passed tojq --arg, these become\\nin the JSON output, causing GitHub to display\nliterally instead of line breaks.This is inconsistent with lines 238-240 which correctly use
$'\n'for actual newlines.🐛 Proposed fix using actual newlines
HOLD_REASON="/hold" for step in "${STEPS[@]}"; do - HOLD_REASON="${HOLD_REASON}\n${step}" + HOLD_REASON="${HOLD_REASON}"$'\n'"${step}" done🤖 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 `@ci-operator/step-registry/github/downstream-sync/github-downstream-sync-commands.sh` around lines 221 - 224, The HOLD_REASON string is being concatenated with literal "\n" so GitHub shows backslash-n instead of real newlines; update the concatenation in the for loop that builds HOLD_REASON (the variable and loop iterating over STEPS) to use an actual newline (e.g., $'\n' or printf with a newline) when appending each step so the value passed to jq/--arg contains real newline characters like the later block at lines 238-240.
🤖 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.
Outside diff comments:
In
`@ci-operator/step-registry/github/downstream-sync/github-downstream-sync-commands.sh`:
- Around line 221-224: The HOLD_REASON string is being concatenated with literal
"\n" so GitHub shows backslash-n instead of real newlines; update the
concatenation in the for loop that builds HOLD_REASON (the variable and loop
iterating over STEPS) to use an actual newline (e.g., $'\n' or printf with a
newline) when appending each step so the value passed to jq/--arg contains real
newline characters like the later block at lines 238-240.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: dcd76fc4-f5df-43ee-9830-8e4214cd479f
📒 Files selected for processing (1)
ci-operator/step-registry/github/downstream-sync/github-downstream-sync-commands.sh
Use bash $'\n' syntax to create actual newlines instead of literal \n characters in the PR hold comment body. Signed-off-by: Jamo Luhrsen <jluhrsen@gmail.com>
|
/pj-rehearse |
|
@jluhrsen: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
|
[REHEARSALNOTIFIER]
Interacting with pj-rehearseComment: Once you are satisfied with the results of the rehearsals, comment: |
|
/pj-rehearse |
|
@jluhrsen: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
|
@jluhrsen: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Enhancements to the downstream sync automation to provide better diagnostics when issues occur:
Merge Conflict Reporting:
Enhanced PR Handling:
JSON Escaping Fix:
Summary by CodeRabbit
This PR updates the downstream-sync step in the OpenShift CI configuration (ci-operator step-registry for github/downstream-sync) to provide richer diagnostics and safer failure handling when syncing changes into downstream repositories.
Practical effects and affected area
Key changes
Merge conflict capture and reporting
PR handling and operator-visible signals
Robust JSON construction for API calls
Why it matters
Files touched (high level)
This change improves observability and safety of automated downstream syncs used by OpenShift CI.