-
Notifications
You must be signed in to change notification settings - Fork 666
OCPBUGS-65831: Fix catalog service swapping description and markdownDescription fields #15750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The catalog service was incorrectly parsing FBC from catalogd: - Short plain-text descriptions were stored in markdownDescription - Long markdown-formatted descriptions were stored in description This fix corrects the field mapping: - csvMetadata.Annotations["description"] → item.Description (short, plain-text) - csvMetadata.Description → item.MarkdownDescription (long, markdown) Also removed fallback logic for markdownDescription to keep it empty when not available, and removed unused pkg parameter. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
@TheRealJon: This pull request references Jira Issue OCPBUGS-65831, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In 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. |
WalkthroughRefactored description derivation logic in the OLM catalog module. Removed helper functions for plain text and markdown description extraction. Updated the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: TheRealJon 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 |
There was a problem hiding this 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
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (1)
pkg/olm/catalog.go(3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**
⚙️ CodeRabbit configuration file
-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.
Files:
pkg/olm/catalog.go
🔇 Additional comments (2)
pkg/olm/catalog.go (2)
245-253: LGTM! Correct field mapping.The function now correctly maps
csvMetadata.Description(long markdown) toitem.MarkdownDescription, and intentionally removes the fallback logic as stated in the PR objectives. Explicitly setting to empty string whencsvMetadatais nil is good defensive programming.
84-84: LGTM! Call site correctly updated.The function call correctly reflects the updated signature of
withMarkdownDescriptionwith thepkgparameter removed.
| // Plain text description takes precedence, fall back to markdown description if empty | ||
| func withDescription(item *ConsoleCatalogItem, csvMetadata *property.CSVMetadata, pkg *declcfg.Package) { | ||
| item.Description = pkg.Description | ||
| if csvMetadata == nil { | ||
| return | ||
| } | ||
|
|
||
| item.Description = getPlainTextDescription(csvMetadata, pkg) | ||
| if csvMetadata.Annotations == nil { | ||
| return | ||
| } | ||
|
|
||
| item.Description = csvMetadata.Annotations[DescriptionOLMAnnotationKey] | ||
| if item.Description == "" { | ||
| item.Description = getMarkdownDescription(csvMetadata) | ||
| item.Description = pkg.Description | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update outdated comment.
The comment on line 186 states "fall back to markdown description if empty", but the implementation falls back to pkg.Description (line 199), not markdown description. This appears to be a remnant from the previous implementation that used helper functions.
The logic itself correctly implements the intended mapping: csvMetadata.Annotations[DescriptionOLMAnnotationKey] → item.Description with pkg.Description as fallback.
-// Plain text description takes precedence, fall back to markdown description if empty
+// Plain text description from CSV annotations, falls back to package description
func withDescription(item *ConsoleCatalogItem, csvMetadata *property.CSVMetadata, pkg *declcfg.Package) {🤖 Prompt for AI Agents
In pkg/olm/catalog.go around lines 186 to 201, the comment saying "fall back to
markdown description if empty" is outdated because the code actually falls back
to pkg.Description; update the comment to accurately describe behavior (e.g.,
"plain text description takes precedence, fall back to package description if
empty") so it matches the implemented logic and remove any reference to markdown
helper behavior.
|
/retest |
|
/jira refresh |
|
@TheRealJon: This pull request references Jira Issue OCPBUGS-65831, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: In 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. |
Seems cypress flaky |
|
@TheRealJon: all tests passed! Full PR test history. Your PR dashboard. 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 catalog service was incorrectly parsing FBC from catalogd:
This fix corrects the field mapping:
Also removed fallback logic for markdownDescription to keep it empty when not available, and removed unused pkg parameter.
🤖 Generated with Claude Code