Skip to content
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

chore: bump dependencies package #175

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

daviderli614
Copy link
Member

@daviderli614 daviderli614 commented Sep 8, 2024

  • Bump kustomize version from v4.5.3 to v5.3.0.
  • Bump controller-gen version from v0.9.0 to v0.14.0.
  • Bump kubernetes API dependencies package version, same as our e2e test cluster: create-cluster.sh, and the client-go Compatibility matrix is v0.28.0:
    image
  • Update random number generation to use NewSource for compatibility with Go version:
Error: cmd/operator/main.go:27:2: SA1019: rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0: As of Go 1.20 there is no reason to call Seed with a random value. Programs that call Seed with a known value to get a specific sequence of results should use New(NewSource(seed)) to obtain a local random generator. (staticcheck)
	rand.Seed(time.Now().UnixNano())
	^
level=info msg="Memory: 218 samples, avg is 1003.2MB, max is 1481.5MB"
level=info msg="Execution took [23](https://github.com/GreptimeTeam/greptimedb-operator/actions/runs/10757419727/job/29831429509?pr=175#step:7:24).066672131s"
make: *** [Makefile:104: lint] Error 1
Error: Process completed with exit code 2.

Summary by CodeRabbit

  • New Features

    • Enhanced the Custom Resource Definition (CRD) for greptimedbstandalones with new fields for better resource management, including resizePolicy and restartPolicy.
  • Improvements

    • Updated dependencies to the latest versions, including significant upgrades to Go and various libraries, improving performance and functionality.
  • Bug Fixes

    • Minor adjustments to the build process and RBAC configuration to streamline operations.
  • Refactor

    • Improved metrics configuration for the controller manager for better clarity and modularity.
  • Enhancements

    • Modified random number generation in the application for improved randomness and testing capabilities.

Copy link
Contributor

coderabbitai bot commented Sep 8, 2024

Walkthrough

The pull request includes updates to version numbers in the Makefile, modifications to build constraints in zz_generated.deepcopy.go, and enhancements to metrics configuration in command.go. Significant changes are made to the Custom Resource Definition (CRD) for greptimedbstandalones, introducing new fields for resource management. The RBAC role configuration sees a minor adjustment, while the UpdateStatus function signatures in two controllers are refined. Additionally, the go.mod file reflects multiple dependency upgrades, including a Go version change from 1.18 to 1.21.

Changes

File Path Change Summary
Makefile Updated KUSTOMIZE_VERSION from v4.5.3 to v5.3.0 and CONTROLLER_TOOLS_VERSION from v0.9.0 to v0.14.0.
apis/v1alpha1/zz_generated.deepcopy.go Removed build constraint // +build !ignore_autogenerated.
cmd/operator/app/command.go Modified metrics initialization to use Metrics: metricsserver.Options{ BindAddress: o.MetricsAddr }.
config/crd/resources/greptime.io_greptimedbstandalones.yaml Added resizePolicy, restartPolicy, and expanded claims field with new specifications.
config/rbac/role.yaml Removed creationTimestamp from ClusterRole metadata.
controllers/greptimedbcluster/deployers/common.go Changed UpdateStatus function's last parameter type from client.UpdateOption to client.SubResourceUpdateOption.
controllers/greptimedbstandalone/controller.go Changed UpdateStatus function's last parameter type from client.UpdateOption to client.SubResourceUpdateOption.
go.mod Updated Go version from 1.18 to 1.21 and upgraded multiple dependencies, including significant libraries and Kubernetes-related packages.
cmd/operator/main.go Modified random number generation approach to use a custom random source: rand.New(rand.NewSource(time.Now().UnixNano())).

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Operator
    participant MetricsServer

    User->>Operator: Initialize Operator Command
    Operator->>MetricsServer: Configure Metrics
    MetricsServer-->>Operator: Metrics Configured
    Operator-->>User: Operator Ready
Loading

🐰 "In the meadow where we play,
New versions hop in bright array.
Metrics dance and CRDs grow,
With each change, our garden glows!
Hooray for updates, one and all,
Together we shall stand tall!" 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@daviderli614 daviderli614 requested a review from zyy17 September 8, 2024 05:38
Copy link
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: 0

Outside diff range, codebase verification and nitpick comments (1)
controllers/greptimedbstandalone/controller.go (1)

357-357: Verify and update all calls to UpdateStatus to match the new signature.

The UpdateStatus function has been updated to include opts ...client.SubResourceUpdateOption, but not all calls to this function have been updated to match the new signature. Ensure that all instances where UpdateStatus is called are reviewed and updated to include the new opts parameter where necessary to prevent potential issues.

  • Files to review:
    • controllers/greptimedbcluster/deployers/flownode.go
    • controllers/greptimedbcluster/deployers/meta.go
    • controllers/greptimedbcluster/deployers/datanode.go
    • controllers/greptimedbcluster/deployers/frontend.go
Analysis chain

Approved change in function signature with a suggestion to verify integration.

The change to use client.SubResourceUpdateOption in the UpdateStatus function is approved as it likely enhances the specificity and correctness of update operations on sub-resources. However, it is recommended to verify that this change integrates well with the rest of the system, especially where UpdateStatus is called.

Run the following script to verify the function usage:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `UpdateStatus` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'UpdateStatus'

Length of output: 8127

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2c1e38f and 0d029b6.

Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
Files selected for processing (8)
  • Makefile (1 hunks)
  • apis/v1alpha1/zz_generated.deepcopy.go (1 hunks)
  • cmd/operator/app/command.go (2 hunks)
  • config/crd/resources/greptime.io_greptimedbstandalones.yaml (51 hunks)
  • config/rbac/role.yaml (1 hunks)
  • controllers/greptimedbcluster/deployers/common.go (1 hunks)
  • controllers/greptimedbstandalone/controller.go (1 hunks)
  • go.mod (1 hunks)
Files skipped from review due to trivial changes (3)
  • Makefile
  • apis/v1alpha1/zz_generated.deepcopy.go
  • config/rbac/role.yaml
Additional comments not posted (6)
cmd/operator/app/command.go (1)

73-75: Refined Metrics Configuration:

The introduction of metricsserver.Options for metrics configuration enhances clarity and modularity. The change is well-implemented, using o.MetricsAddr effectively.

Please ensure that this new configuration integrates seamlessly with the rest of the metrics system and that o.MetricsAddr is properly validated elsewhere in the code.

controllers/greptimedbcluster/deployers/common.go (1)

109-109: Specialized Update Function Signature:

The update to client.SubResourceUpdateOption in the UpdateStatus function is a positive change, likely enhancing the precision of status updates.

Please ensure that this change is compatible with the existing update mechanisms and does not introduce regressions. Verify that all calls to UpdateStatus have been updated accordingly.

go.mod (3)

3-3: Go Version Update:

Updating from Go 1.18 to Go 1.21 is a significant change that introduces new features and improvements. Ensure thorough testing to catch any potential breaking changes.

Please conduct comprehensive tests to ensure that the new Go version does not introduce any compatibility issues or require code modifications.


9-10: Testing Libraries Update:

The updates to github.com/onsi/ginkgo/v2 and github.com/onsi/gomega introduce enhancements in testing capabilities. Ensure that these updates integrate well with existing tests and do not disrupt test workflows.

Please verify that the updated testing libraries are compatible with your current test suites and that all tests pass without issues.


19-22: Kubernetes Libraries Update:

Updating Kubernetes-related libraries to v0.28.3 is crucial for maintaining compatibility with the latest Kubernetes APIs. Ensure that these updates do not introduce any compatibility issues with your Kubernetes environment.

Please verify that the updated Kubernetes libraries integrate seamlessly with your Kubernetes environment and that all functionalities are working as expected.

config/crd/resources/greptime.io_greptimedbstandalones.yaml (1)

433-459: Approved CRD enhancements for better resource management.

The additions of resizePolicy, restartPolicy, and the expanded claims field in the CRD are approved. These enhancements are crucial for better resource management and handling of restart policies. The use of atomic list types ensures that updates to these fields are handled correctly, which is important for maintaining consistency and preventing partial updates.

Also applies to: 477-479

Copy link
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 UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0d029b6 and d81b362.

Files selected for processing (1)
  • cmd/operator/main.go (1 hunks)

cmd/operator/main.go Show resolved Hide resolved
@zyy17 zyy17 merged commit bec4d46 into GreptimeTeam:develop Sep 12, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants