TRT-2664: Fix PR title truncation, trigger CodeRabbit review on new PRs#80311
Conversation
|
@smg247: This pull request references TRT-2664 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
I'll go ahead and review this pull request. ✅ Action performedReview finished.
|
|
Tip For best results, initiate chat on the files or code changes. This is an automated warning from the Jira lifecycle plugin directed at |
|
Tip For best results, initiate chat on the files or code changes. This is a repeated automated warning from the Jira lifecycle plugin. As noted previously, this warning is directed at |
WalkthroughThis PR updates a Jira solver CI script to expand the PR title truncation to 250 characters and to post an automated ChangesJira PR Creation Workflow Enhancement
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels: 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 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
`@ci-operator/step-registry/openshift/agentic/trt/jira-solver/openshift-agentic-trt-jira-solver-commands.sh`:
- Line 100: When building the GitHub PR title for gh pr create, guard against
overflow by computing a combined title from JIRA_ISSUE_KEY and ISSUE_SUMMARY and
truncating ISSUE_SUMMARY as needed so the final string for the --title flag does
not exceed GitHub's 256-char limit; implement logic near the --title usage to
measure lengths of JIRA_ISSUE_KEY and the separator, cap ISSUE_SUMMARY to (256 -
len(JIRA_ISSUE_KEY) - len(separator) - 1) (use ~250 as a safe cap), append an
ellipsis ("…") when truncated, and pass that safe title to --title
"${JIRA_ISSUE_KEY}: ${TRUNCATED_ISSUE_SUMMARY}" so gh pr create never fails due
to title length.
🪄 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: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 4cbc7650-6018-424a-a976-f3a6d7082ee7
📒 Files selected for processing (1)
ci-operator/step-registry/openshift/agentic/trt/jira-solver/openshift-agentic-trt-jira-solver-commands.sh
Cap PR title at 250 chars to stay within GitHub's limit. Add @coderabbitai review comment after PR creation to trigger CodeRabbit since it doesn't auto-review fork PRs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
c0fade0 to
5d5f59a
Compare
|
[REHEARSALNOTIFIER]
Interacting with pj-rehearseComment: Once you are satisfied with the results of the rehearsals, comment: |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
ci-operator/step-registry/openshift/agentic/trt/jira-solver/openshift-agentic-trt-jira-solver-commands.sh (1)
100-100: PR title overflow prevented; consider adding ellipsis for truncated titles.The change from
head -c 60tohead -c 250successfully prevents GitHub's 256-character PR title limit from being exceeded, which addresses the critical concern from the past review. The job will no longer fail due to title overflow.The past review suggested a more sophisticated approach: measure the length of
JIRA_ISSUE_KEY, calculate remaining space forISSUE_SUMMARY, and append an ellipsis (…) when truncation occurs. While the current implementation is simpler and functional, adding an ellipsis would improve UX by clearly indicating truncation.♻️ Optional: Add ellipsis for truncated titles
# Smart truncation with ellipsis TITLE_PREFIX="${JIRA_ISSUE_KEY}: " MAX_LEN=250 if [[ ${`#TITLE_PREFIX`}${`#ISSUE_SUMMARY`} -gt ${MAX_LEN} ]]; then SUMMARY_MAX=$((MAX_LEN - ${`#TITLE_PREFIX`} - 1)) TRUNCATED_SUMMARY="${ISSUE_SUMMARY:0:${SUMMARY_MAX}}…" FINAL_TITLE="${TITLE_PREFIX}${TRUNCATED_SUMMARY}" else FINAL_TITLE="${TITLE_PREFIX}${ISSUE_SUMMARY}" fi PR_URL=$(gh pr create \ --repo "${UPSTREAM_REPO}" \ --head "${FORK_REPO%%/*}:${BRANCH_NAME}" \ --no-maintainer-edit \ --title "${FINAL_TITLE}" \ --body-file "${PR_BODY_FILE}" \ 2>&1) || {🤖 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/openshift/agentic/trt/jira-solver/openshift-agentic-trt-jira-solver-commands.sh` at line 100, The PR title currently uses head -c 250 which truncates ISSUE_SUMMARY silently; modify the script to compute TITLE_PREFIX="${JIRA_ISSUE_KEY}: ", set MAX_LEN=250, check combined length of TITLE_PREFIX and ISSUE_SUMMARY, and if it exceeds MAX_LEN calculate SUMMARY_MAX = MAX_LEN - length(TITLE_PREFIX) - 1 then create TRUNCATED_SUMMARY = ISSUE_SUMMARY[:SUMMARY_MAX] + "…" and set FINAL_TITLE = TITLE_PREFIX + TRUNCATED_SUMMARY, otherwise FINAL_TITLE = TITLE_PREFIX + ISSUE_SUMMARY; then pass FINAL_TITLE to the gh pr create --title argument (referencing variables JIRA_ISSUE_KEY, ISSUE_SUMMARY, FINAL_TITLE and the gh pr create invocation) so truncated titles include an ellipsis.
🤖 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.
Nitpick comments:
In
`@ci-operator/step-registry/openshift/agentic/trt/jira-solver/openshift-agentic-trt-jira-solver-commands.sh`:
- Line 100: The PR title currently uses head -c 250 which truncates
ISSUE_SUMMARY silently; modify the script to compute
TITLE_PREFIX="${JIRA_ISSUE_KEY}: ", set MAX_LEN=250, check combined length of
TITLE_PREFIX and ISSUE_SUMMARY, and if it exceeds MAX_LEN calculate SUMMARY_MAX
= MAX_LEN - length(TITLE_PREFIX) - 1 then create TRUNCATED_SUMMARY =
ISSUE_SUMMARY[:SUMMARY_MAX] + "…" and set FINAL_TITLE = TITLE_PREFIX +
TRUNCATED_SUMMARY, otherwise FINAL_TITLE = TITLE_PREFIX + ISSUE_SUMMARY; then
pass FINAL_TITLE to the gh pr create --title argument (referencing variables
JIRA_ISSUE_KEY, ISSUE_SUMMARY, FINAL_TITLE and the gh pr create invocation) so
truncated titles include an ellipsis.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 3f6a5ae0-a559-40a0-ac9f-167b52aeb47e
📒 Files selected for processing (1)
ci-operator/step-registry/openshift/agentic/trt/jira-solver/openshift-agentic-trt-jira-solver-commands.sh
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: neisw, smg247 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 |
|
/pj-rehearse skip |
|
@smg247: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
|
@smg247: all tests passed! 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. |
Remove head -c 60 truncation from PR title so the full Jira issue summary is used. Add @coderabbitai review comment after PR creation to trigger CodeRabbit since it doesn't auto-review fork PRs.
Summary by CodeRabbit
This change updates the TRT (Test Removal Tooling) Jira solver step used by OpenShift CI. In practical terms:
@coderabbitaireview" against the new PR (using gh pr comment) to trigger an automated CodeRabbit review for PRs created from forks; failures from that comment are suppressed so the workflow continues.These edits make PR titles more descriptive and ensure CodeRabbit reviews are invoked for forked PRs created by the TRT bot.