Skip to content

Conversation

@kpunwatk
Copy link
Contributor

@kpunwatk kpunwatk commented Oct 20, 2025

Adds TempoStack resource to the wrapper

Short description:
More details:
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for reviewer:
Bug:

Summary by CodeRabbit

  • New Features

    • Added support for a Tempo Stack resource with configuration for management state, resource allocation, storage options (including capacity), and customizable deployment templates; includes validation of required configuration.
  • Chores

    • Added support for the Tempo API group to enable management of Tempo resources.

@redhat-qe-bot
Copy link
Contributor

Report bugs in Issues

Welcome! 🎉

This pull request will be automatically processed with the following features:

🔄 Automatic Actions

  • Reviewer Assignment: Reviewers are automatically assigned based on the OWNERS file in the repository root
  • Size Labeling: PR size labels (XS, S, M, L, XL, XXL) are automatically applied based on changes
  • Issue Creation: A tracking issue is created for this PR and will be closed when the PR is merged or closed
  • Pre-commit Checks: pre-commit runs automatically if .pre-commit-config.yaml exists
  • Branch Labeling: Branch-specific labels are applied to track the target branch
  • Auto-verification: Auto-verified users have their PRs automatically marked as verified

📋 Available Commands

PR Status Management

  • /wip - Mark PR as work in progress (adds WIP: prefix to title)
  • /wip cancel - Remove work in progress status
  • /hold - Block PR merging (approvers only)
  • /hold cancel - Unblock PR merging
  • /verified - Mark PR as verified
  • /verified cancel - Remove verification status

Review & Approval

  • /lgtm - Approve changes (looks good to me)
  • /approve - Approve PR (approvers only)
  • /automerge - Enable automatic merging when all requirements are met (maintainers and approvers only)
  • /assign-reviewers - Assign reviewers based on OWNERS file
  • /assign-reviewer @username - Assign specific reviewer
  • /check-can-merge - Check if PR meets merge requirements

Testing & Validation

  • /retest tox - Run Python test suite with tox
  • /retest python-module-install - Test Python package installation
  • /retest conventional-title - Validate commit message format
  • /retest all - Run all available tests

Container Operations

  • /build-and-push-container - Build and push container image (tagged with PR number)
    • Supports additional build arguments: /build-and-push-container --build-arg KEY=value

Cherry-pick Operations

  • /cherry-pick <branch> - Schedule cherry-pick to target branch when PR is merged
    • Multiple branches: /cherry-pick branch1 branch2 branch3

Label Management

  • /<label-name> - Add a label to the PR
  • /<label-name> cancel - Remove a label from the PR

✅ Merge Requirements

This PR will be automatically approved when the following conditions are met:

  1. Approval: /approve from at least one approver
  2. LGTM Count: Minimum 0 /lgtm from reviewers
  3. Status Checks: All required status checks must pass
  4. No Blockers: No WIP, hold, or conflict labels
  5. Verified: PR must be marked as verified (if verification is enabled)

📊 Review Process

Approvers and Reviewers

Approvers:

  • myakove
  • rnetser

Reviewers:

  • dbasunag
  • myakove
  • rnetser
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
  • automerge

💡 Tips

  • WIP Status: Use /wip when your PR is not ready for review
  • Verification: The verified label is automatically removed on each new commit
  • Cherry-picking: Cherry-pick labels are processed when the PR is merged
  • Container Builds: Container images are automatically tagged with the PR number
  • Permission Levels: Some commands require approver permissions
  • Auto-verified Users: Certain users have automatic verification and merge privileges

For more information, please refer to the project documentation or contact the maintainers.

@coderabbitai
Copy link

coderabbitai bot commented Oct 20, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a new API group constant TEMPO_GRAFANA_COM and introduces a new NamespacedResource subclass TempoStack that sets api_group to that constant, accepts management_state, resources, storage, storage_size, template, validates required fields in to_dict(), and constructs the resource spec.

Changes

Cohort / File(s) Change Summary
API group constant
ocp_resources/resource.py
Added TEMPO_GRAFANA_COM: str = "tempo.grafana.com" to ApiGroup.
TempoStack resource class
ocp_resources/tempo_stack.py
Added TempoStack subclass of NamespacedResource with api_group = NamespacedResource.ApiGroup.TEMPO_GRAFANA_COM, __init__(management_state, resources, storage, storage_size, template, **kwargs), and to_dict() that validates required fields and builds spec (includes managementState, storage, and optional resources, storageSize, template).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • myakove
  • rnetser
  • dbasunag

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description includes the required template structure with all section headings present, but it is largely incomplete. While a single introductory line states "Adds TempoStack resource to the wrapper," all substantive sections (Short description, More details, What this PR does / why we need it, Which issue(s) this PR fixes, Special notes for reviewer, and Bug) are entirely empty. This leaves reviewers without critical context about the implementation details, motivation, related issues, or any caveats they should consider during review. Please populate the description sections with meaningful content, particularly "More details" to explain the TempoStack resource implementation, "What this PR does / why we need it" to provide context and motivation, and any other sections relevant to this change. Even brief but substantive descriptions in these areas would significantly improve reviewability and help maintainers understand the contribution's purpose and scope.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "feat: Adds TempoStack resource" directly and clearly describes the main change in the pull request—the addition of a new TempoStack resource class. The title uses the conventional commit format with the "feat:" prefix, is concise and specific (avoiding generic terms), and accurately reflects the primary objective of the changeset as shown in the raw summary. The supporting addition of the TEMPO_GRAFANA_COM constant to the ApiGroup class is a logical companion to the main feature and does not diminish the title's accuracy.

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2991c39 and 3b68b53.

📒 Files selected for processing (2)
  • ocp_resources/resource.py (1 hunks)
  • ocp_resources/tempo_stack.py (1 hunks)

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

🧹 Nitpick comments (3)
ocp_resources/resource.py (1)

570-570: Consider adding type annotation for consistency.

Most constants in ApiGroup include : str type annotation. Consider updating to TEMPO_GRAFANA_COM: str = "tempo.grafana.com" to match the majority pattern.

ocp_resources/tempo_stack.py (2)

21-21: Consider using a more specific type for storage_size.

The Any type is too broad. Kubernetes storage sizes are typically strings (e.g., "10Gi", "1Ti"). Consider using str | None instead.

-        storage_size: Any | None = None,
+        storage_size: str | None = None,

63-71: Minor: Remove extra blank line.

Line 66 has an unnecessary blank line that breaks consistency with the other conditional blocks.

             if self.resources is not None:
                 _spec["resources"] = self.resources
 
-
             if self.storage_size is not None:
                 _spec["storageSize"] = self.storage_size
 
             if self.template is not None:
                 _spec["template"] = self.template
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 78934bc and f63c3ce.

📒 Files selected for processing (2)
  • ocp_resources/resource.py (1 hunks)
  • ocp_resources/tempo_stack.py (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
ocp_resources/tempo_stack.py (2)
ocp_resources/resource.py (4)
  • NamespacedResource (1535-1645)
  • ApiGroup (466-577)
  • to_dict (738-742)
  • to_dict (1643-1645)
ocp_resources/exceptions.py (1)
  • MissingRequiredArgumentError (5-10)
🔇 Additional comments (1)
ocp_resources/tempo_stack.py (1)

1-14: LGTM!

The imports are appropriate, class structure is correct, and the api_group correctly references the new TEMPO_GRAFANA_COM constant.

@kpunwatk
Copy link
Contributor Author

pre-commit.ci autofix

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: 0

♻️ Duplicate comments (1)
ocp_resources/tempo_stack.py (1)

51-55: The current implementation is correct per project conventions.

The use of the "self." prefix in the MissingRequiredArgumentError argument (e.g., "self.management_state" and "self.storage") is the established convention in this codebase. Based on learnings, this pattern is defined in the code generator template and followed consistently across resource classes.

🧹 Nitpick comments (1)
ocp_resources/tempo_stack.py (1)

66-66: Consider removing the extra blank line for consistency.

There's an extra blank line here between the resources and storage_size conditional blocks, but no blank line between storage_size and template. For consistency, consider removing this blank line.

Apply this diff:

         if self.resources is not None:
             _spec["resources"] = self.resources
-

         if self.storage_size is not None:
             _spec["storageSize"] = self.storage_size
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f63c3ce and 7a43217.

📒 Files selected for processing (2)
  • ocp_resources/resource.py (1 hunks)
  • ocp_resources/tempo_stack.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • ocp_resources/resource.py
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-11T16:42:29.245Z
Learnt from: servolkov
PR: RedHatQE/openshift-python-wrapper#2490
File: ocp_resources/route_advertisements.py:53-65
Timestamp: 2025-08-11T16:42:29.245Z
Learning: In the openshift-python-wrapper project, when raising MissingRequiredArgumentError, the convention is to include the "self." prefix in the argument name (e.g., `MissingRequiredArgumentError(argument="self.advertisements")`). This pattern is established in the code generator template at `class_generator/manifests/class_generator_template.j2` and followed consistently across most resource classes.

Applied to files:

  • ocp_resources/tempo_stack.py
🧬 Code graph analysis (1)
ocp_resources/tempo_stack.py (2)
ocp_resources/resource.py (4)
  • NamespacedResource (1535-1645)
  • ApiGroup (466-577)
  • to_dict (738-742)
  • to_dict (1643-1645)
ocp_resources/exceptions.py (1)
  • MissingRequiredArgumentError (5-10)
🔇 Additional comments (3)
ocp_resources/tempo_stack.py (3)

1-7: LGTM!

The imports and header are appropriate for the TempoStack resource implementation.


9-14: LGTM!

The class declaration and API group configuration are correct, properly referencing the TEMPO_GRAFANA_COM constant defined in the parent class.


16-45: LGTM!

The __init__ method is well-structured with proper type hints, clear documentation, and correct parent class initialization.

@kpunwatk
Copy link
Contributor Author

pre-commit.ci autofix

myakove
myakove previously approved these changes Oct 20, 2025
@myakove
Copy link
Collaborator

myakove commented Oct 20, 2025

@kpunwatk please fix tox

@kpunwatk
Copy link
Contributor Author

pre-commit.ci autofix

	modified:   ocp_resources/resource.py
	new file:   ocp_resources/tempo_stack.py

	modified:   ocp_resources/resource.py
@kpunwatk
Copy link
Contributor Author

pre-commit.ci autofix

@myakove
Copy link
Collaborator

myakove commented Oct 20, 2025

/approve
/lgtm

@kpunwatk
Copy link
Contributor Author

/verified

@myakove myakove merged commit 9dd7f9b into RedHatQE:main Oct 20, 2025
6 of 7 checks passed
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.

5 participants