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

chore(release): pull release/v1.103.0 into main #1886

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.103.0](https://github.com/rudderlabs/rudder-config-schema/compare/v1.102.0...v1.103.0) (2025-02-03)


### Features

* **http:** add new field xmlRootKey and updated regex for some fields ([#1884](https://github.com/rudderlabs/rudder-config-schema/issues/1884)) ([a9c3a6d](https://github.com/rudderlabs/rudder-config-schema/commit/a9c3a6d1faf05af21766f8296ffda3930575d479))
* **http:** add support for form format ([#1876](https://github.com/rudderlabs/rudder-config-schema/issues/1876)) ([10ebbd9](https://github.com/rudderlabs/rudder-config-schema/commit/10ebbd9e66c07f88c6798182e1f91242d11a2408))
* onboarding customerio segment ([#1853](https://github.com/rudderlabs/rudder-config-schema/issues/1853)) ([fe53d8c](https://github.com/rudderlabs/rudder-config-schema/commit/fe53d8c103b4d4e8899e7fd614511f843743487b))


### Bug Fixes

* clean up adobe analytics dynamic config support ([#1857](https://github.com/rudderlabs/rudder-config-schema/issues/1857)) ([fed05fa](https://github.com/rudderlabs/rudder-config-schema/commit/fed05faaf99472c31c413b17502ca498ae9b6acf))

## [1.102.0](https://github.com/rudderlabs/rudder-config-schema/compare/v1.101.1...v1.102.0) (2025-01-20)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rudder-config-schema",
"version": "1.102.0",
"version": "1.103.0",
"description": "",
"main": "src/index.ts",
"private": true,
Expand Down
43 changes: 36 additions & 7 deletions scripts/schemaGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,33 @@ def get_options_list_for_enum(field):
return options_list


def generate_uiconfig_pattern(field, dbConfig=None) -> str:
"""
Generates the pattern for schema based on the type of field.

Cases:
If dynamicConfigSupported is present in dbConfig:
- Regex is present in ui-config for the field
- Use the regex mentioned in ui-config.
- Regex is not present in ui-config for the field
- Use the regex ^(.{0,100})$.
If dynamicConfigSupported is not present in dbConfig:
- Regex is present in ui-config for the field
- Use the regex mentioned in ui-config & includes dynamic config regex & env regex(if not already present).
- Regex is not present in ui-config for the field
- Use the regex ^(.{0,100})$ & includes dynamic config regex & env regex(if not already present).
"""
# TODO: remove this once all the destinations have been updated with dynamicConfigSupported field
if "dynamicConfigSupported" not in dbConfig:
return generalize_regex_pattern(field) # old way

# regex from ui-config
if "regex" in field:
return field["regex"]
else:
return "^(.{0,100})$"


def generalize_regex_pattern(field):
"""Generates the pattern for schema based on the type of field.
- For type : singleSelect and dynamicSelectForm, the pattern is generated by iterating over options.
Expand Down Expand Up @@ -269,12 +296,12 @@ def generate_schema_for_textinput(field, dbConfig, schema_field_name):
}
if "regex" in field:
textInputSchemaObj["properties"][sourceType]["pattern"] = (
generalize_regex_pattern(field)
generate_uiconfig_pattern(field, dbConfig)
)
else:
textInputSchemaObj = {"type": FieldTypeEnum.STRING.value}
if "regex" in field:
textInputSchemaObj["pattern"] = generalize_regex_pattern(field)
textInputSchemaObj["pattern"] = generate_uiconfig_pattern(field, dbConfig)
return textInputSchemaObj


Expand All @@ -292,7 +319,7 @@ def generate_schema_for_textarea_input(field, dbConfig, schema_field_name):
"""
textareaInputObj = {"type": FieldTypeEnum.STRING.value}
if "regex" in field:
textareaInputObj["pattern"] = generalize_regex_pattern(field)
textareaInputObj["pattern"] = generate_uiconfig_pattern(field, dbConfig)
return textareaInputObj


Expand Down Expand Up @@ -394,7 +421,9 @@ def generate_schema_for_dynamic_custom_form(field, dbConfig, schema_field_name):
and customField["type"] != "singleSelect"
and customField["type"] != "dynamicSelectForm"
):
customFieldSchemaObj["pattern"] = generalize_regex_pattern(customField)
customFieldSchemaObj["pattern"] = generate_uiconfig_pattern(
customField, dbConfig
)

# If the custom field is source dependent, we remove the source keys as it's not required inside custom fields, rather they need to be moved to top.
if isCustomFieldDependentOnSource:
Expand Down Expand Up @@ -510,13 +539,13 @@ def generate_key(forFieldWithTo):
}
if field["type"] == "dynamicSelectForm":
if forFieldWithTo != (field.get("reverse", False) == False):
obj["pattern"] = generalize_regex_pattern(field)
obj["pattern"] = generate_uiconfig_pattern(field, dbConfig)
else:
if "defaultOption" in field:
obj["default"] = field["defaultOption"]["value"]
obj["enum"] = get_options_list_for_enum(field)
else:
obj["pattern"] = generalize_regex_pattern(field)
obj["pattern"] = generate_uiconfig_pattern(field, dbConfig)
return obj

dynamicFormSchemaObject = {}
Expand Down Expand Up @@ -602,7 +631,7 @@ def generate_schema_for_tag_input(field, dbConfig, schema_field_name):
tagItemProps = {
str(field["tagKey"]): {
"type": FieldTypeEnum.STRING.value,
"pattern": generalize_regex_pattern(field),
"pattern": generate_uiconfig_pattern(field, dbConfig),
}
}
tagItem["properties"] = tagItemProps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"config": {
"transformAtV1": "processor",
"saveDestinationResponse": true,
"dynamicConfigSupported": ["trackingServerUrl", "reportSuiteIds", "trackingServerSecureUrl"],
"includeKeys": [
"trackingServerUrl",
"reportSuiteIds",
Expand Down
Loading
Loading