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: deprecate .uccignore and upgrade additional_package #1415

Merged
merged 25 commits into from
Nov 13, 2024

Conversation

hetangmodi-crest
Copy link
Contributor

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.

@hetangmodi-crest hetangmodi-crest added enhancement New feature or request deprecation Deprecation notice labels Oct 30, 2024
@hetangmodi-crest hetangmodi-crest self-assigned this Oct 30, 2024
@hetangmodi-crest hetangmodi-crest requested review from a team as code owners October 30, 2024 05:37
hetangmodi-crest and others added 9 commits November 1, 2024 15:19
)

**Issue number:** ADDON-75778

## Summary

### Changes

> Added changes to include authentication parameters in the openapi.json
generated by framework.

### User experience

> Previously this fields weren't generated in openapi.json and hence
users had to manually add them in the curl command provided by Swagger
or any openapi tool used to render the json file.

## 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
* [ ] Changes are documented
* [x] PR title follows [conventional commit
semantics](https://www.conventionalcommits.org/en/v1.0.0/)
ADDON-76064

## Summary

### Changes

> Please provide a summary of what's being changed

Warn Users (TA Developers): Generate warnings during development when no
validators are specified for input fields.

Educate and Encourage: Update documentation to educate developers on the
importance of specifying secure validators.

### User experience

> Please describe what the user experience looks like before and after
this change

Additional logs visible during TA building using the ucc-gen command.

Example of warning:

```
WARNING: The field ‘endpoint’ does not have a validator specified. It's recommended to add a validator to ensure the security and integrity of the input data. For more information, please refer to the documentation
```

Also, the predefined logging tab now has default validators.

## 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: Viktor Tsvetkov <[email protected]>
**Issue
number:[ADDON-74237](https://splunk.atlassian.net/browse/ADDON-74237)**

## Summary

Added splunktaucclib version checking.

### Changes

* new method _check_libraries_required_for_ui was added to check if
splunktaucclib is installed and has proper version

### User experience

The build process will be canceled if an incorrect version of the
splunktaucclib library is used.

## 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
* [ ] Changes are documented
* [x] PR title follows [conventional commit
semantics](https://www.conventionalcommits.org/en/v1.0.0/)
**Issue number:**

## Summary

### Changes

> Please provide a summary of what's being changed

There are 2 warning texts in the documentation that are not rendered
correctly. This PR replaces them to another variant that renders
properly.

### User experience

> Please describe what the user experience looks like before and after
this change

No changes from the UX.

## Checklist

If your change doesn't seem to apply, please leave them unchecked.

* [ ] I have performed a self-review of this change
* [ ] Changes have been tested
* [ ] Changes are documented
* [ ] PR title follows [conventional commit
semantics](https://www.conventionalcommits.org/en/v1.0.0/)
# [5.52.0](v5.51.1...v5.52.0) (2024-10-30)

### Bug Fixes

* generate basic authentication fields for OpenAPI integration ([#1407](#1407)) ([584b832](584b832))
* remove support for the "enable" action in table inputs ([#1386](#1386)) ([26a4bb9](26a4bb9))

### Features

* print warning when entity does not have validators ([#1409](#1409)) ([ad12cea](ad12cea))
* require splunktaucclib 6.4.0 during the build phase ([#1412](#1412)) ([0d20269](0d20269))
**Issue number:**

## Summary

### Changes

> Use empty string when single select does not have value.

### User experience

> No changes. It removes error from console.

## Checklist

If your change doesn't seem to apply, please leave them unchecked.

* [x] I have performed a self-review of this change
* [ ] Changes have been tested
* [ ] Changes are documented
* [x] PR title follows [conventional commit
semantics](https://www.conventionalcommits.org/en/v1.0.0/)
@hetangmodi-crest hetangmodi-crest requested a review from a team as a code owner November 1, 2024 09:50
@vtsvetkov-splunk vtsvetkov-splunk removed the request for review from a team November 6, 2024 14:48
splunk_add_on_ucc_framework/commands/build.py Outdated Show resolved Hide resolved
This file should have the `additional_packaging` function, which accepts add-on name as its only argument.
This file should at least have:

- the `cleanup_output_files` function, which accepts `output_path` (str), `add-on name` (str) as its arguments.
Copy link
Contributor

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.

Copy link
Contributor

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 (like output_path), through e.g. env variables?

Copy link
Contributor Author

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 at output/ dir. This cleanup_output_files if inclined towards cleaning up of files. I have used output_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.

Copy link
Contributor

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 to a/b/c in additional packaging and if he later run:
ucc-gen build --output x/y/z he must remember to change it again the additioanl packaging to x/y/z

Copy link
Contributor Author

@hetangmodi-crest hetangmodi-crest Nov 13, 2024

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.

tests/unit/test_global_config_update.py Outdated Show resolved Hide resolved
kkedziak-splunk
kkedziak-splunk previously approved these changes Nov 8, 2024
Copy link
Contributor

@kkedziak-splunk kkedziak-splunk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some tests not related with uccignore. Please either update the description and title, or move it to a separate PR.

docs/uccignore.md Outdated Show resolved Hide resolved
splunk_add_on_ucc_framework/commands/build.py Show resolved Hide resolved
@hetangmodi-crest hetangmodi-crest merged commit f6dd96f into develop Nov 13, 2024
78 checks passed
@hetangmodi-crest hetangmodi-crest deleted the fix/update-uccignore-impl branch November 13, 2024 11:45
@github-actions github-actions bot locked and limited conversation to collaborators Nov 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
deprecation Deprecation notice enhancement New feature or request size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants