Skip to content

chore: webhook integration tests generation script upgrade #4215

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

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

vinayteki95
Copy link
Contributor

What are the changes introduced in this PR?

  1. Webhook integration test generation script now only caters to v2 test structures.
  2. New tests are generated based on this
  3. Small changes to go test structure to facilitate server and ingestion service integration test module changes.
  4. Pre-Commit hook is modified to generate these test cases if changes are found in sources component tests. If any new changes are detected, the commit stops with a clear message and next call to action.
image

What is the related Linear task?

Resolves INT-3149

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 ?

Yes, webhook integration tests generation script changed

Any new dependencies introduced with this change?

No

Any new generic utility introduced or modified. Please explain the changes.

pre-commit hook modified

Any technical or performance related pointers to consider with the change?

No

@coderabbitai review


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?

  • Is the PR limited to 10 file changes?

  • Is the PR limited to one linear task?

  • Are relevant unit and component test-cases added in new readability format?

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.

@vinayteki95 vinayteki95 requested review from sivashanmukh and a team as code owners March 30, 2025 12:21
Copy link
Contributor

coderabbitai bot commented Mar 30, 2025

Summary by CodeRabbit

  • Tests

    • Introduced automation that generates and stages new integration test cases for modified source files.
    • Improved the processing of test input data for enhanced handling of query parameters and request payloads.
  • Chores

    • Updated linting configuration to exclude specific file types, ensuring consistent code quality checks.

Walkthrough

This update enhances the repository by introducing automated generation of integration test cases for modified source files during pre-commit checks. The .husky/pre-commit script identifies changes and generates corresponding test cases, staging them for user verification. Additionally, the Go test cases have been restructured with a new Source struct and improvements to JSON handling, modifying field types and the decoding process for better data management.

Changes

File(s) Change Summary
.husky/pre-commit Added functionality to detect modified integration source files, generate integration test cases, check git status before/after generation, and stage new changes if found.
go/webhook/testcases/testcases.go Introduced a new Source struct; updated the Input struct to include Source; modified Request struct by changing RawQuery from a string to a map and Body from json.RawMessage to a string; refactored the JSON decoding process.
.eslintignore Added pattern to ignore *.go files and restored the pattern to ignore *.properties files in ESLint checks.

Sequence Diagram(s)

sequenceDiagram
    participant Git as Git
    participant PreCommit as ".husky/pre-commit"
    participant TestGen as "Test Case Generator"
    participant Staging as "Git Staging"
    participant User as "Developer"

    Git->>PreCommit: Run "git diff --cached" to detect modified files
    PreCommit->>TestGen: Loop through each modified source file
    TestGen-->>PreCommit: Generate integration test case file
    PreCommit->>Git: Check git status pre/post generation
    PreCommit->>Staging: Stage new/modified test case files
    PreCommit->>User: Display notification for verification and commit
Loading

Suggested reviewers

  • sivashanmukh
  • krishna2020
  • maheshkutty
  • ItsSudip

Suggestions for improvement:

  • Consider handling edge cases where file generation may fail to prevent incomplete staging.
  • Ensure robust error logging for better traceability during test case generation.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f94d2e1 and 8d3eafd.

⛔ Files ignored due to path filters (1)
  • package.json is excluded by !**/*.json
📒 Files selected for processing (1)
  • .eslintignore (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .eslintignore
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Code Coverage
  • GitHub Check: ingestion-service-test
  • GitHub Check: test_and_publish
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: UT Tests
  • GitHub Check: Analyze (go)

🪧 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

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: 0

🧹 Nitpick comments (2)
.husky/pre-commit (1)

1-38: Well-structured implementation for automatic test case generation.

The script effectively identifies changed source files and generates corresponding test cases, which aligns well with the PR objective of upgrading the webhook integration test generation script. This automation will help maintain test coverage as source files change.

Consider adding basic error handling for the npm run generate:testcases command to gracefully handle potential failures.

 # Generate new test cases
-npm run generate:testcases -- --source "$source"
+if ! npm run generate:testcases -- --source "$source"; then
+  echo "\033[1;31mError generating test cases for $source\033[0m"
+  exit 1
+fi
🧰 Tools
🪛 GitHub Check: Check for formatting & lint errors

[warning] 1-1:
File ignored by default.

🪛 GitHub Actions: Verify

[warning] 1-1: File ignored by default. Use a negated ignore pattern (like '--ignore-pattern '!<relative/path/to/filename>'') to override.

go/webhook/testcases/testcases.go (1)

32-39: Good addition of Source struct for configuration.

The new Source struct with a Config field enhances the test structure to support the v2 format mentioned in the PR objectives. This change allows for better separation of configuration from request data.

It would be helpful to include a brief comment explaining the purpose of this struct and how it aligns with the v2 test structure.

// Input represents the test input data
type Input struct {
	Request Request
	Source  Source
}

+// Source represents the source configuration for webhook integration tests
type Source struct {
	Config string `json:"config"`
}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d3c6937 and af900f0.

⛔ Files ignored due to path filters (239)
  • go/webhook/testcases/testdata/testcases/adjust/simple_track_call_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/adjust/simple_track_call_with_no_query_parameters_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/adjust/simple_track_call_with_wrong_created_at_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/appcenter/test_0_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/appcenter/test_1_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/appcenter/test_2_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/appcenter/test_3_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/appcenter/test_4_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/appsflyer/test_0_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/appsflyer/test_1_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/appsflyer/test_2_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/appsflyer/test_3_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/appsflyer/test_4_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/appsflyer/test_5_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/appsflyer/test_6_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/appsflyer/test_7_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/auth0/add_member_to_an_organization_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/auth0/empty_batch.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/auth0/missing_user_id_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/auth0/missing_user_id_for_all_the_requests_in_a_batch.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/auth0/missing_user_id_for_all_the_requests_in_a_batch_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/auth0/missing_user_id_for_all_the_requests_in_a_batch_1.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/auth0/successful_signup.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/auth0/successful_signup_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/auth0/successful_signup_1.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/auth0/update_tenant_settings.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/auth0/update_tenant_settings_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/auth0/update_tenant_settings_1.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/event_0__events_is_undefined_or_null_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/event_0__is_null_undefined_in_request_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/event_events_is_not_available_in_required_format_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/event_is_empty_array_in_request_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/event_is_null_in_request_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/event_mapping_done_in_ui.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/event_mapping_done_in_ui_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/success_scenario_when_event_0__events_is_valid_request_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/the_event_is_not_mapped_in_the_ui.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/the_event_is_not_mapped_in_the_ui_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/users_behaviors_app_session_start_event.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/users_behaviors_app_session_start_event_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/users_behaviors_custom_event_any_custom_event.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/users_behaviors_custom_event_any_custom_event_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/users_behaviors_purchase_event.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/users_behaviors_purchase_event_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/users_messages_email_open_event.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/users_messages_email_open_event_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/users_messages_inappmessage_click_event.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/users_messages_inappmessage_click_event_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/users_messages_pushnotification_send_event.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/users_messages_pushnotification_send_event_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/users_messages_sms_delivery_event.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/users_messages_sms_delivery_event_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/users_messages_sms_delivery_send.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/braze/users_messages_sms_delivery_send_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/canny/test_0_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/canny/test_10_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/canny/test_11_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/canny/test_12_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/canny/test_1_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/canny/test_2_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/canny/test_3_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/canny/test_4_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/canny/test_5_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/canny/test_6_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/canny/test_7_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/canny/test_8_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/canny/test_9_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/close_crm/group_creation_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/close_crm/lead_deletion_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/close_crm/lead_update_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/cordial/multiple_object_input_event_with_batched_payload_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/cordial/simple_single_object_input_event_with_no_cid_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/cordial/simple_single_object_input_event_with_normal_channel_and_action_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_0_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_10_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_11_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_12_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_13_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_14_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_15_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_16_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_17_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_18_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_19_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_1_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_20_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_21_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_22_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_23__email_subscribed_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_2_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_3_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_4_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_5_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_6_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_7_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_8_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/customerio/test_9_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/facebook_lead_ads/facebook_lead_ads_with_empty_payload_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/facebook_lead_ads/facebook_lead_ads_with_facebook_lead_id_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/facebook_lead_ads/facebook_lead_ads_with_invalid_created_time_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/facebook_lead_ads/facebook_lead_ads_with_null_payload_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/facebook_lead_ads/facebook_lead_ads_with_unavailable_null_created_time_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/facebook_lead_ads/facebook_lead_ads_with_valid_created_time_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/facebook_lead_ads/facebook_lead_ads_without_user_id_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/formsort/when_we_receive_finalized_as_false_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/formsort/when_we_receive_finalized_as_true_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/gainsightpx/custom_track_call_.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/gainsightpx/custom_track_call__0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/gainsightpx/engagement_track_call_.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/gainsightpx/engagement_track_call__0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/gainsightpx/feature_match_track_call_.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/gainsightpx/feature_match_track_call__0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/gainsightpx/feedback_track_call_.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/gainsightpx/feedback_track_call__0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/gainsightpx/identify_call.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/gainsightpx/identify_call_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/gainsightpx/no_match_track_call__0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/gainsightpx/segment_io_s2_s_track_call_.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/gainsightpx/segment_io_s2_s_track_call__0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/gainsightpx/segment_match_track_call_and_no_user_id_and_yes_anonymous_id_as_event_session_id.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/gainsightpx/segment_match_track_call_and_no_user_id_and_yes_anonymous_id_as_event_session_id_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/gainsightpx/survey_track_call____multi_question_survey_.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/gainsightpx/survey_track_call____multi_question_survey__0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/gainsightpx/survey_track_call____nps_.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/gainsightpx/survey_track_call____nps__0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_0_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_10_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_11_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_12_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_13_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_14_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_15_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_16_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_17_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_18_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_19_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_1_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_20_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_21_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_22_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_23_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_24_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_25_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_26_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_27_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_28_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_29_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_2_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_3_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_4_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_5_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_6_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_7_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_8_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_9_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/mailjet/mail_jet_email_bounce_event_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/mailjet/mail_jet_email_bounce_event_where_input_event_is_of_type__0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/mailjet/mail_jet_email_open_event_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/mailjet/mail_jet_email_sent_event_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/mailjet/mail_jet_multiple_payloads_in_single_request_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/mailjet/mail_jet_when_no_email_is_present_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/mailmodo/test_0_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/mailmodo/test_1_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/mailmodo/test_2_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/mailmodo/test_3_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/mailmodo/test_4_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/mailmodo/test_5_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/mailmodo/test_6_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/mailmodo/test_7_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/mailmodo/test_8_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/moengage/batch_of_events.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/moengage/batch_of_events_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/moengage/simple_track_call_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/monday/test_0_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/monday/test_1_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/monday/test_2_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/monday/test_3_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/monday/test_4_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/monday/test_5_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/olark/olark_webhook_response_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/ortto/simple_track_call_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/ortto/simple_track_call_with_unknown_field_id_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/pagerduty/incident_escalated_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/pagerduty/incident_priority_updated_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/pagerduty/incident_resolved_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/pagerduty/incident_responder_added_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/pagerduty/incident_triggered_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/pipedream/alias_type____type_and_user_id_is_given_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/pipedream/group_type____type_and_user_id_is_given_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/pipedream/identify_type____type_and_user_id_is_given_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/pipedream/no_type_or_anonymous_id_is_given_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/pipedream/no_type_or_user_id_is_given_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/pipedream/page_type____type_and_user_id_is_given_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/pipedream/track_call____type_and_user_id_is_given_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/refiner/refiner_webhook_response.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/refiner/refiner_webhook_response_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/revenuecat/initial_purchase_event_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/revenuecat/purchase_event_with_anonymous_user_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/revenuecat/simple_track_call_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/satismeter/all_fields_check_with_event_as_completed_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/satismeter/neither_reponse_user_id_or_response_user_user_id_is_provided_in_payload_then_mapping_response_id_to_anonymous_id_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/segment/test_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/segment/test_0_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/segment/test_0_1.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/segment/test_0_2.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/segment/test_0_3.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/shopify/identify_call_for_customers_create_event_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/shopify/invalid_topic.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/shopify/invalid_topic_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/shopify/no_query_parameters_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/shopify/topic_not_found.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/shopify/topic_not_found_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/shopify/track_call____carts_create_.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/shopify/track_call____carts_create__0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/shopify/track_call____fullfillments_updated_event_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/shopify/track_call____order_partially_fulfilled_event_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/shopify/unsupported_checkout_event.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/shopify/unsupported_checkout_event_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/shopify/unsupported_event_type_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/signl4/test_0_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/signl4/test_1_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/signl4/test_2_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/signl4/test_3_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/signl4/test_4_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/signl4/test_5_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/signl4/test_6_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/signl4/test_7_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/signl4/test_8_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/slack/message_event_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/slack/team_joined_event_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/slack/webhook_url_verificatin_event_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/webhook/failed_webhook_request_with_malformed_json_body_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/webhook/successful_webhook_request_with_query_params_and_headers_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/webhook/successful_webhook_request_with_query_params_and_headers_1.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/webhook/successful_webhook_request_with_query_params_and_headers_2.json is excluded by !**/*.json
  • package.json is excluded by !**/*.json
  • test/integrations/sources/moengage/data.ts is excluded by !**/test/**
  • test/integrations/sources/webhook/data.ts is excluded by !**/test/**
  • test/scripts/generateJson.ts is excluded by !**/test/**
📒 Files selected for processing (2)
  • .husky/pre-commit (1 hunks)
  • go/webhook/testcases/testcases.go (3 hunks)
🧰 Additional context used
🪛 GitHub Check: Check for formatting & lint errors
.husky/pre-commit

[warning] 1-1:
File ignored by default.

🪛 GitHub Actions: Verify
.husky/pre-commit

[warning] 1-1: File ignored by default. Use a negated ignore pattern (like '--ignore-pattern '!<relative/path/to/filename>'') to override.

go/webhook/testcases/testcases.go

[error] 1-1: Parsing error: ESLint was configured to run on <tsconfigRootDir>/go/webhook/testcases/testcases.go using parserOptions.project: /tsconfig.json. The extension for the file (.go) is non-standard. It should be added to your existing parserOptions.extraFileExtensions.

⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Code Coverage
  • GitHub Check: UT Tests
  • GitHub Check: ingestion-service-test
  • GitHub Check: test_and_publish
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)
🔇 Additional comments (3)
.husky/pre-commit (1)

29-37: Excellent user feedback mechanisms.

The colorful, informative messages clearly indicate what happened and what actions the developer needs to take. The structured output makes it easy to understand which sources were affected and where the generated files are located.

go/webhook/testcases/testcases.go (2)

90-105: Improved JSON handling with compaction step.

The new approach of reading the entire file first and compacting the JSON before decoding is a good practice. It handles potential whitespace issues in the JSON files, making the parsing more robust.

This change may also improve compatibility with test cases generated by different tools that might format JSON differently.


40-45:

❓ Verification inconclusive

Field type changes in Request struct may require test updates.

The changes to the RawQuery (from string to map) and Body (from json.RawMessage to string) fields represent significant structural changes that align with the v2 test format.

Ensure that all existing test cases have been updated to accommodate these changes, as they could be breaking changes for existing tests. The pre-commit hook additions should help with this by automatically generating updated test cases.


🏁 Script executed:

#!/bin/bash
# Check if there are any remaining test cases using the old format
echo "Checking for test files that might need updates:"
find ./go/webhook/testcases/testdata/testcases -type f -name "*.json" -exec grep -l "query_parameters" {} \;

Length of output: 295


Critical: Verify Test Updates for Request Struct Changes

The modifications to the RawQuery field (from a string to a map) and the Body field (from json.RawMessage to a string) are substantial and align with the v2 test format. However, the automated script did not find any JSON test files containing "query_parameters" in the expected directory (./go/webhook/testcases/testdata/testcases). This might be due to a change in the test file location or an update in the test data structure.

  • Please verify manually that all test cases have been updated to reflect these changes.
  • Confirm that any automated test-generation hooks or checks are targeting the correct directories.

@devops-github-rudderstack
Copy link
Contributor

Allure Test reports for this run are available at:

Copy link

codecov bot commented Mar 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.17%. Comparing base (f990bf6) to head (8d3eafd).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4215   +/-   ##
========================================
  Coverage    91.17%   91.17%           
========================================
  Files          632      632           
  Lines        33079    33079           
  Branches      7831     7828    -3     
========================================
  Hits         30160    30160           
- Misses        2674     2704   +30     
+ Partials       245      215   -30     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@devops-github-rudderstack
Copy link
Contributor

Allure Test reports for this run are available at:

@koladilip
Copy link
Contributor

check lint errors

@devops-github-rudderstack
Copy link
Contributor

Allure Test reports for this run are available at:

Copy link
Collaborator

Choose a reason for hiding this comment

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

why the additional index suffix ? I only see 0 in all the files suffixes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cases where multiple requests are in a request, we should be able to pick all of them. Earlier we assumed that there will only be one and picked that.

@devops-github-rudderstack
Copy link
Contributor

Allure Test reports for this run are available at:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet