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

[Bugfix] agent service test #2620

Merged
merged 1 commit into from
Sep 13, 2024
Merged

[Bugfix] agent service test #2620

merged 1 commit into from
Sep 13, 2024

Conversation

kpango
Copy link
Collaborator

@kpango kpango commented Sep 12, 2024

Description

SSIA

Related Issue

Versions

  • Vald Version: v1.7.13
  • Go Version: v1.23.1
  • Rust Version: v1.81.0
  • Docker Version: v27.2.1
  • Kubernetes Version: v1.31.0
  • Helm Version: v3.15.4
  • NGT Version: v2.2.4
  • Faiss Version: v1.8.0

Checklist

Special notes for your reviewer

Summary by CodeRabbit

  • New Features

    • Introduced new Kubernetes configuration files to enhance the gateway's mirror functionality, improving operational management and scaling capabilities.
  • Chores

    • Cleaned up import statements in the test file, removing unnecessary dependencies.
    • Updated Helm version in issue and pull request templates to v3.16.0.
  • Documentation

    • Added comments in various workflow files to indicate they are auto-generated and should not be edited manually.

@vdaas-ci
Copy link
Collaborator

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • 🔚 2️⃣ 🔚 /label actions/e2e-deploy - run E2E deploy & integration test

vankichi
vankichi previously approved these changes Sep 12, 2024
Copy link

codecov bot commented Sep 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 24.24%. Comparing base (3ba0002) to head (9eb5d4a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
hack/actions/gen/main.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2620      +/-   ##
==========================================
+ Coverage   23.36%   24.24%   +0.87%     
==========================================
  Files         531      533       +2     
  Lines       44740    46255    +1515     
==========================================
+ Hits        10455    11214     +759     
- Misses      33665    34289     +624     
- Partials      620      752     +132     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

coderabbitai bot commented Sep 12, 2024

Walkthrough

Walkthrough

The changes include the removal of an import statement for github.com/vdaas/vald/internal/k8s/vald in the ngt_test.go file located in the pkg/agent/core/ngt/service directory. Additionally, new Kubernetes configuration files are added for a "mirror" functionality within the gateway component, enhancing its capabilities. The Helm version is updated across multiple issue templates, and several workflow files have been modified to include comments indicating they are auto-generated.

Changes

File Path Change Summary
pkg/agent/core/ngt/service/ngt_test.go Removed import statement for github.com/vdaas/vald/internal/k8s/vald
.gitfiles Added new Kubernetes configuration files for "mirror" functionality
.github/ISSUE_TEMPLATE/*.md Updated Helm version from v3.15.4 to v3.16.0
.github/workflows/*.yaml Added comments indicating files are auto-generated
dockers/dev/Dockerfile Added ENV CARGO_HOME=${RUST_HOME}/cargo
example/client/go.mod Updated google.golang.org/grpc version from v1.66.1 to v1.66.2
go.mod Updated multiple dependencies including cloud.google.com/go/firestore and OpenTelemetry
hack/actions/gen/main.go Minor formatting change with newline addition
rust/libs/proto/src/*.rs Removed documentation comments for various structures and methods
versions/HELM_VERSION Updated version from v3.15.4 to v3.16.0
versions/PROTOBUF_VERSION Updated version from 28.0 to 28.1

Sequence Diagram(s)

sequenceDiagram
    participant Test as ngt_test.go
    participant K8s as kvar
    Test->>K8s: Use Kubernetes-related functionality
    Note right of K8s: Removed dependency on vald
Loading

Possibly related PRs

Suggested labels

priority/low, type/documentation, area/makefile


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 53b5261 and 9eb5d4a.

Files ignored due to path filters (3)
  • example/client/go.sum is excluded by !**/*.sum
  • go.sum is excluded by !**/*.sum
  • rust/Cargo.lock is excluded by !**/*.lock
Files selected for processing (38)
  • .gitfiles (1 hunks)
  • .github/ISSUE_TEMPLATE/bug_report.md (1 hunks)
  • .github/ISSUE_TEMPLATE/security_issue_report.md (1 hunks)
  • .github/PULL_REQUEST_TEMPLATE.md (1 hunks)
  • .github/workflows/dockers-agent-faiss-image.yaml (1 hunks)
  • .github/workflows/dockers-agent-image.yaml (1 hunks)
  • .github/workflows/dockers-agent-ngt-image.yaml (1 hunks)
  • .github/workflows/dockers-agent-sidecar-image.yaml (1 hunks)
  • .github/workflows/dockers-benchmark-job-image.yaml (1 hunks)
  • .github/workflows/dockers-benchmark-operator-image.yaml (1 hunks)
  • .github/workflows/dockers-binfmt-image.yaml (1 hunks)
  • .github/workflows/dockers-buildbase-image.yaml (1 hunks)
  • .github/workflows/dockers-buildkit-image.yaml (1 hunks)
  • .github/workflows/dockers-buildkit-syft-scanner-image.yaml (1 hunks)
  • .github/workflows/dockers-ci-container-image.yaml (1 hunks)
  • .github/workflows/dockers-dev-container-image.yaml (1 hunks)
  • .github/workflows/dockers-discoverer-k8s-image.yaml (1 hunks)
  • .github/workflows/dockers-gateway-filter-image.yaml (1 hunks)
  • .github/workflows/dockers-gateway-lb-image.yaml (1 hunks)
  • .github/workflows/dockers-gateway-mirror-image.yaml (1 hunks)
  • .github/workflows/dockers-helm-operator-image.yaml (1 hunks)
  • .github/workflows/dockers-index-correction-image.yaml (1 hunks)
  • .github/workflows/dockers-index-creation-image.yaml (1 hunks)
  • .github/workflows/dockers-index-operator-image.yaml (1 hunks)
  • .github/workflows/dockers-index-save-image.yaml (1 hunks)
  • .github/workflows/dockers-loadtest-image.yaml (1 hunks)
  • .github/workflows/dockers-manager-index-image.yaml (1 hunks)
  • .github/workflows/dockers-readreplica-rotate-image.yaml (1 hunks)
  • dockers/dev/Dockerfile (1 hunks)
  • example/client/go.mod (1 hunks)
  • go.mod (8 hunks)
  • hack/actions/gen/main.go (2 hunks)
  • pkg/agent/core/ngt/service/ngt_test.go (0 hunks)
  • rust/libs/proto/src/filter.egress.v1.tonic.rs (0 hunks)
  • rust/libs/proto/src/filter.ingress.v1.tonic.rs (0 hunks)
  • rust/libs/proto/src/vald.v1.tonic.rs (0 hunks)
  • versions/HELM_VERSION (1 hunks)
  • versions/PROTOBUF_VERSION (1 hunks)
Files not reviewed due to no reviewable changes (4)
  • pkg/agent/core/ngt/service/ngt_test.go
  • rust/libs/proto/src/filter.egress.v1.tonic.rs
  • rust/libs/proto/src/filter.ingress.v1.tonic.rs
  • rust/libs/proto/src/vald.v1.tonic.rs
Files skipped from review due to trivial changes (27)
  • .github/ISSUE_TEMPLATE/bug_report.md
  • .github/PULL_REQUEST_TEMPLATE.md
  • .github/workflows/dockers-agent-faiss-image.yaml
  • .github/workflows/dockers-agent-image.yaml
  • .github/workflows/dockers-agent-ngt-image.yaml
  • .github/workflows/dockers-agent-sidecar-image.yaml
  • .github/workflows/dockers-benchmark-job-image.yaml
  • .github/workflows/dockers-benchmark-operator-image.yaml
  • .github/workflows/dockers-binfmt-image.yaml
  • .github/workflows/dockers-buildbase-image.yaml
  • .github/workflows/dockers-buildkit-image.yaml
  • .github/workflows/dockers-buildkit-syft-scanner-image.yaml
  • .github/workflows/dockers-ci-container-image.yaml
  • .github/workflows/dockers-dev-container-image.yaml
  • .github/workflows/dockers-discoverer-k8s-image.yaml
  • .github/workflows/dockers-gateway-filter-image.yaml
  • .github/workflows/dockers-gateway-lb-image.yaml
  • .github/workflows/dockers-gateway-mirror-image.yaml
  • .github/workflows/dockers-helm-operator-image.yaml
  • .github/workflows/dockers-index-correction-image.yaml
  • .github/workflows/dockers-index-creation-image.yaml
  • .github/workflows/dockers-index-operator-image.yaml
  • .github/workflows/dockers-index-save-image.yaml
  • .github/workflows/dockers-loadtest-image.yaml
  • .github/workflows/dockers-manager-index-image.yaml
  • .github/workflows/dockers-readreplica-rotate-image.yaml
  • versions/PROTOBUF_VERSION
Additional context used
GitHub Check: codecov/patch
hack/actions/gen/main.go

[warning] 725-725: hack/actions/gen/main.go#L725
Added line #L725 was not covered by tests

Additional comments not posted (9)
versions/HELM_VERSION (1)

1-1: Helm version update looks good, ensure compatibility with Kubernetes version.

Updating the Helm version to v3.16.0 is a good practice to incorporate the latest features, enhancements, and bug fixes. Please ensure that this updated version is compatible with the Kubernetes version used in the project to avoid any potential issues.

Also, for a comprehensive understanding of the specific changes introduced in v3.16.0, refer to the Helm release notes or changelog.

.github/ISSUE_TEMPLATE/security_issue_report.md (1)

24-24: LGTM!

Updating the Helm version in the security issue report template is a good practice to ensure users provide the correct version information when reporting issues. The minor version bump likely includes important fixes and improvements.

example/client/go.mod (1)

17-17: Dependency version update looks good, but ensure compatibility and review release notes.

Updating the google.golang.org/grpc dependency to version v1.66.2 seems reasonable. However, it's important to consider the following:

  1. Verify that the updated version is compatible with the rest of the codebase and doesn't introduce any breaking changes. Run tests and perform manual testing to ensure everything works as expected.

  2. Review the release notes or changelog of the gRPC library for version v1.66.2 to understand the specific changes, bug fixes, or new features introduced in this version. This will help you assess the potential impact on your client application.

If the updated version is compatible and the changes align with your requirements, then this update should be good to go.

dockers/dev/Dockerfile (1)

48-48: LGTM!

Enabling the CARGO_HOME environment variable and setting it to ${RUST_HOME}/cargo is a good practice. This ensures that the Cargo package manager's home directory is explicitly set within the Rust installation directory.

By setting CARGO_HOME, you can:

  • Isolate Cargo's cache and configuration files from the system-wide installation.
  • Avoid potential conflicts with other Rust installations or versions.
  • Ensure a consistent and reproducible build environment within the Docker container.

This change may affect the build process or runtime behavior of Rust applications within the Docker container, so it's important to test and verify that everything works as expected after this modification.

hack/actions/gen/main.go (1)

725-725: LGTM!

The addition of a newline character is a cosmetic change that improves the formatting of the generated workflow file. It does not alter the logic or functionality of the code.

Regarding the static analysis hint about the lack of test coverage, I believe it can be safely ignored as a false positive in this case. This line does not contain any complex logic that warrants a dedicated unit test.

Tools
GitHub Check: codecov/patch

[warning] 725-725: hack/actions/gen/main.go#L725
Added line #L725 was not covered by tests

go.mod (3)

Line range hint 1-544: Routine dependency updates. Ensure thorough testing to verify compatibility and functionality.

The go.mod file contains a large number of version updates for various dependencies. This appears to be a routine upgrade to incorporate the latest bug fixes, performance enhancements, and new features from these dependencies.

While updating dependencies is generally beneficial, it's crucial to thoroughly test the changes to ensure they don't introduce any incompatibilities or break existing functionality. Pay special attention to the packages that are directly used in the codebase.


322-322: Thoroughly test gRPC update to ensure backwards compatibility.

The google.golang.org/grpc package has been updated from v1.66.1 to v1.66.2. As gRPC is used extensively for inter-service communication, it's crucial to thoroughly test this update to ensure backwards compatibility and verify that all gRPC-based interactions continue to function correctly.

Run the following script to locate usage of gRPC:

Review the files returned by the script, especially focusing on the service definitions and message types. Ensure that there are no breaking changes and all gRPC calls are functioning as expected with the updated package version.


278-288: Verify compatibility of OpenTelemetry updates.

The OpenTelemetry packages (go.opentelemetry.io/otel*) have been updated from v1.29.0 to v1.30.0. As these packages are directly used for instrumentation in the codebase, it's important to thoroughly test the changes to ensure compatibility and verify that the instrumentation continues to work as expected.

Run the following script to locate usage of OpenTelemetry packages:

Review the files returned by the script and ensure the OpenTelemetry usage is compatible with the updated package versions.

.gitfiles (1)

1428-1436: New Kubernetes files for gateway mirror component look good.

The added Kubernetes configuration files follow a clear structure for deploying and managing the new mirror component within the gateway. The inclusion of cluster roles, role bindings, and service accounts indicates the necessary permissions will be in place. It's also good to see support for deploying the component using deployments, HPAs, and PDBs for scalability and disruption management.

Just to confirm, were there any specific considerations or testing done around the functionality and performance of this new mirror component? It would be helpful to understand a bit more about its role and any important design decisions.


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.

coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 12, 2024
Signed-off-by: kpango <[email protected]>
Copy link

cloudflare-workers-and-pages bot commented Sep 12, 2024

Deploying vald with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9eb5d4a
Status: ✅  Deploy successful!
Preview URL: https://260dc969.vald.pages.dev
Branch Preview URL: https://bugfix-agent-service-import.vald.pages.dev

View logs

@vankichi vankichi merged commit 5ba1375 into main Sep 13, 2024
190 of 193 checks passed
@vankichi vankichi deleted the bugfix/agent/service-import branch September 13, 2024 00:42
vdaas-ci pushed a commit that referenced this pull request Sep 13, 2024
kpango added a commit that referenced this pull request Sep 13, 2024
kpango added a commit that referenced this pull request Sep 13, 2024
kpango added a commit that referenced this pull request Sep 13, 2024
This was referenced Sep 13, 2024
kmrmt pushed a commit that referenced this pull request Sep 13, 2024
kmrmt pushed a commit that referenced this pull request Sep 13, 2024
kmrmt pushed a commit that referenced this pull request Sep 13, 2024
kpango added a commit that referenced this pull request Sep 17, 2024
* implement richer error model

Signed-off-by: Kosuke Morimoto <[email protected]>

* fix

Signed-off-by: Kosuke Morimoto <[email protected]>

* bug fix

Signed-off-by: Kosuke Morimoto <[email protected]>

* format

Signed-off-by: Kosuke Morimoto <[email protected]>

* add pkg-config

Signed-off-by: Kosuke Morimoto <[email protected]>

* delete comment out include

Signed-off-by: Kosuke Morimoto <[email protected]>

* Add UpdateTimestamp API (#2605)

Signed-off-by: kpango <[email protected]>

* [Bugfix] agent service test (#2620)

Signed-off-by: kpango <[email protected]>

* implement richer error model

Signed-off-by: Kosuke Morimoto <[email protected]>

* fix

Signed-off-by: Kosuke Morimoto <[email protected]>

* format

Signed-off-by: Kosuke Morimoto <[email protected]>

* resolve conflict

Signed-off-by: Kosuke Morimoto <[email protected]>

* resolve conflict

Signed-off-by: Kosuke Morimoto <[email protected]>

* revert

Signed-off-by: Kosuke Morimoto <[email protected]>

---------

Signed-off-by: Kosuke Morimoto <[email protected]>
Signed-off-by: kpango <[email protected]>
Co-authored-by: Yusuke Kato <[email protected]>
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.

3 participants