-
Notifications
You must be signed in to change notification settings - Fork 24
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: deprecate .uccignore and upgrade additional_package #1415
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
a38e532
feat(.uccignore): add functionality in additional_packaging.py to cle…
hetangmodi-crest 0b6d1c5
chore: uncomment the code of .uccignore
hetangmodi-crest 59071ef
test(smoke): update smoke tests
hetangmodi-crest df1cbed
doc: update doc of additional_packaging.py with example
hetangmodi-crest 60d7e3d
chore: fix lint failures
hetangmodi-crest 63407dc
Merge branch 'develop' into fix/update-uccignore-impl
hetangmodi-crest 0729239
fix: generate basic authentication fields for OpenAPI integration (#1…
hetangmodi-crest 9a0238c
feat: print warning when entity does not have validators (#1409)
kkedziak-splunk 9f0eeca
feat: require splunktaucclib 6.4.0 during the build phase (#1412)
sgoral-splunk 2dc75a8
docs: fix warning panels (#1418)
kkedziak-splunk 6970f33
chore(release): 5.52.0
srv-rr-github-token 36ad940
chore: single select with default empty string value (#1416)
soleksy-splunk 926d086
refactor: add types for Splunk modules (#1422)
vtsvetkov-splunk 7af8746
test(ui): check actual request for oauth (#1419)
vtsvetkov-splunk f4b8fda
refactor(types): allow to parse unknown errors (#1423)
vtsvetkov-splunk 44c77ed
chore: merge branch 'develop' into fix/update-uccignore-impl
hetangmodi-crest 7dc4935
test(unit): add unit tests for coverage
hetangmodi-crest 8cc7b0c
docs: update typo of file in docs
hetangmodi-crest 2e1fff5
Merge branch 'develop' into fix/update-uccignore-impl
hetangmodi-crest 9e44b08
docs: updated .uccignore docs
hetangmodi-crest 2c270a1
fix: removed raise while importing additional_packaging.py
hetangmodi-crest c9019f7
docs: added a warning message for deprecation
hetangmodi-crest d58209e
tests: removed additional_packaging function
hetangmodi-crest fa390af
chore: removed unit test cases for enable action
hetangmodi-crest 3ef04a2
Merge branch 'develop' into fix/update-uccignore-impl
hetangmodi-crest File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the users it might be a little bit confusing what is the
output_path
here. When user decides to change output directory during the build process he would need to change it also in the additional_packaging. I wonder if we can make it more generic since we already have this parameter during the build process_get_build_output_path
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it may be a bit confusing. What do you guys think about leaving only
additional_packaging
method and passing other arguments (likeoutput_path
), through e.g. env variables?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
additional_packaging
function is inclined towards adding something in the final package atoutput/
dir. Thiscleanup_output_files
if inclined towards cleaning up of files. I have usedoutput_path
as variable name as in ucc-gen command, we are asking for--output
flag to define the output path of the add-on that is built. We can change this variable name, or I can update the example that we show to capture its meaning.We are passing the
output_path
that we get from_get_build_output_path()
function.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand. My only concern is that when the user runs the command for example:
ucc-gen build --output a/b/c
he must also change the
output_path
toa/b/c
inadditional packaging
and if he later run:ucc-gen build --output x/y/z
he must remember to change it again theadditioanl packaging
tox/y/z
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood. I have addressed this concern in PR #1455.