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

Enhancement to unskript-ctl CLI #269

Open
jayasimha-raghavan-unskript opened this issue Feb 28, 2023 · 3 comments
Open

Enhancement to unskript-ctl CLI #269

jayasimha-raghavan-unskript opened this issue Feb 28, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@jayasimha-raghavan-unskript
Copy link
Member

Feature Request

Currently unskript-ctl can be used to run a given Runbook or list the existing runbooks that
are avilable in the Awesome docker. This Issue is to request enhancements to the unskript-ctl tool.

Ability to run checks

unskript-ctl --run-checks [all | connector | failing]

Here the intention is to Run

  • All available checks
  • Run all checks for a given connector
  • Run checks that have failed in the past (Re-run failed checks)
  1. When all option is selected, the unskript-ctl should find out all available checks packaged in the system and run them and report the status against each checks, these result should be logged and the user should be able to display the failed checks
    and display the logs from the failed checks.

  2. When a connector is specified, the script should fetch all checks available in the system for that particular connector and run them/report status and log the results for later use.

  3. When execution_id is specified (we can get the failed execution_id from -df display-failed option), the script should re-run the check corresponding to the the execution_id and report status and log them for later use.

Ability to display failing checks

unskript-ctl --show-faling-checks [ all | connector ]

Here the intention is to show

  • All checks that have failed since last run
  • All checks that have failed for a given connector type
  1. When all option is provided, the script should display details like check id, name and timestamp of the last failure run
  2. When a connector is provided, the script should display details like check-id, name and timestamp of the last failure for that connector only.

Ability to display audit logs for check runs

unskript-ctl --show-audit-trail [ all | connector | check-id ]

Here the intention is to show

  • All Audit trails recorded in the system detailed passed/failed/errored checks
  • All Audit trails recorded for a given connector in the system detailing passed/failed/errored checks
  • Audit trails recorded for a given check-id in the system detailing passed/failed/errored runs for the given check-id

Ability to list all checks

unskript-ctl --list-checks [all | connector ]

Here the intention is to show

  • All Checks available in the sytem
  • All Checks for a given connector available to run in the system
@jayasimha-raghavan-unskript jayasimha-raghavan-unskript added the enhancement New feature or request label Feb 28, 2023
@abhishek-unskript
Copy link
Member

Feature Request

Currently unskript-ctl can be used to run a given Runbook or list the existing runbooks that are avilable in the Awesome docker. This Issue is to request enhancements to the unskript-ctl tool.

Ability to run checks

unskript-ctl --run-checks [all | connector | failing]

Here the intention is to Run

  • All available checks
  • Run all checks for a given connector
  • Run checks that have failed in the past (Re-run failed checks)
  1. When all option is selected, the unskript-ctl should find out all available checks packaged in the system and run them and report the status against each checks, these result should be logged and the user should be able to display the failed checks
    and display the logs from the failed checks.
  2. When a connector is specified, the script should fetch all checks available in the system for that particular connector and run them/report status and log the results for later use.
  3. When execution_id is specified (we can get the failed execution_id from -df display-failed option), the script should re-run the check corresponding to the the execution_id and report status and log them for later use.

No execution_id is being provided in the failing case.
We should collect the checks with current status as failing from the DB and run those checks.
Could you provide the implementation summary - what will you be implementing for each of these three? ie a design note.

Ability to display failing checks

unskript-ctl --show-faling-checks [ all | connector ]

Here the intention is to show

  • All checks that have failed since last run
  • All checks that have failed for a given connector type
  1. When all option is provided, the script should display details like check id, name and timestamp of the last failure run
  2. When a connector is provided, the script should display details like check-id, name and timestamp of the last failure for that connector only.

Ability to display audit logs for check runs

unskript-ctl --show-audit-trail [ all | connector | check-id ]

Here the intention is to show

  • All Audit trails recorded in the system detailed passed/failed/errored checks
  • All Audit trails recorded for a given connector in the system detailing passed/failed/errored checks
  • Audit trails recorded for a given check-id in the system detailing passed/failed/errored runs for the given check-id

Ability to list all checks

unskript-ctl --list-checks [all | connector ]

Here the intention is to show

  • All Checks available in the sytem
  • All Checks for a given connector available to run in the system

@jayasimha-raghavan-unskript
Copy link
Member Author

jayasimha-raghavan-unskript commented Feb 28, 2023

Ability to run checks

unskript-ctl --run-checks [all | connector | failing]

Here the intention is to Run

  • All available checks
  • Run all checks for a given connector
  • Run checks that have failed in the past (Re-run failed checks)
  1. When all option is selected, the unskript-ctl should find out all available checks packaged and user defined in the system and run them and report the status against each checks, these result should be logged and the user should be able to display the failed checks and display the logs from the failed checks.

Implementation Notes:

  • Query ZoDB for action_is_check = true This would give all the checks
  1. When a connector is specified, the script should fetch all checks available in the system for that particular connector and run them/report status and log the results for later use.

Implementation Notes:

  • Query ZoDB for action_is_check = true for the given connector
  1. When failed is specified, the script should query ZoDB to find out the last-failed checks. Query would be action_is_check = true && status = failed This would return the failed Check IDs.

Common Implementation

  • Iterate over each snippet and create a temporary runbook with Frist and Last cell added to the snippet
  • Create a mapping of stored connector ID (credential schema id) to connector Name.
    1. Create a new collection called default_credential_id
    2. Load it with data from credential-save folder
  • Need to fill in the task.configure(...) for credentialsJson. The Connector ID stored above will be used to fill in the credentialJson entry for the given connector.
  • Run the temporary runbook,
  • capture the execution result in the Audit log.
  • Process Audit log and update Checks Status in the checks-status table of ZoDB and update the failed_checks timestamp in the last_failed table.

@jayasimha-raghavan-unskript
Copy link
Member Author

PR is in #242

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants