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: adding CLEAN_KEYS support #869

Merged
merged 11 commits into from
Jul 24, 2024

Conversation

harshilgajera-crest
Copy link
Contributor

@harshilgajera-crest harshilgajera-crest commented Jul 16, 2024

Added support for CLEAN_KEYS in Transforms.conf.
Added respective e2e test case for the same

Impact on Addons:

Now if Addons have have field names in transforms report which have non-alphanumeric chars then those chars would be first converted to _ and then tests would be generated as by default in splunk CLEAN_KEYS is set to true, so splunk also does the same thing.

Moreover if any report stanza has explicitly set CLEAN_KEYS=false then for those reports field conversion would not happen and tests would be generated as it is.

@harshilgajera-crest harshilgajera-crest marked this pull request as ready for review July 17, 2024 13:15
@harshilgajera-crest harshilgajera-crest requested a review from a team as a code owner July 17, 2024 13:15
Copy link
Member

@artemrys artemrys left a comment

Choose a reason for hiding this comment

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

Can you please document the impact of this change on the exiting TAs?

@@ -57,6 +57,14 @@ def props(self) -> Optional[Dict]:
self._props = self._conf_parser.item_dict()
return self._props if self._props else None

def update_field_names(self, field_list) -> List:
Copy link
Member

Choose a reason for hiding this comment

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

Can you please type field_list here and specify the return type as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

"""
update field names to remove all the non-alphanumeric chars and replace them with _
"""
for index in range(len(field_list)):
Copy link
Member

Choose a reason for hiding this comment

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

Can we do for field in field_list?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@mkolasinski-splunk mkolasinski-splunk left a comment

Choose a reason for hiding this comment

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

Minor changes needed in TC descritption

@@ -22,6 +22,23 @@ SOURCE_KEY = event_id
DELIMS = "="
FIELDS = server_contact_mode, dest

# Component tested: REPORT, DELIM-FIELDS-SOURCE_KEY
# Scenario:# Similar to the above scenario
## ## server-contact-mode should be searched as server_contact_mode as CLEAN_KEYS = true by default
Copy link
Contributor

@mkolasinski-splunk mkolasinski-splunk Jul 23, 2024

Choose a reason for hiding this comment

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

CLEAN_KEYS is set to false here, so how should this field be looked for? Just description requires small adjustment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@harshilgajera-crest harshilgajera-crest merged commit b2f6dc5 into develop Jul 24, 2024
21 of 22 checks passed
@harshilgajera-crest harshilgajera-crest deleted the feat/adding-clean-keys-support branch July 24, 2024 07:23
@github-actions github-actions bot locked and limited conversation to collaborators Jul 24, 2024
@srv-rr-github-token
Copy link
Contributor

🎉 This issue has been resolved in version 5.3.0-beta.10 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@srv-rr-github-token
Copy link
Contributor

🎉 This issue has been resolved in version 5.4.0-beta.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants