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

chore: base support for raising stat per tracking plan event #2847

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

abhimanyubabbar
Copy link
Contributor

@abhimanyubabbar abhimanyubabbar commented Nov 22, 2023

Description of the change

In this change, we have refactored the code to allow for capturing stats per tracking plan event validation. This will allow us to write better fine grained alerts over the tracking plan changes.

DAT-340
https://linear.app/rudderstack/issue/DAT-340/trackingplan-stats-capture-include-state-statuscode-per-event-level

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Related issues

Fix #1

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers mentioned in a comment
  • Changes have been reviewed by at least one other engineer
  • Issue from task tracker has a link to this pull request

@abhimanyubabbar abhimanyubabbar requested review from sivashanmukh and a team as code owners November 22, 2023 13:21
@abhimanyubabbar abhimanyubabbar changed the title chore: added base support for raising event per tracking plan event chore: base support for raising event per tracking plan event Nov 22, 2023
@abhimanyubabbar abhimanyubabbar changed the title chore: base support for raising event per tracking plan event chore: base support for raising stat per tracking plan event Nov 22, 2023
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link

codecov bot commented Nov 22, 2023

Codecov Report

Attention: Patch coverage is 12.00000% with 22 lines in your changes are missing coverage. Please review.

Project coverage is 84.83%. Comparing base (c1b3736) to head (dbd574d).
Report is 16 commits behind head on develop.

Files Patch % Lines
src/services/trackingPlan.ts 8.69% 21 Missing ⚠️
src/controllers/trackingPlan.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2847      +/-   ##
===========================================
- Coverage    84.86%   84.83%   -0.03%     
===========================================
  Files          497      498       +1     
  Lines        27412    27442      +30     
  Branches      6597     6603       +6     
===========================================
+ Hits         23262    23281      +19     
- Misses        3723     3731       +8     
- Partials       427      430       +3     

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

@devops-github-rudderstack
Copy link
Contributor

This PR is considered to be stale. It has been open for 20 days with no further activity thus it is going to be closed in 7 days. To avoid such a case please consider removing the stale label manually or add a comment to the PR.

Copy link
Contributor

coderabbitai bot commented Feb 5, 2024

Important

Auto Review Skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository.

To trigger a single review, invoke the @coderabbitai review command.

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.

@abhimanyubabbar abhimanyubabbar force-pushed the chore.raise-stats-per-tracking-plan-event branch from 7db76a1 to 99d0368 Compare February 5, 2024 17:35
@devops-github-rudderstack
Copy link
Contributor

2 similar comments
@devops-github-rudderstack
Copy link
Contributor

@devops-github-rudderstack
Copy link
Contributor

@abhimanyubabbar abhimanyubabbar force-pushed the chore.raise-stats-per-tracking-plan-event branch from 99d0368 to 9931404 Compare February 6, 2024 10:41
@devops-github-rudderstack
Copy link
Contributor

Copy link

sonarqubecloud bot commented Feb 6, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@devops-github-rudderstack
Copy link
Contributor

This PR is considered to be stale. It has been open for 20 days with no further activity thus it is going to be closed in 7 days. To avoid such a case please consider removing the stale label manually or add a comment to the PR.

@abhimanyubabbar abhimanyubabbar requested review from a team as code owners March 11, 2024 17:30
@abhimanyubabbar abhimanyubabbar force-pushed the chore.raise-stats-per-tracking-plan-event branch from 357291a to 0e9ada9 Compare March 11, 2024 18:06
Jayachand
Jayachand previously approved these changes Mar 12, 2024
@abhimanyubabbar abhimanyubabbar force-pushed the chore.raise-stats-per-tracking-plan-event branch from 54a4ffb to 11ccb13 Compare March 12, 2024 10:50
for (let i = 0; i < events.length; i++) {
const event = events[i];
const eventStartTime = new Date();
for (let event of events) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this line causing an ESLint error, suggesting the use of iterators instead of loops?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

eslint has been blocked for the trackingPlan files. I'll change it nonetheless, point has been raised before as well.

for (let event of events) {
let eventValidationResponse: any;
let exceptionOccured = false;
let eventStartTime = Date.now();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
let eventStartTime = Date.now();
const eventStartTime = Date.now();

Jayachand
Jayachand previously approved these changes Mar 12, 2024
@abhimanyubabbar abhimanyubabbar force-pushed the chore.raise-stats-per-tracking-plan-event branch from 11ccb13 to dbd574d Compare March 12, 2024 15:01
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
80.6% Duplication on New Code (required ≤ 15%)

See analysis details on SonarCloud

@Jayachand Jayachand merged commit bdc0f41 into develop Mar 13, 2024
15 of 16 checks passed
@Jayachand Jayachand deleted the chore.raise-stats-per-tracking-plan-event branch March 13, 2024 09:28
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