Skip to content

USHIFT-7173: Add close-stale-bugs command to the MicroShift CI Doctor flow#80143

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
ggiguash:ci-doctor-close-stale-bugs
Jun 5, 2026
Merged

USHIFT-7173: Add close-stale-bugs command to the MicroShift CI Doctor flow#80143
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
ggiguash:ci-doctor-close-stale-bugs

Conversation

@ggiguash

@ggiguash ggiguash commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Blocked on openshift-eng/edge-tooling#176 (merged)

Test Job Results

Summary by CodeRabbit

This PR introduces a new close-stale-bugs command to the MicroShift CI Doctor automated workflow, which is part of the OpenShift CI infrastructure's downstream edge-tooling system.

Changes Made

Configuration File (ci-operator/config/openshift-eng/edge-tooling/openshift-eng-edge-tooling-main.yaml):

  • Adds a new CI test definition for the openshift-eng/edge-tooling repository
  • Configures the microshift-ci-doctor periodic job to run twice daily (8 AM and 2 PM UTC) on weekdays
  • Updates the job's Slack reporter template to include a new report-close-stale-bugs.txt artifact link alongside existing bug creation (+), bug fixing (-), and PR artifacts, displayed as "Bugs(-)" in the notification

Doctor Script (ci-operator/step-registry/openshift/edge-tooling/microshift-ci/doctor/openshift-edge-tooling-microshift-ci-doctor-commands.sh):

  • Adds a dedicated log file definition for the close-stale-bugs Claude session
  • Integrates a new Claude AI invocation step that runs the microshift-ci:close-stale-bugs --close command with a 10-minute timeout and 20 max turns
  • Inserts this step into the workflow sequence between the initial CI analysis and the test bug fix step
  • Adds validation logic to ensure the close-stale-bugs session completes successfully alongside other doctor sessions

Context

The MicroShift CI Doctor is an automated CI maintenance tool that uses Claude AI to analyze CI failures, manage related bugs, and maintain test infrastructure. The new close-stale-bugs command allows the system to automatically close bugs that are no longer relevant, improving the signal-to-noise ratio in bug tracking.

Note: This PR is blocked on openshift-eng/edge-tooling#176 and targets version 5.0.0 per the referenced Jira issue USHIFT-7173.

@openshift-ci

openshift-ci Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

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-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 5, 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 Jun 5, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

@ggiguash: This pull request references USHIFT-7173 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 "5.0.0" version, but no target version was set.

Details

In response to this:

Blocked on openshift-eng/edge-tooling#176

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 5, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

The PR extends the microshift-ci-doctor job with automated stale-bug closure by introducing a new Claude invocation step. The script now defines a dedicated log file path for this step, integrates it into exit-time artifact/completion checks, and adds the main invocation that runs a close-stale-bugs plugin. The report template is simultaneously refactored to compute and link artifact URLs in a consolidated Markdown row.

Changes

Close stale bugs feature

Layer / File(s) Summary
Log file path and exit-time integration
ci-operator/step-registry/openshift/edge-tooling/microshift-ci/doctor/openshift-edge-tooling-microshift-ci-doctor-commands.sh
Script defines CLAUDE_CLOSE_STALE_BUGS_LOG variable and extends the atexit-time log verification loop to include that log, ensuring missing or failed stale-bug sessions are detected alongside other Claude steps.
Close stale bugs Claude invocation
ci-operator/step-registry/openshift/edge-tooling/microshift-ci/doctor/openshift-edge-tooling-microshift-ci-doctor-commands.sh
New main-script block executes Claude with the microshift-ci:close-stale-bugs --close plugin, model/max-turns parameters, and timeout; output is teed to the log file and success is validated via check_claude_rc before subsequent steps continue.
Report template artifact linking
ci-operator/config/openshift-eng/edge-tooling/openshift-eng-edge-tooling-main.yaml
Report template refactored from helper-template and range-based assembly to inline printf variables that compute artifact URLs (report, bugs(+), bugs(-), PRs) and emit a single Markdown table row linking those artifacts plus job logs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • openshift/release#80055: Modifies the same microshift-ci-doctor report template in openshift-eng-edge-tooling-main.yaml to change how artifact links are formatted in the Markdown table row.
  • openshift/release#77676: Restructures the Claude doctor exit handler and artifact/report/log archiving behavior, directly aligned with the stale-bug log tracking and exit-time integration added here.

Suggested reviewers

  • agullon
  • jerpeter1
  • vanhalenar
🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding a close-stale-bugs command to the MicroShift CI Doctor flow, which matches the core modifications across both changed files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 YAML config, shell script, and adds standard Go tests—no Ginkgo test files present, so the Ginkgo test naming check does not apply.
Test Structure And Quality ✅ Passed The PR modifies only a YAML CI config file and a shell script file. No Ginkgo test code is present or modified. The custom check for "Test Structure and Quality" is not applicable to these file types.
Microshift Test Compatibility ✅ Passed PR makes only CI/CD configuration and bash script changes; no Ginkgo e2e tests are added or modified, so the MicroShift test compatibility check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR does not add new Ginkgo e2e tests. Changes are to CI configuration YAML and shell scripts only; modified Go files contain no Ginkgo test patterns.
Topology-Aware Scheduling Compatibility ✅ Passed This PR only modifies CI/CD configuration and automation scripts for edge-tooling tests. No Kubernetes manifests, operator code, controllers, or scheduling constraints are introduced or modified.
Ote Binary Stdout Contract ✅ Passed PR modifies YAML CI config and bash shell script only; no Go source code with OTE binary definitions present, so OTE Binary Stdout Contract check is not applicable.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR does not add any Ginkgo e2e tests. Changes are to CI configuration (YAML) and shell scripts for CI automation, not test code.
No-Weak-Crypto ✅ Passed No weak cryptography, custom crypto implementations, or insecure secret comparisons found. Changes are CI/CD config and bash script orchestration only.
Container-Privileges ✅ Passed PR changes contain no container security issues. YAML test config and shell script additions lack privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or allowPrivilegeEscalation settings.
No-Sensitive-Data-In-Logs ✅ Passed No sensitive data (passwords, tokens, PII, session IDs, credentials) is logged. Credentials are loaded with tracing disabled and passed as environment variables, not CLI arguments.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 5, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@ggiguash: 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-eng-edge-tooling-main-microshift-ci-doctor N/A periodic Ci-operator config changed

Prior to this PR being merged, you will need to either run and acknowledge or opt to skip these rehearsals.

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.

@ggiguash

ggiguash commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-eng-edge-tooling-main-microshift-ci-doctor

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

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

@ggiguash

ggiguash commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-eng-edge-tooling-main-microshift-ci-doctor

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

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

@ggiguash ggiguash marked this pull request as ready for review June 5, 2026 14:39
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 5, 2026
@openshift-ci openshift-ci Bot requested review from eslutsky and kasturinarra June 5, 2026 14:40
@openshift-ci

openshift-ci Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

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

@eggfoobar

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 5, 2026
@openshift-ci

openshift-ci Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: eggfoobar, ggiguash

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

@eggfoobar

Copy link
Copy Markdown
Contributor

/pj-rehearse ack

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@eggfoobar: 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 5, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit 7c1eb68 into openshift:main Jun 5, 2026
19 checks passed
@ggiguash ggiguash deleted the ci-doctor-close-stale-bugs branch June 9, 2026 05:04
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