Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #243 from splunk/ci/common-template-rollout-github…
Browse files Browse the repository at this point in the history
…-actions

ci: bump repository configuration from template-refs/heads/main
  • Loading branch information
mkolasinski-splunk authored May 11, 2023
2 parents d80744f + 255434d commit 0e9b6c4
Show file tree
Hide file tree
Showing 17 changed files with 145 additions and 50 deletions.
File renamed without changes.
Empty file added .appinspect.manualcheck.yaml
Empty file.
3 changes: 3 additions & 0 deletions .github/workflows/.ci-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"template-version": "v1.0.0"
}
8 changes: 6 additions & 2 deletions .github/workflows/agreements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ on:
types: [created]
pull_request_target:
types: [opened, closed, synchronize]

permissions:
actions: read
contents: read
pull-requests: read
statuses: read
jobs:
call-workflow-agreements:
uses: splunk/addonfactory-github-workflows/.github/workflows/reusable-agreements.yaml@v1.2
uses: splunk/addonfactory-github-workflows/.github/workflows/reusable-agreements.yaml@v1.3
secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN: ${{ secrets.PAT_CLATOOL }}
22 changes: 19 additions & 3 deletions .github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,25 @@ on:
pull_request:
branches:
- "**"

types:
- opened
- reopened
- synchronize
- labeled
permissions:
actions: read
checks: write
contents: write
deployments: read
packages: write
pull-requests: read
statuses: write
jobs:
call-workflow:
uses: splunk/addonfactory-workflow-addon-release/.github/workflows/reusable-build-test-release.yml@v2.1
if: github.event.action != 'labeled' || github.event.label.name == 'preserve_infra'
uses: splunk/addonfactory-workflow-addon-release/.github/workflows/reusable-build-test-release.yml@v3.8
secrets:
GH_TOKEN_ADMIN: ${{ secrets.GH_TOKEN_ADMIN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEMGREP_PUBLISH_TOKEN: ${{ secrets.SEMGREP_PUBLISH_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
Expand All @@ -24,3 +36,7 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
OTHER_TA_REQUIRED_CONFIGS: ${{ secrets.OTHER_TA_REQUIRED_CONFIGS }}
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
SA_GH_USER_NAME: ${{ secrets.SA_GH_USER_NAME }}
SA_GH_USER_EMAIL: ${{ secrets.SA_GH_USER_EMAIL }}
SA_GPG_PRIVATE_KEY: ${{ secrets.SA_GPG_PRIVATE_KEY }}
SA_GPG_PASSPHRASE: ${{ secrets.SA_GPG_PASSPHRASE }}
2 changes: 1 addition & 1 deletion .github/workflows/escu-manual-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
call-workflow:
uses: splunk/addonfactory-workflow-addon-release/.github/workflows/reusable-escu-manual-workflow.yml@v2.1
uses: splunk/addonfactory-workflow-escu-test/.github/workflows/reusable-escu-manual-workflow.yml@v1.0
with:
TA_BUILD: ${{ inputs.TA_BUILD }}
TESTS: ${{ inputs.TESTS }}
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,15 @@ tests/functional
.env
src
*_event
*_events
events.pickle
*_wait
!deps/build
!package/appserver/static/js/build
*.log
!tests/**/*.log
trace.*
*_events.lock

# ucc ui extensions
yarn-error.log
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
- id: end-of-file-fixer
exclude: ^(tests/requirement_test/logs|tests/knowledge/samples|tests/escu/.escu_detections)
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 22.8.0
hooks:
- id: black
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
Expand Down
8 changes: 7 additions & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@
],
"plugins": [
"@semantic-release/commit-analyzer",
[
"@semantic-release/exec",
{
"verifyReleaseCmd": "echo \"version=${nextRelease.version}\" >> $GITHUB_OUTPUT",
"successCmd": "echo \"new_release_published=${'true'}\" >> $GITHUB_OUTPUT",
}
],
"@semantic-release/release-notes-generator",
["@semantic-release/exec", {}],
[
"@semantic-release/git",
{
Expand Down
4 changes: 4 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ License: LicenseRef-Splunk-8-2021
Files: *.lock
Copyright: $YEAR $NAME <$CONTACT>
License: LicenseRef-Splunk-8-2021

Files: renovate.json
Copyright: $YEAR $NAME <$CONTACT>
License: LicenseRef-Splunk-8-2021
5 changes: 1 addition & 4 deletions Dockerfile-splunk-local
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ ARG SPLUNK_APP_PACKAGE=$SPLUNK_APP_PACKAGE
RUN echo Splunk VERSION=$SPLUNK_VERSION

COPY deps/apps /opt/splunk/etc/apps/
COPY deps/build/addonfactory_test_matrix_splunk/packages/all/common /opt/splunk/etc/apps/
COPY deps/build/addonfactory_test_matrix_splunk/packages/all/sh /opt/splunk/etc/apps/
COPY deps/build/addonfactory_test_matrix_splunk/packages/all/addon_factory_web /opt/splunk/etc/system/local
COPY $SPLUNK_APP_PACKAGE /opt/splunk/etc/apps/$SPLUNK_APP_ID

COPY .pytest.expect /home/circleci/work_backend/.pytest.expect
COPY tests /home/circleci/work_backend/tests
COPY tests /home/circleci/work_backend/tests
7 changes: 4 additions & 3 deletions Dockerfile-uf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG SPLUNK_VERSION=latest
FROM splunk/universalforwarder:$SPLUNK_VERSION
ARG SPLUNK_VERSION=latest
# hardcoded SPLUNK_VERSION due to connection issues in versions > 9.0.0
ARG SPLUNK_VERSION=8.2.6
FROM splunk/universalforwarder:8.2.6
ARG SPLUNK_VERSION=8.2.6
ARG SPLUNK_APP_ID=TA_UNKNOWN
ARG SPLUNK_APP_PACKAGE=$SPLUNK_APP_PACKAGE
RUN echo Splunk VERSION=$SPLUNK_VERSION
Expand Down
34 changes: 2 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
## Setup of developer env
# Add-on documentation

Note: Must install docker desktop, vscode or pycharm pro optional

Note2: Appinspect requires libmagic verify this has been installed correctly each time a new workstation/vm is used https://dev.splunk.com/enterprise/docs/releaseapps/appinspect/splunkappinspectclitool/installappinspect

```bash
git clone git@github.com:splunk/<repo slug>.git
cd <repo dir>
git submodule update --init --recursive

#setup python venv must be 3.7
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements_dev.txt
pip install https://download.splunk.com/misc/appinspect/splunk-appinspect-latest.tar.gz

```


## Test

Using docker

```bash
pytest
```

Using external Splunk instance with Eventgen and app pre-installed

```bash
pytest --splunk-type=external --splunk-host=something --splunk-user=foo --splunk-password=something
```
For general add-on documentation please follow use this [README](https://github.com/splunk/addonfactory-repository-template/blob/main/README-addons.md) file.
2 changes: 1 addition & 1 deletion docker-compose-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ services:
- results:/home/circleci/work

sc4s:
image: splunk/scs:${SC4S_VERSION}
image: ghcr.io/splunk/splunk-connect-for-syslog/container2:${SC4S_VERSION}
hostname: sc4s
#When this is enabled test_common will fail
# command: -det
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ services:
- results:/home/circleci/work

sc4s:
image: splunk/scs:${SC4S_VERSION}
image: ghcr.io/splunk/splunk-connect-for-syslog/container2:${SC4S_VERSION}
hostname: sc4s
#When this is enabled test_common will fail
# command: -det
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ license = "Splunk-1-2020"
[tool.poetry.dependencies]
python = "^3.7"

[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]
lovely-pytest-docker = "^0.2.1"
pytest-expect = "^1.1.0"
pytest-rerunfailures = "^10.1"
Expand Down
89 changes: 89 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
":semanticCommitTypeAll(ci)"
],
"prConcurrentLimit": 0,
"prHourlyLimit": 0,
"rangeStrategy": "pin",
"dependencyDashboardApproval": true,
"transitiveRemediation": true,
"enabledManagers": ["poetry", "npm", "gradle"],
"separateMinorPatch": true,
"labels": ["dependencies"],
"semanticCommits": "enabled",
"lockFileMaintenance": {
"enabled": true,
"extends": [
"schedule:daily"
]
},
"vulnerabilityAlerts": {
"labels": ["dependencies", "security"]
},
"packageRules": [
{
"groupName": "splunk dependencies",
"matchPackageNames": [
"splunktaucclib",
"splunktalib",
"splunk-add-on-ucc-framework",
"pytest-splunk-addon",
"splunk-packaging-toolkit",
"pytest-splunk-addon-ui-smartx",
"solnlib"
],
"matchUpdateTypes": ["minor", "patch"],
"labels": ["dependencies", "splunk-packages", "minor", "patch"]
},
{
"matchUpdateTypes": ["patch"],
"matchManagers": ["poetry"],
"groupName": "python dependencies",
"labels": ["dependencies", "python", "patch"]
},
{
"matchUpdateTypes": ["minor"],
"matchManagers": ["poetry"],
"labels": ["dependencies", "python", "minor"]
},
{
"matchUpdateTypes": ["major"],
"matchManagers": ["poetry"],
"labels": ["dependencies", "python", "major"]
},
{
"matchUpdateTypes": ["patch"],
"matchManagers": ["npm"],
"groupName": "javascript dependencies",
"labels": ["dependencies", "javascript", "patch"]
},
{
"matchUpdateTypes": ["minor"],
"matchManagers": ["npm"],
"labels": ["dependencies", "javascript", "minor"]
},
{
"matchUpdateTypes": ["major"],
"matchManagers": ["npm"],
"labels": ["dependencies", "javascript", "major"]
},
{
"matchUpdateTypes": ["patch"],
"matchManagers": ["gradle"],
"groupName": "java dependencies",
"labels": ["dependencies", "java", "patch"]
},
{
"matchUpdateTypes": ["minor"],
"matchManagers": ["gradle"],
"labels": ["dependencies", "java", "minor"]
},
{
"matchUpdateTypes": ["major"],
"matchManagers": ["gradle"],
"labels": ["dependencies", "java", "major"]
}
]
}

0 comments on commit 0e9b6c4

Please sign in to comment.