Skip to content

Utilities

Introduction

Some of the user’s actions in the platform are not reflected directly when running integrates locally, and are also not caught by our unit tests. Some examples of this are:

  1. Asynchronous tasks that use batch.
  2. Use external resources to send information to the user via email or message. This includes sending event report emails, downloading executive files, cloning a repository, etc.

To implement a new feature or for debugging purposes, it is important to know the result of such tasks before deploying to production.

Batch asynchronous tasks

There are known asynchronous tasks in the platform such as: cloning roots, doing rebase in a repository, downloading files, updating group or organization policies, etc. Taking as an example the case of updating the download of an executive report, we will follow the next steps to obtain the pdf file locally.

  • Select the option to download the report from the platform in locathost:8001, and follow the steps to send a verification code.
Executive report-light Executive report-dark
  • We can see the task is queued in the download center pending execution.
Download center-light Download center-dark
  • Using the application of NoSQL Workbench we find the pk id of the task we just queued with the related action report.
NoSQL workbench-light NoSQL workbench-dark
  • Finally we run the terminal command, afterwards we will see the report available in the local platform.
Terminal window
m . /integrates/batch hacker "task_id"

Mailing templates

To check the html result when sending email reports you can:

  • Adjust the file integrates/back/integrates/mailer/common.py to print the content and allow to process test groups.
  • Run the following command to get the output file in VSCode.
Terminal window
m . /integrates/back dev > output.txt