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

add flag for disabling metrics #30

Merged
merged 1 commit into from
May 28, 2024
Merged

add flag for disabling metrics #30

merged 1 commit into from
May 28, 2024

Conversation

eriktaubeneck
Copy link
Member

@eriktaubeneck eriktaubeneck commented May 28, 2024

cc @ akoshelev

This adds the disable-metrics flag to compiling the helper binary:

  1. server/app/query/create/page.tsx adds the new field to the form
  2. sidecar/app/routes/start.py accepts that form field when starting a query
  3. sidecar/app/query/ipa.py uses that input to construct the compile command

Summary by CodeRabbit

  • New Features

    • Introduced an option to disable metrics in the form, enhancing customization for users who prefer not to include metrics.
  • Improvements

    • Enhanced the build process to respect the new disable metrics option, providing more control over the build configuration.

Copy link

vercel bot commented May 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
draft ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 28, 2024 11:22pm

Copy link
Contributor

coderabbitai bot commented May 28, 2024

Walkthrough

A new feature to disable metrics has been introduced across the application. This involves adding a state variable in the frontend, integrating a boolean attribute in the backend, and modifying methods to handle and propagate this new flag through the system, ultimately affecting the cargo build command.

Changes

File Path Change Summary
server/app/query/create/page.tsx Added state variable disableMetricsEnabled and its setter function to IPAForm function.
sidecar/app/query/ipa.py Added disable_metrics attribute to IPAHelperCompileStep class and IPAHelperQuery class. Updated build_from_query and build_command methods to handle disable_metrics.
sidecar/app/routes/start.py Added disable_metrics parameter to start_ipa_helper function and updated its logic.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant User
    participant Frontend
    participant Backend
    participant CommandBuilder

    User->>Frontend: Toggle disable metrics
    Frontend->>Backend: Send disable_metrics flag
    Backend->>Backend: Update IPAHelperQuery with disable_metrics
    Backend->>CommandBuilder: Build command with disable_metrics
    CommandBuilder->>Backend: Return command
    Backend->>Frontend: Respond to user
Loading

Poem

In the code where metrics lie,
A toggle switch to say goodbye,
With flags and states, we now can see,
Metrics off, wild and free.
The backend follows, builds anew,
A streamlined path for me and you.
🎉🐇✨


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 as 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 full the 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.

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

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 5e2d24f and cdbfa2f.
Files selected for processing (3)
  • server/app/query/create/page.tsx (2 hunks)
  • sidecar/app/query/ipa.py (4 hunks)
  • sidecar/app/routes/start.py (3 hunks)
Additional Context Used
Biome (14)
server/app/query/create/page.tsx (14)

113-113: This enum declaration contains members that are implicitly initialized.


132-132: Use !== instead of !=.
!= is only allowed when comparing against null


133-133: Use !== instead of !=.
!= is only allowed when comparing against null


147-147: Use !== instead of !=.
!= is only allowed when comparing against null


170-170: Use !== instead of !=.
!= is only allowed when comparing against null


211-216: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.


236-244: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.


1-2: Some named imports are only used as types.


12-17: Some named imports are only used as types.


18-19: Some named imports are only used as types.


143-143: This hook specifies more dependencies than necessary: CommitSpecifier.COMMIT_HASH


158-158: This hook does not specify all of its dependencies: filteredCommitHashes.length


158-158: This hook specifies more dependencies than necessary: CommitSpecifier.BRANCH, commitHashes


226-232: Provide an explicit type prop for the button element.

Additional comments not posted (6)
sidecar/app/routes/start.py (3)

45-45: Added disable_metrics parameter to the function signature.


57-57: Correctly appended '_disable-metrics' to the compiled ID based on the disable_metrics flag.


72-72: Properly passed the disable_metrics flag to the IPAHelperQuery constructor.

sidecar/app/query/ipa.py (2)

167-167: Added disable_metrics attribute to IPAHelperCompileStep and correctly handled it in build_from_query and build_command methods.

Also applies to: 177-177, 184-184


409-409: Added disable_metrics attribute to IPAHelperQuery class.

server/app/query/create/page.tsx (1)

131-131: Added state variable disableMetricsEnabled with a setter function.

server/app/query/create/page.tsx Show resolved Hide resolved
Copy link
Collaborator

@akoshelev akoshelev left a comment

Choose a reason for hiding this comment

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

🚢

@eriktaubeneck eriktaubeneck merged commit 3051e42 into main May 28, 2024
3 checks passed
@eriktaubeneck eriktaubeneck deleted the disable-metrics-flag branch May 28, 2024 23:39
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