This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
feat(cli): add command to import KPIs from a JSON #557
Draft
Samyak2
wants to merge
5
commits into
develop
Choose a base branch
from
kpi-import
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✔️ Deploy Preview for frontend-sb canceled. 🔨 Explore the source changes: e562d84 🔍 Inspect the deploy log: https://app.netlify.com/sites/frontend-sb/deploys/61e560d2523b06000739f7d5 |
manassolanki
suggested changes
Jan 3, 2022
The `kpi-import` command reads a JSON file given as input and adds all the KPIs in it. The JSON must have a list of KPIs in the specified format (similar to JSON of the API endpoint - some field names may differ). TODO: some of the code is repeated from the KPI endpoint. If a KPI addition fails, it's logged and the script moves on to the next one.
Added a generalized `add_kpi` function in kpi_controller. - Handles validation, adding to dashboards, anomaly params validation and running analytics. - validation and analytics run can be switched off. - Split some unrelated parts into separate functions - `_kpi_query_strip_trailing_semicolon` - `_add_kpi_to_dashboards` - `queue_kpi_analytics` (added to anomaly_tasks.py) Updated both the CLI and the KPI view to use this new function. Tested by adding a simple KPI from the UI and importing a KPI from the CLI.
kartikay-bagla
suggested changes
Jan 17, 2022
Co-authored-by: Kartikay Bagla <[email protected]>
Co-authored-by: Kartikay Bagla <[email protected]>
kartikay-bagla
approved these changes
Jan 17, 2022
`anomaly_task` will be None when anomaly doesn't need to run. We will still log an error in that case, when there's actually no error. Co-authored-by: Kartikay Bagla <[email protected]>
I will be adding a data source import command to this same PR. |
@kartikay-bagla @Samyak2 Any reason as to why we are not resolving conflicts and merging this? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
The
kpi-import
command reads a JSON file given as input and adds all the KPIs in it. The JSON must have a list of KPIs in the specified format (similar to JSON of the API endpoint - some field names may differ).If a KPI addition fails, it's logged and the script moves on to the next one.