-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: deprecate .uccignore and upgrade additional_package (#1415)
**Issue number:** ADDON-75701 ## Summary ### Changes > The `.uccignore` gets deprecated (while still doing its job) and would warn users can now use `cleanup_output_files` of `additional_packaging.py` to do the same job. ### User experience > Users using `.uccignore` would get a deprecation notice and it would work as it is. Moreover, they would be redirected to the reference showing the example of how to do the same job as `.uccignore`. ## Checklist If your change doesn't seem to apply, please leave them unchecked. * [x] I have performed a self-review of this change * [x] Changes have been tested * [x] Changes are documented * [x] PR title follows [conventional commit semantics](https://www.conventionalcommits.org/en/v1.0.0/) --------- Signed-off-by: Viktor Tsvetkov <[email protected]> Co-authored-by: Kamil Kędziak <[email protected]> Co-authored-by: Viktor Tsvetkov <[email protected]> Co-authored-by: sgoral-splunk <[email protected]> Co-authored-by: srv-rr-github-token <[email protected]> Co-authored-by: soleksy-splunk <[email protected]> Co-authored-by: spanchal-crest <[email protected]>
- Loading branch information
1 parent
b94b228
commit f6dd96f
Showing
9 changed files
with
125 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
tests/testdata/test_addons/package_global_config_everything_uccignore/.uccignore
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
...s/testdata/test_addons/package_global_config_everything_uccignore/additional_packaging.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
from os.path import sep, exists, dirname, realpath, join | ||
from os import remove, system, _exit, WEXITSTATUS | ||
|
||
def cleanup_output_files(output_path: str, ta_name: str) -> None: | ||
""" | ||
prepare a list for the files to be deleted after the source code has been copied to output directory | ||
""" | ||
files_to_delete = [] | ||
files_to_delete.append(sep.join([output_path, ta_name, "default", "redundant.conf"])) | ||
files_to_delete.append(sep.join([output_path, ta_name, "bin", "splunk_ta_uccexample_rh_example_input_two.py"])) | ||
files_to_delete.append(sep.join([output_path, ta_name, "bin", "example_input_one.py"])) | ||
files_to_delete.append(sep.join([output_path, ta_name, "bin", "splunk_ta_uccexample_rh_example_input_one.py"])) | ||
files_to_delete.append(sep.join([output_path, ta_name, "bin", "file_does_not_exist.py"])) | ||
files_to_delete.append(sep.join([output_path, ta_name, "default", "nav", "views", "file_copied_from_source_code.xml"])) | ||
|
||
for delete_file in files_to_delete: | ||
try: | ||
remove(delete_file) | ||
except (FileNotFoundError): | ||
# simply pass if the file doesn't exist | ||
pass |
6 changes: 6 additions & 0 deletions
6
...al_config_everything_uccignore/package/default/nav/views/file_copied_from_source_code.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<note> | ||
<to>World</to> | ||
<from>Python</from> | ||
<heading>Hello</heading> | ||
<body>Hello World!</body> | ||
</note> |
4 changes: 4 additions & 0 deletions
4
...ata/test_addons/package_global_config_everything_uccignore/package/default/redundant.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[redundant] | ||
key = value | ||
content_type = json | ||
parser = json |