Skip to content

Commit fe28681

Browse files
committed
DAGE-465: Hardcode integration entries that are named differently from their tap id
1 parent 1bfdf75 commit fe28681

File tree

1 file changed

+44
-13
lines changed

1 file changed

+44
-13
lines changed

scripts/changelog/changelog.py

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,40 @@ def createIntegrationDict(): # Create a dictionary of all integrations from the
4141
with open('../../_data/taps/integrations.yml', 'r') as file:
4242
yaml_data = yaml.safe_load(file)
4343
integration_dict.update(yaml_data['integrations'])
44+
# Hardcode some integration entries
45+
hardcoded_integration_dict = {
46+
'amazon-dynamodb': 'dynamodb',
47+
'amazon-s3-csv': 's3',
48+
}
49+
# Update entries with their hardcoded value
50+
for key, value in hardcoded_integration_dict.items():
51+
integration_dict[key]['id'] = value
52+
# Remove entries that are a duplication of a generic entry
53+
keys_to_be_removed_list = [
54+
'aurora-postgresql-rds',
55+
'aurora-rds',
56+
'cloudsql-mysql',
57+
'cloudsql-postgres',
58+
'magento',
59+
'mariadb',
60+
'microsoft-azure-mysql',
61+
'mongodb-atlas',
62+
'mysql-rds',
63+
'oracle-rds',
64+
'postgresql-rds',
65+
'sql-server-rds'
66+
]
67+
# Loop on the integration dictionary to create a list of keys to be removed
68+
# The keys to be removed are the ones that don't have any tap associated
69+
for key,value in integration_dict.items():
70+
if value['tap'] == '':
71+
keys_to_be_removed_list.append(key)
72+
# Remove the keys that don't have any tap
73+
for key in keys_to_be_removed_list:
74+
integration_dict.pop(key)
75+
# Manually remove keys that don't have any associated documentation (leftover?)
76+
integration_dict.pop('amazon-dsp')
77+
integration_dict.pop('insided')
4478

4579
def getPRsToIgnore(): # Check the ignore.txt file for PRs that shouldn't be documented
4680
with open('ignore.txt', 'r', encoding='utf8') as f:
@@ -181,24 +215,21 @@ def getPRsToDocument(): # Find PRs that need to be documented and create draft c
181215
to_document.append(pr)
182216

183217
# Get connection information from integrations.yaml
184-
connection_id_found = False
185-
connection_name_found = False
218+
## Set default values
219+
connection_id = 'NOT FOUND'
220+
connection_name = 'NOT FOUND'
221+
connection_version = 'NOT FOUND'
222+
## Lookup on integration_dict
186223
for key, value in integration_dict.items():
187224
if value['tap'] == tap_raw:
225+
## Get values
188226
connection_id = value['id']
189-
connection_id_found = True
190227
connection_name = value['display_name']
191-
connection_name_found = True
228+
## Get latest connection version
229+
with open(f'../../_data/taps/versions/{connection_id}.yml', 'r') as file:
230+
yaml_data = yaml.safe_load(file)
231+
connection_version = yaml_data['latest-version']
192232
break
193-
if not connection_id_found:
194-
connection_id = 'NOT FOUND'
195-
if not connection_name_found:
196-
connection_name = 'NOT FOUND'
197-
198-
# Get latest connection version
199-
with open(f'../../_data/taps/versions/{connection_id}.yml', 'r') as file:
200-
yaml_data = yaml.safe_load(file)
201-
connection_version = yaml_data['latest-version']
202233

203234
# Process PR title
204235
pr_title = re.sub(r'\w*-\d*\s?:\s?', '', pr_title)

0 commit comments

Comments
 (0)