Skip to content

Commit

Permalink
chore: merge branch 'develop' into feat/restructure-file-generation
Browse files Browse the repository at this point in the history
  • Loading branch information
hetangmodi-crest committed Aug 5, 2024
2 parents 250b444 + 2463eca commit cfac087
Show file tree
Hide file tree
Showing 20 changed files with 6,462 additions and 7,120 deletions.
12,560 changes: 5,953 additions & 6,607 deletions NOTICE

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## [5.48.2](https://github.com/splunk/addonfactory-ucc-generator/compare/v5.48.1...v5.48.2) (2024-07-25)


### Bug Fixes

* **inputs:** fix parsing '0' as false for readonlyField and hideField ([#1290](https://github.com/splunk/addonfactory-ucc-generator/issues/1290)) ([ec676a1](https://github.com/splunk/addonfactory-ucc-generator/commit/ec676a1f7ca4a63e111aca355610161bc9e0fc1d))
* **NumberValidator:** Number validators allows integer value ([#1293](https://github.com/splunk/addonfactory-ucc-generator/issues/1293)) ([dbd287c](https://github.com/splunk/addonfactory-ucc-generator/commit/dbd287c406957867da1c01a7804a314242de420a)), closes [#876](https://github.com/splunk/addonfactory-ucc-generator/issues/876)

# [5.48.1](https://github.com/splunk/addonfactory-ucc-generator/compare/v5.48.0...v5.48.1) (2024-07-11)


Expand Down
12 changes: 6 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

[tool.poetry]
name = "splunk_add_on_ucc_framework"
version = "5.48.1"
version = "5.48.2"
description = "Splunk Add-on SDK formerly UCC is a build and code generation framework"
license = "Apache-2.0"
authors = ["Splunk <[email protected]>"]
Expand Down Expand Up @@ -53,7 +53,7 @@ mkdocs = "^1.4.2"
importlib-metadata = {version="*", python="<3.8"}
pytest = "^7.2.1"
pytest-splunk-addon = "^5.0.0"
pytest-splunk-addon-ui-smartx = "3.1.2"
pytest-splunk-addon-ui-smartx = "^5.0.0"
pytest-rerunfailures = "^11.1.1"
mkdocs-material = "^9.1.3"
mkdocstrings = {version=">=0", extras=["python"]}
Expand Down
2 changes: 1 addition & 1 deletion splunk_add_on_ucc_framework/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "5.48.1"
__version__ = "5.48.2"

import logging

Expand Down
6 changes: 3 additions & 3 deletions splunk_add_on_ucc_framework/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@

table_input_query = (
'| rest splunk_server=local /services/data/inputs/all | where $eai:acl.app$ = \\"{addon_name}\\" '
'| eval Enabled=if(lower(disabled) IN (\\"1\\", \\"true\\", \\"t\\"), \\"no\\", \\"yes\\") '
'| table title, Enabled | rename title as \\"event_input\\" | join type=left event_input [ '
'| eval Active=if(lower(disabled) IN (\\"1\\", \\"true\\", \\"t\\"), \\"no\\", \\"yes\\") '
'| table title, Active | rename title as \\"event_input\\" | join type=left event_input [ '
"search index = _internal source=*{addon_name_lowercase}* action=events_ingested "
"| stats latest(_time) as le, sparkline(sum(n_events)) as sparkevent, sum(n_events) as events by event_input "
'| eval \\"Last event\\" = strftime(le, \\"%e %b %Y %I:%M%p\\") ] | makemv delim=\\",\\" sparkevent '
'| table event_input, Enabled, events, sparkevent, \\"Last event\\" '
'| table event_input, Active, events, sparkevent, \\"Last event\\" '
'| rename event_input as \\"Input\\", events as \\"Number of events\\", sparkevent as \\"Event trendline\\"'
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@
"label": "Status",
"field": "disabled",
"mapping": {
"true": "Disabled",
"false": "Enabled"
"true": "Inactive",
"false": "Active"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@
"label": "Status",
"field": "disabled",
"mapping": {
"true": "Disabled",
"false": "Enabled"
"true": "Inactive",
"false": "Active"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1393,8 +1393,8 @@
"label": "Status",
"field": "disabled",
"mapping": {
"true": "Disabled",
"false": "Enabled"
"true": "Inactive",
"false": "Active"
}
},
{
Expand Down
48 changes: 24 additions & 24 deletions tests/ui/test_input_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def test_inputs_more_info(
"Name": "dummy_input_one",
"Interval": f"{interval} sec",
"Index": "default",
"Status": "Enabled",
"Status": "Active",
"Example Account": "test_input",
"Object": "test_object",
"Object Fields": "test_field",
Expand Down Expand Up @@ -331,7 +331,7 @@ def test_inputs_enable_disable(
)
self.assert_util(
input_page.table.get_cell_value,
"Disabled",
"Inactive",
left_args={"name": "dummy_input_one", "column": "Status"},
)
self.assert_util(
Expand All @@ -341,7 +341,7 @@ def test_inputs_enable_disable(
)
self.assert_util(
input_page.table.get_cell_value,
"Enabled",
"Active",
left_args={"name": "dummy_input_one", "column": "Status"},
)

Expand Down Expand Up @@ -1066,7 +1066,7 @@ def test_example_input_one_add_frontend_backend_validation(
"account": "test_input",
"interval": "90",
"index": "default",
"status": "Enabled",
"status": "Active",
"actions": "Edit | Clone | Search | Delete",
},
)
Expand Down Expand Up @@ -1139,7 +1139,7 @@ def test_example_input_one_edit_frontend_backend_validation(
"account": "test_input",
"interval": "3600",
"index": "main",
"status": "Enabled",
"status": "Active",
"actions": "Edit | Clone | Search | Delete",
},
)
Expand Down Expand Up @@ -1218,7 +1218,7 @@ def test_example_input_one_clone_frontend_backend_validation(
"account": "test_input",
"interval": "180",
"index": "default",
"status": "Enabled",
"status": "Active",
"actions": "Edit | Clone | Search | Delete",
},
)
Expand Down Expand Up @@ -1877,7 +1877,7 @@ def test_example_input_two_add_frontend_backend_validation(
"account": "test_input",
"interval": "90",
"index": "main",
"status": "Enabled",
"status": "Active",
"actions": "Edit | Clone | Search | Delete",
},
)
Expand Down Expand Up @@ -1936,7 +1936,7 @@ def test_example_input_two_edit_frontend_backend_validation(
"account": "test_input",
"interval": "3600",
"index": "main",
"status": "Enabled",
"status": "Active",
"actions": "Edit | Clone | Search | Delete",
},
)
Expand Down Expand Up @@ -2004,7 +2004,7 @@ def test_example_input_two_clone_frontend_backend_validation(
"account": "test_input",
"interval": "180",
"index": "main",
"status": "Enabled",
"status": "Active",
"actions": "Edit | Clone | Search | Delete",
},
)
Expand Down Expand Up @@ -2262,13 +2262,13 @@ def test_inputs_enable_all_title_message(
input_page.interact_all_prompt_entity.prompt_title.container.get_attribute(
"textContent"
).strip(),
"Enable all",
"Activate all",
)
self.assert_util(
input_page.interact_all_prompt_entity.prompt_message.container.get_attribute(
"textContent"
).strip(),
"Do you want to enable all? It may take a while.",
"Do you want to activate all? It may take a while.",
)

@pytest.mark.execute_enterprise_cloud_true
Expand All @@ -2284,13 +2284,13 @@ def test_inputs_disable_all_title_message(
input_page.interact_all_prompt_entity.prompt_title.container.get_attribute(
"textContent"
).strip(),
"Disable all",
"Deactivate all",
)
self.assert_util(
input_page.interact_all_prompt_entity.prompt_message.container.get_attribute(
"textContent"
).strip(),
"Do you want to disable all? It may take a while.",
"Do you want to deactivate all? It may take a while.",
)

@pytest.mark.execute_enterprise_cloud_true
Expand All @@ -2300,7 +2300,7 @@ def test_inputs_enable_all_close(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_input_one
):
"""
Verifies that closing the 'Enable All' prompt behaves correctly.
Verifies that closing the 'Activate All' prompt behaves correctly.
"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
input_page.enable_all_inputs()
Expand All @@ -2313,7 +2313,7 @@ def test_inputs_disable_all_close(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_input_one
):
"""
Verifies that closing the 'Disable All' prompt behaves correctly.
Verifies that closing the 'Deactivate All' prompt behaves correctly.
"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
input_page.disable_all_inputs()
Expand All @@ -2326,13 +2326,13 @@ def test_inputs_enable_all_deny(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_input_one
):
"""
Verifies that when 'Enable All' is followed by 'Deny,' inputs remain disabled.
Verifies that when 'Activate All' is followed by 'Deny,' inputs remain disabled.
"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
inputs_enabled_table = input_page.table.get_table()
inputs_disabled_table = copy.deepcopy(inputs_enabled_table)
for i in inputs_disabled_table:
inputs_disabled_table[i]["status"] = "Disabled"
inputs_disabled_table[i]["status"] = "Inactive"
input_page.disable_all_inputs()
input_page.interact_all_prompt_entity.confirm()
input_page.enable_all_inputs()
Expand All @@ -2346,7 +2346,7 @@ def test_inputs_disable_all_deny(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_input_one
):
"""
Verifies that when 'Disable All' is followed by 'Deny,' inputs remain enabled.
Verifies that when 'Deactivate All' is followed by 'Deny,' inputs remain enabled.
"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
inputs_enabled_table = input_page.table.get_table()
Expand All @@ -2360,12 +2360,12 @@ def test_inputs_disable_all_deny(
def test_inputs_disable_enable_all(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_multiple_inputs
):
"""Verifies that all inputs are disabled after clicking 'Disable all'"""
"""Verifies that all inputs are disabled after clicking 'Deactivate all'"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
inputs_enabled_table = input_page.table.get_table()
inputs_disabled_table = copy.deepcopy(inputs_enabled_table)
for i in inputs_disabled_table:
inputs_disabled_table[i]["status"] = "Disabled"
inputs_disabled_table[i]["status"] = "Inactive"
input_page.disable_all_inputs()
input_page.interact_all_prompt_entity.confirm()
time.sleep(10)
Expand All @@ -2387,14 +2387,14 @@ def test_inputs_disable_all_enable_all_input_one_input_two(
):
"""
Verifies that various types of inputs are correctly disabled and enabled
when using the 'Disable All' and 'Enable All' buttons.
when using the 'Deactivate All' and 'Activate All' buttons.
This test covers scenarios with both Input One and Input Two added.
"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
inputs_enabled_table = input_page.table.get_table()
inputs_disabled_table = copy.deepcopy(inputs_enabled_table)
for i in inputs_disabled_table:
inputs_disabled_table[i]["status"] = "Disabled"
inputs_disabled_table[i]["status"] = "Inactive"
input_page.disable_all_inputs()
input_page.interact_all_prompt_entity.confirm()
time.sleep(1)
Expand Down Expand Up @@ -2448,7 +2448,7 @@ def test_inputs_disable_all_some_already_disabled(
inputs_enabled_table = input_page.table.get_table()
inputs_disabled_table = copy.deepcopy(inputs_enabled_table)
for i in inputs_disabled_table:
inputs_disabled_table[i]["status"] = "Disabled"
inputs_disabled_table[i]["status"] = "Inactive"
self.assert_util(
input_page.table.input_status_toggle,
True,
Expand All @@ -2466,7 +2466,7 @@ def test_inputs_textarea_height(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_input_one
):
"""
Verifies that textarea height values
Verifies that textarea height values.
"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
input_page.table.edit_row("dummy_input_one")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
},
{
"label": "Input",
"value": "| rest splunk_server=local /services/data/inputs/all | where $eai:acl.app$ = \"Splunk_TA_UCCExample\" | eval Enabled=if(lower(disabled) IN (\"1\", \"true\", \"t\"), \"no\", \"yes\") | table title, Enabled | rename title as \"event_input\" | join type=left event_input [ search index = _internal source=*splunk_ta_uccexample* action=events_ingested | stats latest(_time) as le, sparkline(sum(n_events)) as sparkevent, sum(n_events) as events by event_input | eval \"Last event\" = strftime(le, \"%e %b %Y %I:%M%p\") ] | makemv delim=\",\" sparkevent | table event_input, Enabled, events, sparkevent, \"Last event\" | rename event_input as \"Input\", events as \"Number of events\", sparkevent as \"Event trendline\""
"value": "| rest splunk_server=local /services/data/inputs/all | where $eai:acl.app$ = \"Splunk_TA_UCCExample\" | eval Active=if(lower(disabled) IN (\"1\", \"true\", \"t\"), \"no\", \"yes\") | table title, Active | rename title as \"event_input\" | join type=left event_input [ search index = _internal source=*splunk_ta_uccexample* action=events_ingested | stats latest(_time) as le, sparkline(sum(n_events)) as sparkevent, sum(n_events) as events by event_input | eval \"Last event\" = strftime(le, \"%e %b %Y %I:%M%p\") ] | makemv delim=\",\" sparkevent | table event_input, Active, events, sparkevent, \"Last event\" | rename event_input as \"Input\", events as \"Number of events\", sparkevent as \"Event trendline\""
}
],
"defaultValue": "index=_internal source=*license_usage.log type=Usage (s IN (example_input_one*,example_input_two*)) | stats sparkline(sum(b)) as sparkvolume, sum(b) as Bytes by st | join type=left st [search index = _internal source=*splunk_ta_uccexample* action=events_ingested | stats latest(_time) AS le, sparkline(sum(n_events)) as sparkevent, sum(n_events) as events by sourcetype_ingested | rename sourcetype_ingested as st ] | makemv delim=\",\" sparkevent | eval \"Last event\" = strftime(le, \"%e %b %Y %I:%M%p\") | table st, Bytes, sparkvolume, events, sparkevent, \"Last event\" | rename st as \"Source type\", Bytes as \"Data volume\", events as \"Number of events\", sparkvolume as \"Volume trendline (Bytes)\", sparkevent as \"Event trendline\"",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit cfac087

Please sign in to comment.