Skip to content

update DEVELOPER_GUIDE.md to ensure the requirement of adding resources in wrapper librabry#513

Merged
dbasunag merged 2 commits intoopendatahub-io:mainfrom
dbasunag:update_doc
Aug 12, 2025
Merged

update DEVELOPER_GUIDE.md to ensure the requirement of adding resources in wrapper librabry#513
dbasunag merged 2 commits intoopendatahub-io:mainfrom
dbasunag:update_doc

Conversation

@dbasunag
Copy link
Copy Markdown
Collaborator

@dbasunag dbasunag commented Aug 11, 2025

Description

How Has This Been Tested?

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@dbasunag dbasunag requested a review from a team as a code owner August 11, 2025 15:47
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Aug 11, 2025

📝 Walkthrough

Summary by CodeRabbit

  • Documentation
    • Expanded guidance on interacting with Kubernetes/OpenShift APIs.
    • Added steps to generate missing resources using the class_generator tool and submit contributions via PR to the wrapper.
    • Clarified that tests, utilities, and fixtures should use the openshift-python-wrapper resources or oc when a wrapper resource isn’t applicable (e.g., must-gather).
    • No code or public API changes.

Walkthrough

Adds documentation to DEVELOPER_GUIDE.md detailing how to generate missing resources via class_generator, submit PRs to the wrapper, and require tests/utilities/fixtures to use wrapper resources or oc when appropriate. No code or public API changes.

Changes

Cohort / File(s) Summary of Changes
Documentation
docs/DEVELOPER_GUIDE.md
Added guidance under Interacting with Kubernetes/OpenShift APIs: use class_generator to create missing resources and submit PRs to the wrapper; mandate using wrapper resources or oc in tests/utilities/fixtures when wrapper is not relevant (e.g., must-gather). Clarifies no code/public API changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

✨ Finishing Touches
🧪 Generate unit tests
  • 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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Copy Markdown

The following are automatically added/executed:

  • PR size label.
  • Run pre-commit
  • Run tox
  • Add PR author as the PR assignee
  • Build image based on the PR

Available user actions:

  • To mark a PR as WIP, add /wip in a comment. To remove it from the PR comment /wip cancel to the PR.
  • To block merging of a PR, add /hold in a comment. To un-block merging of PR comment /hold cancel.
  • To mark a PR as approved, add /lgtm in a comment. To remove, add /lgtm cancel.
    lgtm label removed on each new commit push.
  • To mark PR as verified comment /verified to the PR, to un-verify comment /verified cancel to the PR.
    verified label removed on each new commit push.
  • To Cherry-pick a merged PR /cherry-pick <target_branch_name> to the PR. If <target_branch_name> is valid,
    and the current PR is merged, a cherry-picked PR would be created and linked to the current PR.
  • To build and push image to quay, add /build-push-pr-image in a comment. This would create an image with tag
    pr-<pr_number> to quay repository. This image tag, however would be deleted on PR merge or close action.
Supported labels

{'/wip', '/hold', '/verified', '/cherry-pick', '/lgtm', '/build-push-pr-image'}

Copy link
Copy Markdown
Contributor

@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.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between afa014d and a47e98d.

📒 Files selected for processing (1)
  • docs/DEVELOPER_GUIDE.md (1 hunks)

Comment thread docs/DEVELOPER_GUIDE.md
Comment on lines +69 to +74
For any missing resources, please generate a new resource using
[class_generator tool](https://github.com/RedHatQE/openshift-python-wrapper/blob/main/class_generator/README.md) and
create a PR against wrapper. Calls to cluster resources from tests, utils and fixtures must always use
openshift-python-wrapper resource or oc command
(when wrapper resource is not relevant. e.g. must-gather generation)

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.

💡 Verification agent

🧩 Analysis chain

Tighten language, fix grammar/consistency, and format oc

Refines phrasing, aligns “utils” to “utilities” (consistent with earlier sections), clarifies “resource class,” adds missing articles/punctuation, and formats oc as a command.

Apply this diff:

-For any missing resources, please generate a new resource using
-[class_generator tool](https://github.com/RedHatQE/openshift-python-wrapper/blob/main/class_generator/README.md) and
-create a PR against wrapper. Calls to cluster resources from tests, utils and fixtures must always use
-openshift-python-wrapper resource or oc command
-(when wrapper resource is not relevant. e.g. must-gather generation)
+For any missing resources, generate a new resource class using the
+[class_generator tool](https://github.com/RedHatQE/openshift-python-wrapper/blob/main/class_generator/README.md),
+and open a PR against the
+[openshift-python-wrapper repository](https://github.com/RedHatQE/openshift-python-wrapper).
+Calls to cluster resources from tests, utilities, and fixtures must use an
+openshift-python-wrapper resource; when a wrapper resource is not relevant
+(e.g., must-gather generation), use the `oc` command.

Optionally verify external links resolve (HTTP 200):


🏁 Script executed:

#!/bin/bash
set -euo pipefail

urls=(
  "https://github.com/RedHatQE/openshift-python-wrapper/blob/main/README.md"
  "https://github.com/RedHatQE/openshift-python-wrapper/blob/main/class_generator/README.md"
)

for u in "${urls[@]}"; do
  code=$(curl -s -o /dev/null -w "%{http_code}" "$u")
  echo "$code  $u"
done
# Expect: 200 for each URL

Length of output: 872


docs/DEVELOPER_GUIDE.md (lines 69–74): refine phrasing, fix grammar & consistency

To improve clarity and align with existing terminology, apply this diff:

-For any missing resources, please generate a new resource using
-[class_generator tool](https://github.com/RedHatQE/openshift-python-wrapper/blob/main/class_generator/README.md) and
-create a PR against wrapper. Calls to cluster resources from tests, utils and fixtures must always use
-openshift-python-wrapper resource or oc command
-(when wrapper resource is not relevant. e.g. must-gather generation)
+For any missing resources, generate a new resource class using the
+[class_generator tool](https://github.com/RedHatQE/openshift-python-wrapper/blob/main/class_generator/README.md),
+and open a PR against the
+[openshift-python-wrapper repository](https://github.com/RedHatQE/openshift-python-wrapper).
+Calls to cluster resources from tests, utilities, and fixtures must use an
+openshift-python-wrapper resource; when a wrapper resource is not relevant
+(e.g., must-gather generation), use the `oc` command.
  • “utilities” replaces “utils” for consistency.
  • Added “class” after “resource” for precision.
  • Linked both the class_generator tool and the wrapper repo directly.
  • Formatted oc as inline code.
  • Updated punctuation in parenthetical for standard style.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
For any missing resources, please generate a new resource using
[class_generator tool](https://github.com/RedHatQE/openshift-python-wrapper/blob/main/class_generator/README.md) and
create a PR against wrapper. Calls to cluster resources from tests, utils and fixtures must always use
openshift-python-wrapper resource or oc command
(when wrapper resource is not relevant. e.g. must-gather generation)
For any missing resources, generate a new resource class using the
[class_generator tool](https://github.com/RedHatQE/openshift-python-wrapper/blob/main/class_generator/README.md),
and open a PR against the
[openshift-python-wrapper repository](https://github.com/RedHatQE/openshift-python-wrapper).
Calls to cluster resources from tests, utilities, and fixtures must use an
openshift-python-wrapper resource; when a wrapper resource is not relevant
(e.g., must-gather generation), use the `oc` command.
🤖 Prompt for AI Agents
In docs/DEVELOPER_GUIDE.md around lines 69–74, refine the paragraph to replace
"utils" with "utilities", add the word "class" after each occurrence of
"resource" for precision, change the existing tool link to directly reference
the class_generator README and also link the wrapper repo homepage, format the
oc command as inline code (i.e., use the project's inline code style for `oc`),
and update the parenthetical punctuation to standard style (e.g., include
periods and commas inside parentheses as needed); make these phrasing and
grammar adjustments while preserving the original meaning about generating
missing resources and using wrapper classes or the oc command when appropriate.

@dbasunag dbasunag changed the title update DEVELOPER_GUIDE.md to ensure the requirement of adding resourc… update DEVELOPER_GUIDE.md to ensure the requirement of adding resources in wrapper librabry Aug 11, 2025
Copy link
Copy Markdown
Member

@jiridanek jiridanek left a comment

Choose a reason for hiding this comment

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

I'm not a fan, I believe that if it is an important requirement, it should be managed the way @russellb did it in vllm in

Hopefully a helpful chatbot, especially when given the vllm code as an example, can generate the pre-commit check with not too much effort.

I believe that documenting this will only help in disciplining the offenders (RTFM you fool!) but it will not have preventative effect for newcomers.

Combination of automated check that references the contributing documentation when failing, is imo the way.

The code to forbid is something like

        api_version = "imageregistry.operator.openshift.io/v1"
        kind = "Config"

        resource = admin_client.resources.get(api_version=api_version, kind=kind)

taken from 6a9dc1e#diff-67c9d3198e7209553e9352e8d116d28a2c1008331bf7e391b3acfc26707a98eeR18-R50

@dbasunag
Copy link
Copy Markdown
Collaborator Author

I like this idea and will see if this is doable at my end. But I would still want the doc to clearly state what is needed. I feel, many of the newer contributors did not know they are required to add such resources and tools exists to create them automatically.

@dbasunag dbasunag merged commit f0d33ac into opendatahub-io:main Aug 12, 2025
8 checks passed
@dbasunag dbasunag deleted the update_doc branch August 12, 2025 15:34
@github-actions
Copy link
Copy Markdown

Status of building tag latest: success.
Status of pushing tag latest to image registry: success.

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.

4 participants