Skip to main content
Announcements
Talend Data Catalog 8.0 End of Support: December 31, 2024 Get Details

Qlik Application Automation:Verify load script in Qlik Sense app from new GitHub pull request

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
AfeefaTk
Support
Support

Qlik Application Automation:Verify load script in Qlik Sense app from new GitHub pull request

Last Update:

Apr 25, 2023 7:54:36 AM

Updated By:

AfeefaTk

Created date:

Aug 4, 2022 4:36:57 AM

Attachments

This article gives an overview of verifying the load script of the Qlik Sense app from new Github pull request using Qlik Application Automation. It explains a basic example of a template configured in Qlik Application Automation for this scenario

You can make use of the template which is already available in the template picker

You can find it by navigating to Add new -> New automation -> Search templates and search for 'Verify load script in Qlik Sense app from new GitHub pull request' in the search bar and click on the Use template option in order to use it in the automation

verify-load-script-template.png

Environment

Before you begin, you'll need the following:

  • Qlik Sense app in a shared space
  • GitHub repository with a copy of the shared app's load script as a text file

Steps:

The following steps describe how to build the demo automation. You can also find an exported version of this automation attached to this article as "Verify-Qlik-Sense-app-load-script-from-new-GitHub-pull-request.json".

  1. Configure new automation to be webhook triggered on every new pull request in the GitHub repo.

    On-new-pull-request.png

  2. Add a condition block to check whether the new pull request was opened and stop automation if the pull request was not opened. You can change the condition to use other actions from the pull request (like 'synchronize'). Or use the 'Add condition' option for multiple actions. 

    condition-block-pull-request-opened.png

  3. Get the load script from the file using the 'Get File Content' block. In this example, there's only one file so the first file from the List Pull Request Files block is used. If you have multiple files, use the Lookup Item In List block to find a specific file. 

    get-file-content.png
  4. Create a new (temporary) app and set the load script from the pull request as this app's load script. When retrieving files from GitHub, they're base64 encoded by default. Use the Base64 Decode formula from the formula picker to decode the file's content before setting the load script.

    set-load-script-block.png

  5. Reload & delete the temporary app and evaluate the reload's outcome:
    1. If the reload is successful, alert your team via slack with a success message and use Add Pull Request Review block to comment on the pull request that the load script test has succeeded 

      reload-succeeded-condition-block.png

    2. If the reload fails, alert your team via slack with a failure message and use Add Pull Request Review block to request changes on the pull request

      add-pull-request-review.png

A JSON file containing the above automation is attached to this article.

Please follow the steps provided in How to import  automation from a JSON file  article to import the automation

Related Content 

Labels (2)
Comments
mattgow
Contributor II
Contributor II

If I understand correctly, I should

  • Configure the start block with my github repo/account information
  • Ensure there is a valid github connector working
  • Run the automation once in order to have the webhook configured on the GitHub side?

As far as I can tell, the webhook isn't getting created in GitHub. Certainly no pull requests are triggering the automation and I can't see an webhooks listed in the configuration of the repository in github.

Any debugging tips you could help me with?

mattgow
Contributor II
Contributor II

I can manually create a webhook on the repo via GitHub and then set up the Qlik side with a generic webhook start block... but it would be cool if I could figure out what I'm doing wrong with the official GitHub webhook start block.

I am able to use the "list my repositories" block to confirm that the repo in question is available to me... so clearly some things work.

 

mattgow
Contributor II
Contributor II

Worked it out. I was putting the wrong "owner". The account being used to connect to Github is an owner of the repositories in question but when configuring the connector "owner" means the owner in the path to the repository i.e. github.com/<owner>/repository

Fixed.

Contributors
Version history
Last update:
‎2023-04-25 07:54 AM
Updated by: