Skip to content

TRT-2664: Fix PR title truncation, trigger CodeRabbit review on new PRs#80311

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
smg247:jira-solve-title-coderabbit
Jun 9, 2026
Merged

TRT-2664: Fix PR title truncation, trigger CodeRabbit review on new PRs#80311
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
smg247:jira-solve-title-coderabbit

Conversation

@smg247

@smg247 smg247 commented Jun 9, 2026

Copy link
Copy Markdown
Member

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:

  • The PR creation step in ci-operator/step-registry/openshift/agentic/trt/jira-solver/openshift-agentic-trt-jira-solver-commands.sh now uses a much longer slice of the Jira issue summary for the GitHub PR title (it uses head -c 250 when building "--title" instead of the previous shorter truncation), ensuring more of the Jira summary appears in the PR title.
  • After creating the PR, the script now posts a comment of "@coderabbitai review" 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.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 9, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@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.

Details

In response to this:

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.

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.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

I'll go ahead and review this pull request.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@openshift-ci openshift-ci Bot requested review from dgoodwin and jupierce June 9, 2026 19:42
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 9, 2026
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

This is an automated warning from the Jira lifecycle plugin directed at @smg247. The warning indicates that Jira issue TRT-2664 does not have a target version set for the 5.0.0 version expected by the target branch. No action is required from CodeRabbit — @smg247 would need to update the target version on the Jira epic to resolve this warning.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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 @smg247 — the Jira epic for TRT-2664 needs a target version set to 5.0.0 to satisfy the branch requirement. No action is required from CodeRabbit on this.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This PR updates a Jira solver CI script to expand the PR title truncation to 250 characters and to post an automated @coderabbitai review comment on the created PR (errors suppressed).

Changes

Jira PR Creation Workflow Enhancement

Layer / File(s) Summary
PR title generation and CodeRabbit review comment
ci-operator/step-registry/openshift/agentic/trt/jira-solver/openshift-agentic-trt-jira-solver-commands.sh
The gh pr create title now uses head -c 250 for the ${JIRA_ISSUE_KEY}: ${ISSUE_SUMMARY} portion. After writing the PR number to ${SHARED_DIR}/pr-number, the script invokes gh pr comment to post @coderabbitai review and suppresses any errors from that command.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels: lgtm

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects both main changes: fixing PR title truncation (from 60 to 250 characters) and triggering CodeRabbit reviews on new PRs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PR modifies only a shell script for CI automation, containing no Ginkgo tests or test names. Check for stable/deterministic Ginkgo test names is not applicable.
Test Structure And Quality ✅ Passed The PR only modifies a bash shell script (openshift-agentic-trt-jira-solver-commands.sh), not Ginkgo test code. The custom check for Ginkgo test quality requirements is not applicable to this PR.
Microshift Test Compatibility ✅ Passed PR modifies only a bash CI/CD script (openshift-agentic-trt-jira-solver-commands.sh), not Ginkgo e2e tests. The check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR modifies only a bash script for CI automation and does not add any Ginkgo e2e tests, making the SNO test compatibility check inapplicable.
Topology-Aware Scheduling Compatibility ✅ Passed The PR only modifies a CI operational script (openshift-agentic-trt-jira-solver-commands.sh), not deployment manifests, operator code, or controllers. No scheduling constraints are introduced.
Ote Binary Stdout Contract ✅ Passed PR modifies shell scripts and configuration files only, not OTE binaries or test suites that communicate JSON to openshift-tests via stdout; check is not applicable.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR modifies a shell script (CI automation) with no Ginkgo e2e tests added. Check is not applicable.
No-Weak-Crypto ✅ Passed No weak cryptography, custom crypto implementations, or non-constant-time secret comparisons are present in the PR changes.
Container-Privileges ✅ Passed PR modifies only a bash CI/CD script; no K8s manifests contain privileged: true, hostPID/Network/IPC, SYS_ADMIN, or allowPrivilegeEscalation flags.
No-Sensitive-Data-In-Logs ✅ Passed PR changes use only non-sensitive data (Jira ticket IDs, issue summaries, PR numbers, repository names). No passwords, tokens, API keys, PII, or other sensitive data are logged.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between a3b6beb and c0fade0.

📒 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>
@smg247 smg247 force-pushed the jira-solve-title-coderabbit branch from c0fade0 to 5d5f59a Compare June 9, 2026 19:55
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@smg247: the pj-rehearse plugin accommodates running rehearsal tests for the changes in this PR. Expand 'Interacting with pj-rehearse' for usage details. The following rehearsable tests have been affected by this change:

Test name Repo Type Reason
periodic-ci-openshift-sippy-main-agentic-periodic-sippy-jira-agent N/A periodic Registry content changed
Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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 60 to head -c 250 successfully 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 for ISSUE_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

📥 Commits

Reviewing files that changed from the base of the PR and between c0fade0 and 5d5f59a.

📒 Files selected for processing (1)
  • ci-operator/step-registry/openshift/agentic/trt/jira-solver/openshift-agentic-trt-jira-solver-commands.sh

@neisw

neisw commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 9, 2026
@openshift-ci

openshift-ci Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@smg247

smg247 commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

/pj-rehearse skip

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@smg247: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-merge-bot openshift-merge-bot Bot added the rehearsals-ack Signifies that rehearsal jobs have been acknowledged label Jun 9, 2026
@openshift-ci

openshift-ci Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@smg247: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot Bot merged commit ea354df into openshift:main Jun 9, 2026
10 checks passed
@openshift-merge-bot openshift-merge-bot Bot deleted the jira-solve-title-coderabbit branch June 9, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. rehearsals-ack Signifies that rehearsal jobs have been acknowledged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants