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

fix: http enchancements #1759

Merged
merged 3 commits into from
Oct 29, 2024
Merged

fix: http enchancements #1759

merged 3 commits into from
Oct 29, 2024

Conversation

aashishmalik
Copy link
Contributor

@aashishmalik aashishmalik commented Oct 22, 2024

What are the changes introduced in this PR?

Added feature flag for HTTP destination

What is the related Linear task?

Resolves INT-XXX

Please explain the objectives of your changes below

Put down any required details on the broader aspect of your changes. If there are any dependent changes, mandatorily mention them here

Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?

N/A

Any new dependencies introduced with this change?

N/A

Any new checks got introduced or modified in test suites. Please explain the changes.

N/A


Developer checklist

  • My code follows the style guidelines of this project

  • No breaking changes are being introduced.

  • All related docs linked with the PR?

  • All changes manually tested?

  • Any documentation changes needed with this change?

  • I have executed schemaGenerator tests and updated schema if needed

  • Are sensitive fields marked as secret in definition config?

  • My test cases and placeholders use only masked/sample values for sensitive fields

  • Is the PR limited to 10 file changes & one task?

Reviewer checklist

  • Is the type of change in the PR title appropriate as per the changes?

  • Verified that there are no credentials or confidential data exposed with the changes.

Summary by CodeRabbit

  • New Features
    • Enhanced JSON path validation in request mappings for improved data integrity.
    • Added a feature to control the visibility of certain keys in the JSON view.
    • Introduced a more sophisticated feature flagging mechanism for the HTTP webhook feature.

These updates aim to provide users with better data handling and visibility options within the application.

Copy link

coderabbitai bot commented Oct 22, 2024

Warning

Rate limit exceeded

@aashishmalik has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 2 minutes and 29 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 b0e7f60 and 6eb5668.

Walkthrough

The changes involve updates to the ui-config.json and db-config.json files within the HTTP destination configuration. In ui-config.json, two new properties, jsonPathValidation and hideKeysJsonView, have been introduced and set to true in the "Request Body", "Query Parameters", and "Headers" sections. In db-config.json, the hidden property has been modified from a boolean to an object with featureFlagName and featureFlagValue, providing a more complex feature flagging mechanism.

Changes

File Path Change Summary
src/configurations/destinations/http/ui-config.json Added properties: jsonPathValidation: true and hideKeysJsonView: true in multiple sections.
src/configurations/destinations/http/db-config.json Updated hidden property from boolean to object: {"featureFlagName": "AMP_http_webhook", "featureFlagValue": false}.

Possibly related PRs

  • fix: http destination fixes #1740: This PR modifies the ui-config.json file for the HTTP destination, which is directly related to the changes made in the main PR that also updates the ui-config.json for HTTP properties by adding new fields.

Suggested reviewers

  • lvrach
  • am6010
  • AchuthaSourabhC
  • ssbeefeater
  • debanjan97
  • cisse21
  • ruchiramoitra
  • shrouti1507
  • 1abhishekpandey
  • ItsSudip
  • sandeepdsvs
  • krishna2020

🐇 In the meadow, changes bloom,
New paths for JSON, dispelling gloom.
With keys now hidden, validation's bright,
Our config dances in the soft moonlight.
Hops of joy, let’s celebrate,
For every change, we elevate! 🌼


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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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.

Copy link

codecov bot commented Oct 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (ae753c7) to head (6eb5668).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff            @@
##           develop     #1759   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           53        53           
  Branches         7         7           
=========================================
  Hits            53        53           

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

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

🧹 Outside diff range and nitpick comments (1)
src/configurations/destinations/http/db-config.json (1)

125-128: Document the feature flag behavior.

Since this introduces a new feature flagging mechanism, it would be helpful to document:

  1. The purpose of this feature flag
  2. The expected behavior when enabled/disabled
  3. Impact on existing integrations

Would you like me to help create documentation for this feature flag?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 50845ea and 903971d.

📒 Files selected for processing (2)
  • src/configurations/destinations/http/db-config.json (1 hunks)
  • src/configurations/destinations/http/ui-config.json (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/configurations/destinations/http/ui-config.json
🔇 Additional comments (2)
src/configurations/destinations/http/db-config.json (2)

125-128: Potential breaking change warning.

Setting featureFlagValue to false will hide the HTTP webhook functionality. This could be considered a breaking change for users who are currently using this feature.


125-128: Verify the scope and impact of the feature flag.

The feature flag name AMP_http_webhook suggests AMP-specific control, but it's implemented at the root level which could affect all platforms. Please verify if this is intentional.

Consider moving this feature flag to the AMP-specific configuration section if it's meant to only affect AMP platform.

✅ Verification successful

Feature flag implementation is correctly scoped to HTTP webhook destination

Based on the verification results:

  1. The feature flag AMP_http_webhook is only referenced in the HTTP webhook destination configuration file
  2. The implementation follows the standard pattern for feature flags in the destination configurations
  3. The validation tests show proper URL validation and security measures are in place
  4. No other files in the codebase reference this feature flag

The feature flag implementation is correctly scoped and doesn't introduce any breaking changes or security concerns.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if there are AMP-specific configurations or usages
# that relate to this feature flag

# Check for AMP-related configurations
echo "Checking for AMP-related configurations..."
rg -l "AMP_http_webhook" 

# Check for feature flag usage in UI components
echo "Checking for feature flag usage..."
ast-grep --pattern 'featureFlag$$$AMP_http_webhook'

Length of output: 356


Script:

#!/bin/bash
# Let's try a broader search strategy

# Search for any mentions of the feature flag
echo "Searching for feature flag mentions..."
rg -l "AMP_http_webhook"

# Search for HTTP webhook configurations
echo "Searching for HTTP webhook configurations..."
rg -l "http.*webhook" --type json

# Check UI configurations for AMP-specific settings
echo "Checking UI configurations..."
fd -e json -x rg -l "AMP.*http" {} \;

# Look for platform-specific configurations
echo "Checking platform configurations..."
fd -e json -x rg -l "\"platforms\".*AMP" {} \;

Length of output: 840


Script:

#!/bin/bash
# Let's examine the HTTP webhook configuration in detail

# Check the content of db-config.json for platform configurations
echo "Examining db-config.json..."
cat src/configurations/destinations/http/db-config.json | jq '.platforms'

# Look for any AMP-specific sections in db-config.json
echo "Checking AMP-specific configurations..."
cat src/configurations/destinations/http/db-config.json | grep -A 10 -B 10 "AMP"

# Check webhook validation configurations
echo "Checking webhook validation configurations..."
cat test/data/validation/destinations/webhook.json

Length of output: 27390

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

🧹 Outside diff range and nitpick comments (2)
src/configurations/destinations/http/ui-config.json (2)

529-530: LGTM! Consider documenting these UI enhancements.

The addition of JSON path validation and view control in the Request Body mapping improves the user experience by validating JSON paths and controlling the visibility of JSON keys.

Consider updating the documentation to explain these UI enhancements and their benefits for users configuring HTTP destinations.


Line range hint 529-584: Overall implementation looks solid and well-structured.

The changes consistently implement JSON path validation and view control across all three mapping sections (Request Body, Query Parameters, and Headers). This enhancement improves the user experience while maintaining a consistent interface throughout the configuration.

Key points:

  1. Consistent implementation across all mapping sections
  2. Non-breaking changes as these are UI enhancements
  3. Improved validation for JSON paths

Consider implementing these UI enhancements as reusable components if they prove valuable for other destination configurations in the future.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 903971d and cf5f551.

📒 Files selected for processing (1)
  • src/configurations/destinations/http/ui-config.json (3 hunks)
🔇 Additional comments (2)
src/configurations/destinations/http/ui-config.json (2)

556-557: LGTM! Consistent implementation with Request Body section.

The Query Parameters section correctly implements the same validation and view control features, maintaining consistency across the configuration interface.


583-584: LGTM! Verify feature flag implementation.

The Headers section correctly implements the validation and view control features, completing the consistent implementation across all mapping sections.

Let's verify the feature flag implementation mentioned in the PR objectives:

✅ Verification successful

Let me gather more information about the feature flag implementation.


Based on the search results, I can now provide a final response regarding the feature flag implementation:

Feature flags are properly implemented in the HTTP destination configuration

The jsonPathValidation and hideKeysJsonView properties are correctly configured as feature flags in the HTTP destination's UI configuration, specifically in the Request Body mapping section. These flags are consistently implemented across all mapping sections, following the same pattern used in other destinations.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any feature flag definitions related to these UI enhancements

# Search for feature flag definitions
rg -l "jsonPathValidation|hideKeysJsonView" --type json

# Search for any feature flag conditions
ast-grep --pattern 'featureFlags: $_'

Length of output: 149


Script:

#!/bin/bash
# Search for any feature flag related code in the repository
rg -A 5 "featureFlag|feature_flag|FEATURE_FLAG" --type js --type ts --type json

# Check the specific file content to understand the context
cat src/configurations/destinations/http/ui-config.json

Length of output: 604406

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

🧹 Outside diff range and nitpick comments (1)
src/configurations/destinations/http/db-config.json (1)

125-128: Consider clarifying the feature flag name.

The implementation of feature flagging looks good, but the flag name AMP_http_webhook might be misleading since this configuration supports multiple platforms beyond AMP (android, ios, web, etc.). Consider using a more generic name like http_webhook_enabled to better reflect its scope.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between cf5f551 and b0e7f60.

📒 Files selected for processing (2)
  • src/configurations/destinations/http/db-config.json (1 hunks)
  • src/configurations/destinations/http/ui-config.json (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/configurations/destinations/http/ui-config.json
🔇 Additional comments (1)
src/configurations/destinations/http/db-config.json (1)

125-128: Verify feature flag implementation consistency.

Let's ensure this feature flag implementation follows the same pattern used in other destinations.

✅ Verification successful

Let me check the complete pattern including the featureFlagValue field to ensure full consistency.


Feature flag implementation is consistent with other destinations

The implementation follows the exact same pattern used across other destinations (zoho, wunderkind, salesforce_oauth_sandbox), with:

  • Consistent structure using hidden object
  • Feature flag name prefixed with AMP_
  • featureFlagValue set to false
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check feature flag implementation patterns across other destinations

# Search for similar feature flag implementations in other destination configs
echo "Searching for feature flag patterns in other destination configs..."
rg -U --multiline '"hidden":\s*\{[^}]*"featureFlagName"' src/configurations/destinations/

Length of output: 944


Script:

#!/bin/bash
# Get the complete hidden block with featureFlagValue for all destinations
rg -U --multiline '"hidden":\s*\{[^}]*\}' src/configurations/destinations/

Length of output: 1406

sandeepdsvs
sandeepdsvs previously approved these changes Oct 29, 2024
utsabc
utsabc previously approved these changes Oct 29, 2024
@aashishmalik aashishmalik merged commit 3886598 into develop Oct 29, 2024
10 checks passed
@aashishmalik aashishmalik deleted the fix.http-enchancements branch October 29, 2024 13:08
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.

4 participants