Skip to content

Commit 61f67b9

Browse files
authored
Minor enhancements and fixes (#27)
* Added CI pipeline * Minor fixes to comply with jquery vulnerabilities and reload trigger for custom conf * Fixed path-parse security vulnerability * Minor changes to README and CONTRIBUTING guidelines
1 parent 6bd5fad commit 61f67b9

13 files changed

+205
-106
lines changed

.github/workflows/ci.yml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- '.github/workflows/manual-release.yml'
7+
8+
jobs:
9+
bundle-app:
10+
name: Bundle App
11+
runs-on: ubuntu-latest
12+
outputs:
13+
app_name: ${{ steps.appinfo.outputs.app_name }}
14+
app_id: ${{ steps.appinfo.outputs.app_id }}
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
19+
- name: Fetch and set app info
20+
id: appinfo
21+
run: |
22+
APP_ID=$(cat app.manifest | jq -r '.info.id.name')
23+
echo "::set-output name=app_id::${APP_ID}"
24+
APP_NAME=$(echo "$APP_ID" | tr _ - )
25+
echo "::set-output name=app_name::${APP_NAME}"
26+
27+
- name: Excluding images from README
28+
run: |
29+
sed -i '/^!/d' README.md
30+
31+
- name: Bundle app source
32+
run: |
33+
mkdir dist
34+
tar -zcvf dist/${{ steps.appinfo.outputs.app_name }}.tgz --exclude='.[^/]*' --exclude=./dist .
35+
36+
- name: Upload artifact
37+
uses: actions/upload-artifact@v2
38+
with:
39+
name: app_tgz
40+
path: dist/${{ steps.appinfo.outputs.app_name }}.tgz
41+
42+
slim-validate:
43+
name: SLIM Validation
44+
needs: bundle-app
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Download artifact
48+
uses: actions/download-artifact@v2
49+
with:
50+
name: app_tgz
51+
52+
- name: Set up Python
53+
uses: actions/setup-python@v2
54+
with:
55+
python-version: 3.7
56+
57+
- name: Install dependencies
58+
run: |
59+
python -m pip install --upgrade pip
60+
pip install splunk-packaging-toolkit
61+
62+
- name: Unpackage artifact
63+
run: |
64+
mkdir ${{ needs.bundle-app.outputs.app_id }}
65+
tar -xf ${{ needs.bundle-app.outputs.app_name }}.tgz -C ${{ needs.bundle-app.outputs.app_id }}
66+
67+
- name: Slim Validate
68+
run: slim validate ${{ needs.bundle-app.outputs.app_id }}
69+
70+
appinspect-cli:
71+
name: AppInspect CLI Validation
72+
needs: bundle-app
73+
runs-on: ubuntu-latest
74+
steps:
75+
- name: Download artifact
76+
uses: actions/download-artifact@v2
77+
with:
78+
name: app_tgz
79+
80+
- name: Unpackage artifact
81+
run: |
82+
mkdir -p build/${{ needs.bundle-app.outputs.app_id }}
83+
tar -xf ${{ needs.bundle-app.outputs.app_name }}.tgz -C build/${{ needs.bundle-app.outputs.app_id }}
84+
85+
- name: Setup Python
86+
uses: actions/setup-python@v2
87+
with:
88+
python-version: 3.7
89+
90+
- name: Install dependencies
91+
run: |
92+
python -m pip install splunk-appinspect
93+
94+
- name: Run AppInspect
95+
run: |
96+
splunk-appinspect inspect ${{ needs.bundle-app.outputs.app_id }} --output-file appinspect.json
97+
exit `cat appinspect.json | jq '.summary.failure'`
98+
working-directory: ./build
99+
100+
# appinspect-api:
101+
# name: AppInspect API Validation
102+
# needs:
103+
# - bundle-app
104+
# - appinspect-cli
105+
# - slim-validate
106+
# runs-on: ubuntu-latest
107+
# # Job not executed if branch is not master
108+
# if: github.ref == 'refs/heads/master'
109+
# steps:
110+
# - name: Download artifact
111+
# uses: actions/download-artifact@v2
112+
# with:
113+
# name: app_tgz
114+
115+
# - name: Run AppInspect
116+
# uses: splunk/appinspect-api-action@v2
117+
# with:
118+
# filePath: ${{ needs.bundle-app.outputs.app_name }}.tgz
119+
# splunkUser: ${{ secrets.SPLUNK_USER }}
120+
# splunkPassword: ${{ secrets.SPLUNK_PASS }}
121+
# includedTags: cloud
122+
# failOnError: true
123+
# failOnWarning: false
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

CONTRIBUTING.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22
Thank you for considering spending your time contributing to the Splunk 3D Graph Network Topology Visualization. Whether you're interested in bug-hunting, documentation, or creating entirely new features, this document will help and guide you through the process.
33

44
## Issues & Bug Reports
5-
If you're seeing some unexpected behavior with this project, please create an [issue](https://github.com/splunk/splunk-3D-graph-network-topology-viz/issues) on GitHub providing the following information:
6-
7-
* Version of the project you're using (e.g. 1.1.0)
8-
* Platform version (e.g. Windows Server 2012 R2)
9-
* Browser and version you're using (e.g. Chrome 80.0.3987)
10-
* Splunk version (e.g. 7.1.0)
11-
* Other relevant information
5+
If you're seeing some unexpected behavior with this project, please create an [issue](https://github.com/splunk/splunk-3D-graph-network-topology-viz/issues) on GitHub selecting the opportune template and providing requested information.
126

137
## Pull Requests
148
We love to see your fixes via pull requests!

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Splunk 3D Graph Network Topology Visualization
22

3+
![Custom badge](https://img.shields.io/endpoint?label=SplunkBase%20Installs&url=https%3A%2F%2Fsplunkbasebadge.livehybrid.com%2Fv1%2Finstalls%2F4611%2F)
4+
[![Actions Status: ci](https://github.com/splunk/splunk-3D-graph-network-topology-viz/actions/workflows/ci.yml/badge.svg)](https://github.com/splunk/splunk-3D-graph-network-topology-viz/actions?query=workflow%3A"CI")
5+
36
Plot relationships between objects with force directed graph based on ThreeJS/WebGL.
47

58
More information around use cases on the following Splunk blogs:
@@ -39,7 +42,7 @@ Besides:
3942
* Any `edge_weight` value higher than `18` will be normalised to `18`
4043

4144
## Examples
42-
![alt text](splunk-3D-graph-network-topology-viz-screen-3.png "Screenshot")
45+
![alt text](.images/splunk-3D-graph-network-topology-viz-screen-3.png "Screenshot")
4346

4447
### Lookup tables
4548
* Add a lookup table defining these additional values to your Splunk instance. An example below:
@@ -59,7 +62,7 @@ Besides:
5962
* Execute your SPL
6063
`<search> | stats count as edge_weight by src dest | eval color_src="#cc0000", color_dest="#00ff00", weight_src=3 | eval edge_color=if(edge_weight < 18, "#0000cc","")`
6164
62-
![alt text](splunk-3D-graph-network-topology-viz-screen-4.png "Example of colored nodes generated by simple SPL")
65+
![alt text](.images/splunk-3D-graph-network-topology-viz-screen-4.png "Example of colored nodes generated by simple SPL")
6366
6467
## Graph Algorithm Examples
6568
@@ -72,9 +75,9 @@ Make sure you have the following Splunk apps installed in your instance to corre
7275
7376
> Give **global** permissions to MLTK app if not already done
7477
75-
![alt text](splunk-3D-graph-network-topology-viz-screen-1.png "Graph Analysis Example of Bitcoin Transactions")
78+
![alt text](.images/splunk-3D-graph-network-topology-viz-screen-1.png "Graph Analysis Example of Bitcoin Transactions")
7679
77-
![alt text](splunk-3D-graph-network-topology-viz-screen-2.png "Graph Analysis Example for Label Propagation Algorithm")
80+
![alt text](.images/splunk-3D-graph-network-topology-viz-screen-2.png "Graph Analysis Example for Label Propagation Algorithm")
7881
7982
## Hardware Acceleration in Browsers
8083
All modern browsers shall have hardware acceleration turned on by default in order to increase your browser performance and free up CPU by leaving the GPU (Graphics Processing Unit) handling graphical intensive operations.

0 commit comments

Comments
 (0)