Skip to content

Conversation

haoqing0110
Copy link
Member

@haoqing0110 haoqing0110 commented Oct 11, 2025

Summary

Related issue(s)

Fixes #open-cluster-management-io/ocm#1201

Summary by CodeRabbit

  • New Features
    • Added new progression reasons for manifest work: Applying, Completed, and Failed.
    • Provides more granular and readable status updates, improving visibility in status views and logs.
    • Enables clearer monitoring, filtering, and automation based on precise work states.

@openshift-ci openshift-ci bot requested review from deads2k and qiujian16 October 11, 2025 10:39
Copy link

coderabbitai bot commented Oct 11, 2025

Walkthrough

Adds three new exported progressing reason constants—Applying, Completed, and Failed—to work/v1 types, within the WorkManifestsComplete const group, expanding the set of manifest work status reasoning values.

Changes

Cohort / File(s) Summary of Changes
API constants update
`work/v1/types.go`
Added exported constants: `WorkProgressingReasonApplying = "Applying"`, `WorkProgressingReasonCompleted = "Completed"`, `WorkProgressingReasonFailed = "Failed"` within the `WorkManifestsComplete` const block.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

lgtm

Suggested reviewers

  • deads2k
  • mdelder

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description includes the required headings but the Summary section is left blank, so there is no explanation of the change, and the Related issue(s) section incorrectly references a full URL instead of the issue number. Both sections must be populated according to the repository template. Please add a concise description of the changes under the Summary heading and update the Related issue(s) section to reference the issue correctly, for example using “Fixes #1201.”
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly describes the main change by indicating the addition of new work progressing condition reasons and follows the repository’s convention by starting with the ✨ icon, making it concise and informative.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 48b7234 and c268023.

📒 Files selected for processing (1)
  • work/v1/types.go (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: unit
  • GitHub Check: verify

Comment on lines +520 to +525
// WorkProgressingReasonApplying indicates resources are being applied
WorkProgressingReasonApplying string = "Applying"
// WorkProgressingReasonCompleted indicates all resources are applied and available
WorkProgressingReasonCompleted string = "Completed"
// WorkProgressingReasonFailed indicates the work failed to apply
WorkProgressingReasonFailed string = "Failed"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Well-documented constants with clear semantic intent.

The three new progressing reason constants are well-named and clearly documented. The string values ("Applying", "Completed", "Failed") provide good semantic clarity for tracking work progression states.

However, verify the following:

  1. Ensure these constants are used in the codebase to avoid introducing dead code.
  2. Clarify the distinction between WorkProgressingReasonCompleted (line 523) and WorkComplete (line 509). While one is a reason value and the other is a condition type, the similar naming could cause confusion for API consumers.

Run the following script to verify usage of these new constants:


🏁 Script executed:

#!/bin/bash
# Description: Verify that the new progressing reason constants are used in the codebase

echo "Searching for WorkProgressingReasonApplying usage:"
rg -n "WorkProgressingReasonApplying" --type go

echo -e "\nSearching for WorkProgressingReasonCompleted usage:"
rg -n "WorkProgressingReasonCompleted" --type go

echo -e "\nSearching for WorkProgressingReasonFailed usage:"
rg -n "WorkProgressingReasonFailed" --type go

echo -e "\nSearching for raw string literals that might be using these reasons:"
rg -n '"(Applying|Completed|Failed)"' --type go -g '!**/types.go' -C 3

Length of output: 2377


Implement or remove unused progressing reasons
WorkProgressingReasonApplying, WorkProgressingReasonCompleted, and WorkProgressingReasonFailed (work/v1/types.go:520–525) have no references outside their own definitions. Wire them into the work status transitions where appropriate or remove to avoid dead code.

🤖 Prompt for AI Agents
In work/v1/types.go around lines 520–525, the three WorkProgressingReason*
constants are defined but unused; either remove them or wire them into the work
status transition logic. To fix: search the reconciler(s) and status update code
that set Work.Status/conditions for progressing/completed/failed and replace
hard-coded reason strings (or add missing reason values) to use these constants,
update any helper functions that construct Condition objects to reference
WorkProgressingReasonApplying, WorkProgressingReasonCompleted, and
WorkProgressingReasonFailed, and add/adjust unit tests to assert the correct
reason is set; alternatively, if these reasons are not needed, delete the unused
constants and any related dead code/comments. Ensure imports/compile and tests
pass after the change.

@qiujian16
Copy link
Member

/approve
/lgtm

Copy link
Contributor

openshift-ci bot commented Oct 13, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haoqing0110, qiujian16

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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-merge-bot openshift-merge-bot bot merged commit 6b4f26d into open-cluster-management-io:main Oct 13, 2025
12 checks passed
@haoqing0110 haoqing0110 deleted the br_work-progressing branch October 13, 2025 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants