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: add jest test cases for new logic's utils, functions and processors - dashboardVariables #6621

Merged
merged 9 commits into from
Dec 17, 2024

Conversation

SagarRajput-7
Copy link
Contributor

@SagarRajput-7 SagarRajput-7 commented Dec 12, 2024

Summary

Related Issues / PR's

Screenshots

Tests:

image

Affected Areas and Manually Tested Areas


Important

Add Jest test cases for onUpdateVariableNode and checkAPIInvocation in dashboardVariables, with mock data and debugging logs.

  • Tests:
    • Add dashboardVariables.test.tsx to test onUpdateVariableNode with scenarios: root, middle, leaf elements, and nodes not in graph or order.
    • Test empty topological order case in dashboardVariables.test.tsx.
    • Add tests for checkAPIInvocation covering edge cases and variable sequences.
    • Add mock data in mock.ts for testing.
  • Debugging:
    • Add console logs in util.ts for getDependentVariables, buildDependencies, buildDependencyGraph, onUpdateVariableNode, and buildParentDependencyGraph.

This description was created by Ellipsis for 23d808a. It will automatically update as commits are pushed.

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@github-actions github-actions bot added the enhancement New feature or request label Dec 12, 2024
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to f098518 in 36 seconds

More details
  • Looked at 174 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. frontend/src/container/NewDashboard/DashboardVariablesSelection/util.ts:35
  • Draft comment:
    Remove console.log statements to clean up the code. This applies to lines 35, 50, 83, 130, and 148.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_JBF3hVpIiP1cYa44


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@@ -32,6 +32,7 @@ export const convertVariablesToDbFormat = (
}, {});

const getDependentVariables = (queryValue: string): string[] => {
console.log('getDependentVariables', queryValue);
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove console.log statements used for debugging to maintain clean code. This applies to other console.log statements in this file as well.

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Incremental review on c991ee6 in 35 seconds

More details
  • Looked at 155 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. frontend/src/container/NewDashboard/DashboardVariablesSelection/util.ts:168
  • Draft comment:
    Remove console.log statements used for debugging to maintain clean code.
  • Reason this comment was not posted:
    Marked as duplicate.
2. frontend/src/container/NewDashboard/DashboardVariablesSelection/util.ts:127
  • Draft comment:
    Remove console.log statements used for debugging to maintain clean code.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_G848MtWm7F87VKNq


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@@ -164,6 +168,12 @@ export const checkAPIInvocation = (
variableData: IDashboardVariable,
parentDependencyGraph?: VariableGraph,
): boolean => {
console.log(
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid using console.log for debugging in production code. Consider using a proper logging mechanism or remove it if not needed. This applies to other instances in this file as well.

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

1 similar comment
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 23d808a in 10 minutes and 32 seconds

More details
  • Looked at 256 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. frontend/src/container/NewDashboard/DashboardVariablesSelection/__test__/dashboardVariables.test.tsx:34
  • Draft comment:
    The test case for 'node not in topological order' is redundant as it uses the same node 'unknown' as 'node not in graph'. Consider removing or differentiating it.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_7OrMQI2IT8hbrPgX


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@SagarRajput-7 SagarRajput-7 changed the base branch from limiting-api-via-keys to develop December 12, 2024 05:57
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@SagarRajput-7 SagarRajput-7 changed the base branch from develop to limiting-api-via-keys December 12, 2024 11:23
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

1 similar comment
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on ae98aaa in 35 seconds

More details
  • Looked at 355 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. frontend/src/container/NewDashboard/DashboardVariablesSelection/util.ts:79
  • Draft comment:
    Remove console.log statements from production code to avoid performance issues and console clutter.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
2. frontend/src/container/NewDashboard/DashboardVariablesSelection/util.ts:79
  • Draft comment:
    Remove the console.log statement to clean up the code.
- **Reason this comment was not posted:** 
Marked as duplicate.

</details>


Workflow ID: <workflowid>`wflow_NOiVdaMISMS8ruOq`</workflowid>

</details>


----
You can customize Ellipsis with :+1: / :-1: [feedback](https://docs.ellipsis.dev/review), review rules, user-specific overrides, `quiet` mode, and [more](https://docs.ellipsis.dev/config).

@SagarRajput-7 SagarRajput-7 changed the base branch from limiting-api-via-keys to variable-update-queue December 17, 2024 12:23
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@SagarRajput-7 SagarRajput-7 merged commit c6c2e1f into variable-update-queue Dec 17, 2024
6 of 7 checks passed
SagarRajput-7 added a commit that referenced this pull request Dec 24, 2024
…sors - dashboardVariables (#6621)

* feat: added API limiting to reduce unneccesary api call for dashboard variables

* feat: fixed dropdown open triggering the api calls for single-select and misc

* feat: add jest test cases for new logic's utils, functions and processors - dashboardVariables

* feat: added test for checkAPIInvocation

* feat: refactor code

* feat: added more test on graph utilities
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs required enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant