Skip to content

Commit

Permalink
flow diagram improved. v4 updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
VatsalJagani committed Mar 17, 2024
1 parent 8b4fc69 commit 031c07d
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 17 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ graph TD
H --> |Yes| I(Build Successful)
H --> |No| J(Build Failed - App-Inspect Errors)
I --> K([Optionally: Add App Utilities])
I --> K{Is Add App Utilities?}
J --> K
K --> L{Any changes to code?}
L --> |Yes| M([Pull Request Created])
L --> |No| N([Build Artifacts Created])
M --> N
K --> |Yes| L([Adding App Utilities])
L --> M{Any changes to code?}
M --> |Yes| N([Pull Request Created])
M --> |No| O([Build Artifacts Created])
N --> O
```


Expand Down Expand Up @@ -306,7 +307,7 @@ def stream_events(input_script: smi.Script, inputs: smi.InputDefinition, event_w

## Release Notes

### (IN PROGRESS) v4
### v4
* Run the user-defined commands in the context of your App's root directory instead of Repo's root directory. Refer to `Running User Defined Commands Before Generating the final App Build` for more details.

* `to_make_permission_changes` parameter's default value has been changed to `false`. Refer to `Avoid File and Folder Permission Issue on Your App Build` for more details.
Expand All @@ -315,7 +316,7 @@ def stream_events(input_script: smi.Script, inputs: smi.InputDefinition, event_w
* The input parameters `is_generate_build` and `app_build_path` has been removed.


### (IN PROGRESS) Upgrade Guide from v3 to v4
### Upgrade Guide from v3 to v4
* From `v4` of the `splunk-app-action`, your user-defined custom command (Refer to `Running User Defined Commands Before Generating the final App Build` section) would run in a context of your App's folder instead of root folder.
* So you need to change the code from this:
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"label": "URL",
"field": "url",
"required": true,
"help": "TODO - Add URL to fetch data from."
"help": "Add URL to fetch data from."
},
{
"type": "text",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, logger, addon_input, account_details, proxy_settings=None):
self.input_item = addon_input.input_item
self.account_details = account_details
self.proxy_settings = proxy_settings
self.verify = False # TODO - need to add this to UI if needed, for Splunkbase App Inspect
self.verify = False

self.logger.debug(f"Account Details: {account_details}")
self.base_url = account_details.url
Expand All @@ -34,7 +34,7 @@ def make_api_call(self, url, method="GET", params=None, data=None):
self.logger.debug(f"HTTP request. data={data}")

try:
response = requests.request(method, full_url, params=params, json=data, headers=headers, proxies=self.proxy_settings, verify=self.verify, timeout=280) # TODO - add timeout as global variable
response = requests.request(method, full_url, params=params, json=data, headers=headers, proxies=self.proxy_settings, verify=self.verify, timeout=280)
status_code = response.status_code

self.logger.info("HTTP response. URL={}: status_code={}".format(full_url, status_code))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MyInput1Input(AddonInput):
def collect(self, account_details, last_checkpoint):
api = API(self.logger, self, account_details, self.proxy_settings)

_start_date = self.input_item.get("start_date") if self.input_item.get("start_date") else "1999/01/01" # TODO - need to set proper default value
_start_date = self.input_item.get("start_date") if self.input_item.get("start_date") else "1999/01/01"

ckpt = MyInput2Checkpoint(self.logger, account_details.url, _start_date)
ckpt.read(last_checkpoint)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MyInputInput(AddonInput):
def collect(self, account_details, last_checkpoint):
api = API(self.logger, self, account_details, self.proxy_settings)

_start_date = self.input_item.get("start_date") if self.input_item.get("start_date") else "1999/01/01" # TODO - need to set proper default value
_start_date = self.input_item.get("start_date") if self.input_item.get("start_date") else "1999/01/01"

ckpt = MyInputCheckpoint(self.logger, account_details.url, _start_date)
ckpt.read(last_checkpoint)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"label": "URL",
"field": "url",
"required": true,
"help": "TODO - Add URL to fetch data from."
"help": "Add URL to fetch data from."
},
{
"type": "text",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, logger, addon_input, account_details, proxy_settings=None):
self.input_item = addon_input.input_item
self.account_details = account_details
self.proxy_settings = proxy_settings
self.verify = False # TODO - need to add this to UI if needed, for Splunkbase App Inspect
self.verify = False

self.logger.debug(f"Account Details: {account_details}")
self.base_url = account_details.url
Expand All @@ -34,7 +34,7 @@ def make_api_call(self, url, method="GET", params=None, data=None):
self.logger.debug(f"HTTP request. data={data}")

try:
response = requests.request(method, full_url, params=params, json=data, headers=headers, proxies=self.proxy_settings, verify=self.verify, timeout=280) # TODO - add timeout as global variable
response = requests.request(method, full_url, params=params, json=data, headers=headers, proxies=self.proxy_settings, verify=self.verify, timeout=280)
status_code = response.status_code

self.logger.info("HTTP response. URL={}: status_code={}".format(full_url, status_code))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MyInput1Input(AddonInput):
def collect(self, account_details, last_checkpoint):
api = API(self.logger, self, account_details, self.proxy_settings)

_start_date = self.input_item.get("start_date") if self.input_item.get("start_date") else "1999/01/01" # TODO - need to set proper default value
_start_date = self.input_item.get("start_date") if self.input_item.get("start_date") else "1999/01/01"

ckpt = MyInput2Checkpoint(self.logger, account_details.url, _start_date)
ckpt.read(last_checkpoint)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MyInputInput(AddonInput):
def collect(self, account_details, last_checkpoint):
api = API(self.logger, self, account_details, self.proxy_settings)

_start_date = self.input_item.get("start_date") if self.input_item.get("start_date") else "1999/01/01" # TODO - need to set proper default value
_start_date = self.input_item.get("start_date") if self.input_item.get("start_date") else "1999/01/01"

ckpt = MyInputCheckpoint(self.logger, account_details.url, _start_date)
ckpt.read(last_checkpoint)
Expand Down

0 comments on commit 031c07d

Please sign in to comment.