Skip to content

CNTRLPLANE-2737: Add pre-commit quality review to jira-agent pipeline#74809

Draft
bryan-cox wants to merge 1 commit intoopenshift:mainfrom
bryan-cox:CNTRLPLANE-2737
Draft

CNTRLPLANE-2737: Add pre-commit quality review to jira-agent pipeline#74809
bryan-cox wants to merge 1 commit intoopenshift:mainfrom
bryan-cox:CNTRLPLANE-2737

Conversation

@bryan-cox
Copy link
Member

@bryan-cox bryan-cox commented Feb 12, 2026

Summary

  • Adds /code-review:pre-commit-quality-review from ai-helpers as a second Claude session in the jira-agent prow job
  • Restructures the pipeline into three phases: solve, review, then PR creation
  • PR creation is now handled by the shell script via gh pr create instead of by Claude during jira-solve

Changes

The jira-agent process step now runs a three-phase pipeline per issue:

Phase 1 - Solve: Runs /jira-solve to implement, commit, and push changes to the fork branch. The FORK_CONTEXT instructions now tell Claude to skip PR creation so the review can run first.

Phase 2 - Review: Runs /code-review:pre-commit-quality-review from ai-helpers in a clean Claude session. The review examines the diff against main using Go language and HyperShift profile skills, fixes any quality issues found, and pushes corrections to the same branch. If the skill is unavailable or the review fails, the pipeline continues gracefully.

Phase 3 - PR Creation: Creates a draft PR via gh pr create with a structured body referencing the Jira issue and listing all commits (including any review fixes).

Additional improvements:

  • Resets the repo to main between issues to ensure clean state when processing multiple issues per run
  • Skill loading is done once at startup, not per-issue

Jira

https://issues.redhat.com/browse/CNTRLPLANE-2737

Test plan

  • Verify the pre-commit-quality-review skill is loaded from ai-helpers at startup
  • Verify jira-solve runs without creating a PR (Phase 1)
  • Verify the review runs in a clean Claude session against the committed diff (Phase 2)
  • Verify the PR is created via gh CLI after review completes (Phase 3)
  • Verify graceful skip when pre-commit-quality-review skill is not found in ai-helpers
  • Verify graceful continuation when the review step fails
  • Verify no code changes case skips both review and PR creation

Always review AI generated responses prior to use.

🤖 Generated with Claude Code via /jira:solve [CNTRLPLANE-2737](https://issues.redhat.com//browse/CNTRLPLANE-2737)

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 12, 2026
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 12, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Feb 12, 2026

@bryan-cox: This pull request references CNTRLPLANE-2737 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 story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

  • Adds /code-review:pre-commit-quality-review from ai-helpers as a second Claude session in the jira-agent prow job
  • Restructures the pipeline into three phases: solve, review, then PR creation
  • PR creation is now handled by the shell script via gh pr create instead of by Claude during jira-solve

Changes

The jira-agent process step now runs a three-phase pipeline per issue:

Phase 1 - Solve: Runs /jira-solve to implement, commit, and push changes to the fork branch. The FORK_CONTEXT instructions now tell Claude to skip PR creation so the review can run first.

Phase 2 - Review: Runs /code-review:pre-commit-quality-review from ai-helpers in a clean Claude session. The review examines the diff against main using Go language and HyperShift profile skills, fixes any quality issues found, and pushes corrections to the same branch. If the skill is unavailable or the review fails, the pipeline continues gracefully.

Phase 3 - PR Creation: Creates a draft PR via gh pr create with a structured body referencing the Jira issue and listing all commits (including any review fixes).

Additional improvements:

  • Resets the repo to main between issues to ensure clean state when processing multiple issues per run
  • Skill loading is done once at startup, not per-issue

Jira

https://issues.redhat.com/browse/CNTRLPLANE-2737

Test plan

  • Verify the pre-commit-quality-review skill is loaded from ai-helpers at startup
  • Verify jira-solve runs without creating a PR (Phase 1)
  • Verify the review runs in a clean Claude session against the committed diff (Phase 2)
  • Verify the PR is created via gh CLI after review completes (Phase 3)
  • Verify graceful skip when pre-commit-quality-review skill is not found in ai-helpers
  • Verify graceful continuation when the review step fails
  • Verify no code changes case skips both review and PR creation

Always review AI generated responses prior to use.

🤖 Generated with Claude Code via /jira:solve [CNTRLPLANE-2737](https://issues.redhat.com//browse/CNTRLPLANE-2737)

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.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 12, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 12, 2026
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 12, 2026
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 12, 2026
@openshift-ci-robot openshift-ci-robot added the rehearsals-ack Signifies that rehearsal jobs have been acknowledged label Feb 12, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 12, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bryan-cox

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

@openshift-ci-robot openshift-ci-robot removed the rehearsals-ack Signifies that rehearsal jobs have been acknowledged label Feb 12, 2026
@bryan-cox
Copy link
Member Author

/pj-rehearse periodic-ci-openshift-hypershift-main-periodic-jira-agent

@openshift-ci-robot
Copy link
Contributor

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

@bryan-cox
Copy link
Member Author

/pj-rehearse periodic-ci-openshift-hypershift-main-periodic-jira-agent

@openshift-ci-robot
Copy link
Contributor

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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 12, 2026

@bryan-cox: 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.

The jira-agent process step now runs a three-phase pipeline per issue:

Phase 1 (Solve): Runs /jira-solve to implement, commit, and push
changes to the fork branch. PR creation is deferred to Phase 3 so
the review can run on the code before the PR exists.

Phase 2 (Review): Runs /code-review:pre-commit-quality-review from
ai-helpers in a clean Claude session. The review examines the diff
against main, fixes any quality issues, and pushes corrections to
the same branch. If the skill is unavailable or fails, the pipeline
continues to Phase 3.

Phase 3 (PR): Creates a draft PR via gh CLI with a structured body
referencing the Jira issue and listing commits.

Also resets the repo to main between issues to ensure clean state
when processing multiple issues per run.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci-robot
Copy link
Contributor

[REHEARSALNOTIFIER]
@bryan-cox: 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-hypershift-release-4.22-periodic-jira-agent N/A periodic Registry content changed
periodic-ci-openshift-hypershift-main-periodic-jira-agent N/A periodic Registry content changed
periodic-ci-openshift-hypershift-release-5.0-periodic-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.

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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants