Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# by default, require qlik-cloud-monitoring-apps
* @qlik-oss/qlik-cloud-monitoring-apps
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/repo_bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: 🐛 Bug Report
about: Something isn't working as expected
---

## 🐛 Bug report

(A clear and concise description of what the bug is.)

### Steps to Reproduce

1. (Step one)
1. (Step two)
1. ...

### Expected behavior

(A clear and concise description of what you expected to happen.)

### Actual behavior

(A clear and concise description of what actually happened.)

### Additional context

(Add any other context, link to demo or screenshots about the issue.)
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/repo_feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: 🚀 Feature or Improvement
about: Suggest an idea for a new feature or improvement
---

## 🚀 Feature

(A clear and concise description of what the feature/improvement is.)

### Motivation

(A clear and concise description of why this feature/improvement should be added.)

### Additional context

(Add any other context about the feature/improvement request.)
52 changes: 52 additions & 0 deletions .github/workflows/comment_checklist_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Comment on PR

on:
pull_request:
types: [opened, synchronize]
branches: [ "main" ]

workflow_dispatch:

jobs:
verify:
runs-on: ubuntu-latest
permissions: write-all
if: ${{ github.actor != 'dependabot[bot]' }} && ${{ github.actor != 'renovate[bot]' }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Retrieve app name from release config
run: |
APPNAME=$(jq -r '.name' "release.json")
echo "APPNAME=$APPNAME" >> $GITHUB_ENV

- name: PR comment with file
uses: thollander/actions-comment-pull-request@v2
with:
mode: upsert
comment_tag: previewComment
message: |
# PR checklist

Checklist:

- [ ] Is the name of this app/solution still `${{ env.APPNAME }}`?
- [ ] Have you updated the version tag in each .qvf file, and followed semantic versioning (e.g. v1.1.1)?
- [ ] Is this PR named appropriately? For example:
- Feature release: `feat: add sheet usage event`
- Bug fix: `fix: replaced deprecated events`
- Documentation update: `docs: updated images in install guide`
- [ ] Have you reviewed the unbuilt diff generated by the workflow in /diff?

If you wish to merge and release:

- Have this PR approved by a code owner, then merge into main
- Go to releases, an action will generate a draft release with all files in /assets, and any external assets references in `release.json`
- Make any updates, then submit the release

Common issues:

- After merging, draft release doesn't update - this is usually because
the action failed due to an old draft release with the same name.
Delete the draft release, and re-run the action.
59 changes: 59 additions & 0 deletions .github/workflows/draft_release_on_main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build a draft release

on:
push:
branches: [ "main" ]

workflow_dispatch:

jobs:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
if: ${{ github.actor != 'dependabot[bot]' }} && ${{ github.actor != 'renovate[bot]' }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Retrieve app name & assets from config
run: |
APPNAME=$(jq -r '.name' "release.json")
echo "APPNAME=$APPNAME" >> $GITHUB_ENV
URLS=$(jq -r '.externalAssets[].url' "release.json")

for URL in $URLS; do
FILENAME=$(basename "$URL")
# Perform desired operations with the URL
# Example: Download the file
curl -L -o "./assets/$FILENAME" "$URL"
done

- name: Draft a release
uses: softprops/action-gh-release@v2
with:
name: ${{ env.RELVER }}
body: |
**!Important - review then remove this top section**

- [ ] Verify the resources from /assets are attached correctly to this release
- [ ] Set the tag to a semver matching the release (e.g. `v1.9.3`)
- [ ] Add any comments on breaking changes/ amends to the auto generated release notes below
- [ ] Delete this section

We are pleased to release ${{ env.APPNAME }}. Assets are attached to this release for your convenience.

## What's Changed

The following changes have been made for this release:

- Change 1.
- Change 2.
- Change 3.

draft: true
generate_release_notes: true
fail_on_unmatched_files: true
files: |
./assets/*

121 changes: 121 additions & 0 deletions .github/workflows/unbuild_app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Unbuild app

on:
pull_request:
types: [opened, synchronize]
branches: [ "main" ]
paths:
- 'assets/**'

workflow_dispatch:

jobs:
unbuild:
runs-on: ubuntu-22.04
if: ${{ github.actor != 'dependabot[bot]' }} && ${{ github.actor != 'renovate[bot]' }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Checkout repo
run: echo ${{ github.triggering_actor }}

- name: Download qlik-cli and unzip
run: |
wget https://github.com/qlik-oss/qlik-cli/releases/download/v2.25.0/qlik-Linux-x86_64.tar.gz -O qlik-cli.tar.gz
# Unzip archive
tar -xf qlik-cli.tar.gz
# Remove archive
rm qlik-cli.tar.gz
# Update permissions to execute
chmod +x qlik

- name: Retrieve qlik-cli version
run: ./qlik version

- name: Create context in qlik-cli
run: |
./qlik context create veritenant \
--server ${{ secrets.QLIK_CLOUD_MONITORING_TENANT }} \
--oauth-client-id ${{ secrets.QLIK_CLOUD_MONITORING_OAUTH_ID }} \
--oauth-client-secret ${{ secrets.QLIK_CLOUD_MONITORING_OAUTH_SECRET }} \
--server-type cloud

- name: Select context
run: ./qlik context use veritenant

- name: Delete any existing diff dir
run: rm -rf diff

- name: Config git
run: |
git config --global user.name "qlik[bot]"
git config --global user.email "[email protected]"

- name: Unbuild apps
run: |
shopt -s globstar nocaseglob
qUrl_list=()
for FILE in ./assets/*.qvf; do
FILENAME=$(basename "$FILE")
cp "$FILE" ./import.qvf # Handle for weird filenames and qlik-cli handling

APP_ID=$(./qlik raw post v1/apps/import --body-file "./import.qvf" | jq -r '.attributes.id')
echo "Imported appId $APP_ID"

./qlik app unbuild --app "$APP_ID" --dir "./diff/$FILENAME" --no-data

REPLACE_STRING="<appId>"

find "./diff/$FILENAME" -type f | while read -r UBFILEA; do
if [[ -f "$UBFILEA" ]]; then
sed -i "s/$APP_ID/$REPLACE_STRING/g" "$UBFILEA"
UBFILENAME=$(basename "$UBFILEA")
if [ "$(basename "$UBFILEA")" == "app-properties.json" ]; then
jq 'del(.qSavedInProductVersion)' "${UBFILEA}" > "${UBFILEA}.tmp" && mv "${UBFILEA}.tmp" "${UBFILEA}"
jq 'del(.qLastReloadTime)' "${UBFILEA}" > "${UBFILEA}.tmp" && mv "${UBFILEA}.tmp" "${UBFILEA}"
fi
fi
done

MEDIA_LIST=$(./qlik raw get "v1/apps/$APP_ID/media/list" --query "show=recursive")
IMAGE_LIST=$(echo "$MEDIA_LIST" | jq '[.[] | select(.type == "image") | {name: .name, link: .link}]')
IMAGE_COUNT=$(echo "$IMAGE_LIST" | jq 'length')
IMAGE_STORE_PATH="./diff/$FILENAME/images"
echo "Number of images found: $IMAGE_COUNT"


echo "$IMAGE_LIST" | jq -c '.[]' | while read -r IMAGE; do
if [ ! -d "$IMAGE_STORE_PATH" ]; then
mkdir -p "$IMAGE_STORE_PATH"
echo "Created directory: $IMAGE_STORE_PATH"
fi

IMG_NAME=$(echo "$IMAGE" | jq -r '.name')
IMG_LINK=$(echo "$IMAGE" | jq -r '.link')
IMG_PATH="${IMG_LINK#/api/}"
echo "Retrieving image: $IMG_NAME from: $IMG_PATH"
./qlik raw get "$IMG_PATH" --output-file "$IMAGE_STORE_PATH/$IMG_NAME"
done

./qlik app rm "$APP_ID"

done <<< "$FILE"


- name: Remove qlik-cli
run: rm qlik

- name: Commit /diff if changes
run: |
git add ./diff
GIT_STATUS=$(git status -uno -s)
if [ "$GIT_STATUS" ]; then
echo "git change summary: $GIT_STATUS"
git commit -m "Unbuilt .qvf files into /diff"
git push
else
echo "No changes found in /diff, skipping commit"
fi

48 changes: 47 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,47 @@
# qlik-cloud-report-analyzer
> [!IMPORTANT]
> This project is _community supported_. This means that you should not contact
> Qlik Support for help with these apps. See below for additional information
> on how to raise issues on this repository to ask for help.

# Qlik Cloud Report Analyzer

> **Note**
> This application is one of a set of community built and supported monitoring apps for Qlik Cloud.
> For links to all monitoring apps, visit the [Qlik Cloud Monitoring Apps](https://github.com/qlik-oss/qlik-cloud-monitoring-apps) repository.

The Report Analyzer provides a comprehensive dashboard to analyze metered report metadata across a Qlik Cloud tenant.

![Sheets in the Report Analyzer](/images/Report_Analyzer_Dashboard.png)

It provides information such as:

- xxx

## Installing / Updating

These applications can be installed via an interactive Qlik Application Automation [installer](https://community.qlik.com/t5/Official-Support-Articles/Qlik-Cloud-Monitoring-Apps-Workflow-Guide/ta-p/2134140) or [manually](/../../releases) using the PDF guide.

## Subscription Compatibility

Some monitoring apps are designed for specific Qlik Cloud subscription types. Refer to the compatibility matrix within the [Qlik Cloud Monitoring Apps](https://github.com/qlik-oss/qlik-cloud-monitoring-apps?tab=readme-ov-file#applications) repository.

## Support policy

This app is provided as-is and is not supported by Qlik. Over time, the APIs and
metrics used by the app may change, so it is advised to monitor this repository
for updates, and to update the app promptly when new versions are available.

If you have issues while using this app, support is provided on a best-efforts
basis by contributors to this project.

If you have an issue:

* Review the FAQ section in this readme to see if your issue is a common one
* Review open and closed [issues](/../../issues)
* Open a [new issue](/../../issues/new), following the issue template

If you are able to resolve the issue, then close your issue with the resolution,
and if you feel inclined, open a PR with your proposed changes so that we can
consider including the improvement in the next release of the app.

Thank you for your support!
Binary file added images/Report_Analyzer_Dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions release.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Report Analyzer",
"externalAssets": [
{
"url": "https://github.com/qlik-oss/qlik-cloud-monitoring-apps/releases/latest/download/Qlik-Cloud-Monitoring-Applications-Installation-Guide.pdf"
}
]
}
6 changes: 6 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"local>qlik-oss/renovate-config"
]
}