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

feat: implement worked example of search #49

Merged
merged 6 commits into from
Mar 26, 2024
Merged

feat: implement worked example of search #49

merged 6 commits into from
Mar 26, 2024

Conversation

ramirezj
Copy link
Member

@ramirezj ramirezj commented Mar 26, 2024

closes #16

Summary by CodeRabbit

  • New Features
    • Enhanced device search functionality in the kolide_client package, allowing for more refined queries based on new search criteria.
    • Updated the device listing to include additional details such as device type, operating system, hardware model, and authentication state.
  • Improvements
    • Added support for conditional JSON serialization in device information to improve data handling.
    • Improved search capability in the device listing by utilizing new search parameters and operator mapping for more accurate results.

Copy link
Contributor

coderabbitai bot commented Mar 26, 2024

Warning

Rate Limit Exceeded

@ramirezj has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 47 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between ff3a1c1 and 47943f7.

Walkthrough

This update enhances the search functionality in the kolide_client package and the Steampipe plugin for Kolide. It introduces new types and functions for search criteria serialization, updates JSON tags in the Device struct for optional fields, and improves device querying within the Kolide K2 API. Additionally, it enhances data representation in Steampipe tables with new columns and refined filtering capabilities.

Changes

Files Change Summary
kolide/client/client.go,
.../devices.go
Introduced OperatorType, Search types, functions, and updated Device struct JSON tags.
kolide/table_kolide_k2_device.go Added imports, new columns, adjusted KeyColumns, and refactored device listing for searches.
kolide/utils.go Added operatorMapping and mapToSearch for mapping qualifiers to Kolide K2 API operators.

"In the realm of code, where the rabbits dwell,
🐇 A hop, a skip, in the git we excel.
With types anew and searches so fine,
Through Kolide's fields, we deftly entwine.
🌟 To the changes we've made, let's raise a cheer,
For better queries and data, ever so clear!"

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-tests 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 tests 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 tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

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.

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 283ec0b and 82e94b1.
Files selected for processing (4)
  • kolide/client/client.go (3 hunks)
  • kolide/client/devices.go (1 hunks)
  • kolide/table_kolide_k2_device.go (4 hunks)
  • kolide/utils.go (2 hunks)
Additional comments: 6
kolide/client/client.go (1)
  • 16-29: The introduction of OperatorType and Search types, along with related constants, is well-implemented and aligns with the PR objectives. These changes effectively support the serialization of search criteria.
kolide/client/devices.go (2)
  • 14-22: The updates to the JSON tags in the Device struct, including the use of omitempty, are appropriate and align with the PR objectives to optimize the serialization process.
  • 28-31: The enhancements to the GetDevices method, including accepting variadic Search parameters and the integration with serializeSearches, significantly improve the flexibility and power of search queries.
kolide/table_kolide_k2_device.go (3)
  • 16-44: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [19-65]

The modifications and additions to the table definition, including new columns and adjustments to KeyColumns for filtering, effectively enhance the representation of device data and support the new search functionality.

  • 78-101: The refactoring of the listDevices function to handle searches based on qualifiers is well-implemented, leveraging the new search capabilities effectively.
  • 101-101: The getDevice function remains effective in retrieving a device by ID, and its integration with the connect function is correctly implemented.

kolide/client/client.go Outdated Show resolved Hide resolved
kolide/utils.go Outdated Show resolved Hide resolved
ramirezj and others added 2 commits March 26, 2024 12:14
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 82e94b1 and ff3a1c1.
Files selected for processing (1)
  • kolide/client/client.go (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • kolide/client/client.go

@ramirezj ramirezj merged commit ca24961 into main Mar 26, 2024
3 checks passed
@ramirezj ramirezj deleted the implement-search branch March 26, 2024 12:32
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.

Search
1 participant