Skip to content

Commit

Permalink
feat: v5.32.0 release (#907)
Browse files Browse the repository at this point in the history
* ci: don't release from develop

* ci: run poetry publish without using a separate action (#897)

* docs: document .uccignore feature (#898)

* feat: add optional query param to endpoint (#889)

feat: based on config in globalConfig.json

add possibility to append token_access_type to oauth endpoint with specific value

* fix(dashboard): adds splunk_server=local when getting add-on version (#899)

Related docs: https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Rest

Related PR: splunk/splunk-add-on-for-microsoft-365-defender#314

* fix: add ":gz" flag to tarfile.open to add compression (#901)

* fix(code): fix child keys warning (#895)

* fix(code): fix child keys warning

* fix: add validation to prevent duplicates in groups.labels

---------

Co-authored-by: vtsvetkov-splunk <142901247+vtsvetkov-splunk@users.noreply.github.com>
Co-authored-by: Artem Rys <rysartem@gmail.com>

* ci: build storybook to docs (#888)

* ci: refactor ui workflows

* ci: refactor ui workflows

* ci: refactor ui workflows

* ci: refactor ui workflows

* add shell bash

* add cd

* composite action to reusable workflow

* composite action to reusable workflow

* composite action to reusable workflow

* composite action to reusable workflow

* add storybook build

* fix(warning): replaced warnings with logging library (#908)

* fix(warning): replaced warnings with logging library

* fix: use warning instead of deprecated method warn

* feat: file component support file deletion (#886)

* feat: file component support file deletion

during edition or cloning add possibility to remove existing file

* feat: add tests, move to ts, check early for file

add tests for fileNameToDisplay property and ecrypted
move from jsx to tsx files
check for file type and data asap when loading form
thanks to that fileNameToDisplay is loaded for all mods
not only edit and clone

* fix: fix test data for globalConfig.json

* fix: review

* test: fix unit tests after #908 (#909)

* ui: pin splunk/addonfactory-test-matrix-action to 1.10 (#910)

Pinning to this version to avoid testing with unreleased Splunk version.

* feat(CheckboxGroup): ADDON-61556 add defaultValue for checkbox (#904)

* fix(CheckboxGroup): fix required validation (#911)

---------

Co-authored-by: soleksy-splunk <143183665+soleksy-splunk@users.noreply.github.com>
Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
Co-authored-by: Harshit Gajipara <77769935+Harshit1q1@users.noreply.github.com>
Co-authored-by: vtsvetkov-splunk <142901247+vtsvetkov-splunk@users.noreply.github.com>
  • Loading branch information
5 people authored Oct 13, 2023
1 parent 02a9d4f commit f691ce0
Show file tree
Hide file tree
Showing 47 changed files with 1,004 additions and 693 deletions.
29 changes: 29 additions & 0 deletions .github/actions/cached-ui-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Get & Cache Yarn Dependencies"
description: "Get & Cache Yarn Dependencies"
inputs:
node-version:
description: "Node version"
required: true

runs:
using: composite
steps:
- run: npm install --global yarn
shell: bash
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
shell: bash
- name: Cache Dependencies
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('ui/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ inputs.node-version }}
- name: Install Dependencies
working-directory: ui
run: yarn install --frozen-lockfile
shell: bash
27 changes: 27 additions & 0 deletions .github/workflows/build-storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Build Storybook"
on:
workflow_call:

jobs:
build-storybook:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ui
shell: bash
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
- name: install deps
uses: ./.github/actions/cached-ui-deps
with:
node-version: ${{ inputs.node-version }}
- name: Build UCC UI
run: yarn run build-storybook
- name: Upload dist with name UCC-UI-build
uses: actions/upload-artifact@v3
with:
name: UCC-UI-storybook
path: ui/storybook-static
49 changes: 10 additions & 39 deletions .github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
pull_request:
branches: [main, develop, "release/**"]
branches: [ main, develop, "release/**" ]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
Expand All @@ -23,7 +23,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- id: matrix
uses: splunk/addonfactory-test-matrix-action@v1
uses: splunk/addonfactory-test-matrix-action@v1.10

fossa-scan:
continue-on-error: true
Expand Down Expand Up @@ -70,43 +70,15 @@ jobs:
- uses: apache/skywalking-eyes@v0.5.0

build-ui:
runs-on: ubuntu-latest
name: Build UCC UI
strategy:
matrix:
node-version:
- "18"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.7"
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install --global yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('ui/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ matrix.node-version }}
- name: Build UCC UI
run: |
cd ui/
yarn
yarn run lint
yarn run test
yarn run build
yarn list --prod --depth 0 | python ../.github/scripts/format_yarn_deps.py --output-file=dist/package/appserver/static/js/dependencies.txt
cd ../
- uses: actions/upload-artifact@v3
with:
name: UCC-UI-build
path: ui/dist/
uses: ./.github/workflows/build-ui.yml
with:
node-version: ${{ matrix.node-version }}


build:
needs:
Expand Down Expand Up @@ -364,7 +336,6 @@ jobs:
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 }}
37 changes: 37 additions & 0 deletions .github/workflows/build-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Build UI"
on:
workflow_call:
inputs:
node-version:
required: true
type: string

jobs:
build-ui:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ui
shell: bash
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
- name: install deps
uses: ./.github/actions/cached-ui-deps
with:
node-version: ${{ inputs.node-version }}
- name: Code linting
run: yarn run lint
- name: Unit test
run: yarn run test
- name: Build UCC UI
run: yarn run build
- name: List deps into dependencies.txt
run: yarn list --prod --depth 0 | python ../.github/scripts/format_yarn_deps.py --output-file=dist/package/appserver/static/js/dependencies.txt
- name: Upload dist with name UCC-UI-build
uses: actions/upload-artifact@v3
with:
name: UCC-UI-build
path: ui/dist/
5 changes: 5 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: 3.7
- uses: ./.github/workflows/build-storybook.yml
- uses: actions/download-artifact@v3
with:
name: UCC-UI-storybook
path: docs/storybook
- run: |
curl -sSL https://install.python-poetry.org | python3 - --version 1.5.1
poetry install
Expand Down
1 change: 0 additions & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
[
"+([0-9])?(.{+([0-9]),x}).x",
"main",
{ name: "develop", prerelease: "beta", channel: "beta" },
],
plugins:
[
Expand Down
4 changes: 3 additions & 1 deletion docs/advanced/oauth_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Auth can be used inside the entity tag. Use `type: "oauth"` in the entity list a
- `oauth_popup_height` height in pixels of the popup window that will open for oauth authentication (Optional, defaults to 600)
- `oauth_timeout` timeout in seconds for oauth authentication (Optional, defaults to 180 seconds)
- `oauth_state_enabled` to include state for oauth authentication (default value is false)
- `auth_endpoint_token_access_type` optional parameter that is mapped into value of token_access_type query param in authorisation url

- Fields allowed in basic and oauth fields as of now:
- `oauth_field`: This should be kept as it is and without any change.
Expand Down Expand Up @@ -125,7 +126,8 @@ Auth can be used inside the entity tag. Use `type: "oauth"` in the entity list a
"oauth_popup_height": 600,
"oauth_timeout": 180,
"auth_code_endpoint": "/services/oauth2/authorize",
"access_token_endpoint": "/services/oauth2/token"
"access_token_endpoint": "/services/oauth2/token",
"auth_endpoint_token_access_type": "offline"
}
}
],
Expand Down
41 changes: 12 additions & 29 deletions docs/entity/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,52 +265,35 @@ Example usage below:
"isExpandable": true,
"expand": true
},
"fields": ["disabledRowUnderGroup3"]
"fields": ["field223", "160validation"]
}
],
"rows": [
{
"field": "rowUnderGroup1",
"checkbox": {
"label": "Row under Group 1"
},
"text": {
"defaultValue": 1200,
"required": false
}
},
{
"field": "rowWithoutGroup",
"text": {
"input": {
"defaultValue": 1,
"required": true
}
},
{
"field": "disabledRowUnderGroup3",
"field": "rowUnderGroup1",
"checkbox": {
"options": {
"enable": false
}
"label": "Row under Group 1",
"defaultValue": true
},
"text": {
"defaultValue": 1,
"required": true
}
},
{
"field": "rowWithoutGroup_2",
"text": {
"defaultValue": 3600,
"required": true
"input": {
"defaultValue": 1200,
"required": false
}
},
{
"field": "field223",
"checkbox": {
"label": "Required field"
"label": "Required field",
"defaultValue": true
},
"text": {
"input": {
"required": true
}
},
Expand All @@ -319,7 +302,7 @@ Example usage below:
"checkbox": {
"label": "from 1 to 60 validation"
},
"text": {
"input": {
"validators": [
{
"type": "number",
Expand Down
Binary file modified docs/images/components/checkbox_group_mixed_example.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 docs/uccignore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# `.uccignore` file

This feature can be used to remove files from the output **after** UCC template files were copied and **before** the source of the
add-on recursively overrides the output folder.

It is expected to be placed in the same folder as `globalConfig` file to have effect.

You will see a warning message in case ignored file is not found in the output folder.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ nav:
- Validators: "entity/validators.md"
- Table: "table.md"
- Additional packaging: "additional_packaging.md"
- UCC Ignore: "uccignore.md"
- OpenAPI: "openapi.md"
- UCC-related libraries: "ucc_related_libraries.md"
- Custom UI Extensions:
Expand Down
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ license = "Apache-2.0"
authors = ["Splunk <addonfactory@splunk.com>"]
include = ["NOTICE"]
readme = "README.md"
repository = "https://github.com/splunk/addonfactory-ucc-generator"
homepage = "https://github.com/splunk/addonfactory-ucc-generator"
keywords = ["splunk"]
repository = "https://github.com/splunk/addonfactory-ucc-generator"
documentation = "https://splunk.github.io/addonfactory-ucc-generator"
keywords = ["splunk", "ucc"]
classifiers = [
"Programming Language :: Python",
"Development Status :: 5 - Production/Stable",
Expand All @@ -34,6 +35,9 @@ classifiers = [
"License :: OSI Approved :: Apache Software License"
]

[tool.poetry.urls]
"Bug Tracker" = "https://github.com/splunk/addonfactory-ucc-generator/issues"

[tool.poetry.dependencies]
python = "^3.7"
jinja2 = ">=2,<4"
Expand Down
2 changes: 1 addition & 1 deletion splunk_add_on_ucc_framework/commands/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def _remove_listed_files(ignore_list: List[str]) -> None:
elif os.path.isdir(path):
shutil.rmtree(path, ignore_errors=True)
else:
logger.info(
logger.warning(
"While ignoring the files mentioned in .uccignore {} was not found".format(
path
)
Expand Down
2 changes: 1 addition & 1 deletion splunk_add_on_ucc_framework/commands/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def package(path_to_built_addon: str, output_directory: Optional[str] = None) ->
archive_path = os.path.join(
output_directory, f"{addon_name}-{addon_version}.tar.gz"
)
with tarfile.open(archive_path, mode="w", encoding="utf-8") as archive_file:
with tarfile.open(archive_path, mode="w:gz", encoding="utf-8") as archive_file:
logger.info(path_to_built_addon)
archive_file.add(path_to_built_addon, arcname=addon_name)
logger.info(f"Package exported to {archive_path}")
2 changes: 1 addition & 1 deletion splunk_add_on_ucc_framework/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<title>Add-on version</title>
<single>
<search>
<query>| rest services/apps/local/{addon_name} | fields version</query>
<query>| rest services/apps/local/{addon_name} splunk_server=local | fields version</query>
<earliest>-15m</earliest>
<latest>now</latest>
</search>
Expand Down
Loading

0 comments on commit f691ce0

Please sign in to comment.