<commit_before># TODO WIP this is meant to find discrepencies between the stack templates that
# are deployed to CloudFormation and what is checked in, and do some other basic
# sanity checks on the stacks and their configurations

import boto3

client = boto3.client('cloudformation')

response = client.describe_stacks()
for stack in response['Stacks']:
    print(f"{stack['StackName']} {stack['NotificationARNs']}")


# map = {
#     'cd': ['infrastructure-cd', '../ci/ci.yml'],
#     'ci': ['infrastructure-ci', '../cd/cd.yaml'],
#     'notifications': ['infrastructure-notifications', '../notifications/notifications.yml'],
#     'secrets': ['infrastructure-secrets', '../secrets/secrets.yml'],
#     'storage': ['infrastructure-storage', '../storage/storage.yml'],
# }

# for key in map:
#     response = client.get_template(StackName=map[key][0])
#     remote = response['TemplateBody']

#     local = open(map[key][1], "r").read()

#     if not local == remote:
#         print(f"mismatch {key}")







<commit_msg>Get the continuity script working<commit_after># TODO WIP this is meant to find discrepencies between the stack templates that
# are deployed to CloudFormation and what is checked in, and do some other
# basic sanity checks on the stacks and their configurations

import boto3

client = boto3.client('cloudformation')

response = client.describe_stacks()

map = {
    'cd': ['infrastructure-cd', '../cd/cd.yaml'],
    'ci': ['infrastructure-ci', '../ci/ci.yml'],
    'notifications': ['infrastructure-notifications', '../notifications/notifications.yml'],
    'secrets': ['infrastructure-secrets', '../secrets/secrets.yml'],
    'storage': ['infrastructure-storage', '../storage/storage.yml'],
    'radiotopia-com': ['hostedzone-radiotopia-com', '../dns/radiotopia.com-hosted_zone.yml'],
    'radiotopia-fm': ['hostedzone-radiotopia-fm', '../dns/radiotopia.fm-hosted_zone.yml'],
    'prxu-org': ['hostedzone-prxu-org', '../dns/prxu.org-hosted_zone.yml'],
    'prx-mx': ['hostedzone-prx-mx', '../dns/prx.mx-hosted_zone.yml'],
    'prx-org': ['hostedzone-prx-org', '../dns/prx.org-hosted_zone.yml'],
    'cdn-radiotopia-plus': ['cdn-radiotopia-plus', '../cdn/feed-cdn.yml'],
    'dt-stag': ['cloudfront-dovetail-cdn-staging', '../cdn/dovetail-cdn.yml'],
    'dt-prod': ['cloudfront-dovetail-cdn-production', '../cdn/dovetail-cdn.yml'],
}

for key in map:
    res = client.get_template(StackName=map[key][0])
    remote = res['TemplateBody']

    local = open(map[key][1], "r").read()

    if not local == remote:
        print(f"MISMATCH: {key}")
    else:
        print(f"match: {key}")








{'fraction_non_alphanumeric': 0.1891478792510508, 'fraction_numerical': 0.003056935422239205, 'mean_word_length': 3.8843283582089554, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '772875', 'n_tokens_mistral': 932, 'n_tokens_neox': 866, 'n_words': 187}