Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: v5.32.0 release #907

Merged
merged 14 commits into from
Oct 13, 2023
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
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