From df7f067f2607d68e61ff99d1f481b9b7a4dcad2d Mon Sep 17 00:00:00 2001 From: Zach Lasiuk Date: Thu, 28 Mar 2024 10:26:19 -0500 Subject: [PATCH 1/2] updatedregressions --- build_steps/validate_package_dates.py | 116 ------------------ .../chef_infra_client_progress.md | 2 +- 2 files changed, 1 insertion(+), 117 deletions(-) delete mode 100644 build_steps/validate_package_dates.py diff --git a/build_steps/validate_package_dates.py b/build_steps/validate_package_dates.py deleted file mode 100644 index 473500f2..00000000 --- a/build_steps/validate_package_dates.py +++ /dev/null @@ -1,116 +0,0 @@ -import os, sys -from pathlib import Path -import yaml - - - -def isCategoryValid(string, dictionary): - # Check if any key in the dictionary matches the string - for key in dictionary: - if string in key: - return True - return False - - -if __name__ == "__main__": - - # Get the absolute path to this python file's directory - script_dir = Path(__file__).parent.absolute() - - # Relative path to content from script, then tet absolute path to content by combining, and use Resolve to handle backwards".." - category_data_yml_relative_path = Path('../data/category_data.yml') - category_data_yaml = (script_dir / category_data_yml_relative_path).resolve() - - - # content dirs - opensource_relative_path = Path('../content/opensource_packages') - opensource_absolute_path = (script_dir / opensource_relative_path).resolve() - - commercial_relative_path = Path('../content/commercial_packages') - commercial_absolute_path = (script_dir / commercial_relative_path).resolve() - - content_directories = [opensource_absolute_path, commercial_absolute_path] - - - - - # Read in category data into a dictionary, which maps {'category': 'group'}. - with open(category_data_yaml, 'r') as file: - data = yaml.safe_load(file) - category_dict = data["subcategory_mapping"] - - - - # Loop over all packages - invalid_packages = [] - valid_packages = [] - for content_directory in content_directories: - for f in os.listdir(content_directory): - if f.endswith(".md"): - file_path_full = os.path.join(content_directory, f) - with open(file_path_full, 'r') as file: - lines = file.readlines() - packages_type = 'Open source' - for line in lines: - if 'name:' in line: - packages_name = line.split('name:')[1].strip() - if 'category:' in line: - packages_category = line.split('category:')[1].strip() - if 'vendor:' in line: - packages_type = 'Commercial' - - # check if packages_category matches a key in category_dict - is_valid = isCategoryValid(packages_category,category_dict) - if is_valid: - valid_packages.append({ - "name": packages_name, - "category": packages_category, - "group": category_dict[packages_category] - }) - else: - invalid_packages.append({ - "name": packages_name, - "file": f, - "type": packages_type, - "category": packages_category, - }) - - - - - - - if invalid_packages: - # Maximum width for columns - max_package_name_width = max(len(max(invalid_packages, key=lambda x: len(x['name']))['name']), len('Package Name')) - max_category_width = max(len(max(invalid_packages, key=lambda x: len(x['category']))['category']), len('Wrong Category')) - max_type_width = max(len(max(invalid_packages, key=lambda x: len(x['type']))['type']), len('Type')) - max_file_width = max(len(max(invalid_packages, key=lambda x: len(x['file']))['file']), len('File')) - - - print("ERROR: The following packages have invalid categories:") - print(" ","Package Name".ljust(max_package_name_width), "Wrong Category".ljust(max_category_width), "Type".ljust(max_type_width), "File".ljust(max_file_width)) - print(" ","-" * max_package_name_width, "-" * max_category_width, "-" * max_type_width, "-" * max_file_width) - - # Print data rows - for package in invalid_packages: - print(" ",package['name'].ljust(max_package_name_width), package['category'].ljust(max_category_width), package['type'].ljust(max_type_width), package['file'].ljust(max_file_width)) - sys.exit(1) - - - else: - # Maximum width for columns - max_package_name_width = max(len(max(valid_packages, key=lambda x: len(x['name']))['name']), len('Package Name')) - max_category_width = max(len(max(valid_packages, key=lambda x: len(x['category']))['category']), len('Category')) - max_group_width = max(len(max(valid_packages, key=lambda x: len(x['group']))['group']), len('Group')) - - print("Success! Report of all packages:") - print(" ","Package Name".ljust(max_package_name_width), "Group".ljust(max_group_width), "Category".ljust(max_category_width)) - print(" ","-" * max_package_name_width, "-" * max_group_width, "-" * max_category_width) - - for package in valid_packages: - print(" ",package['name'].ljust(max_package_name_width), package['group'].ljust(max_group_width), package['category'].ljust(max_category_width)) - - print("Success! See above report.") - - \ No newline at end of file diff --git a/content/commercial_packages/chef_infra_client_progress.md b/content/commercial_packages/chef_infra_client_progress.md index d78d3321..d70b2ae7 100644 --- a/content/commercial_packages/chef_infra_client_progress.md +++ b/content/commercial_packages/chef_infra_client_progress.md @@ -1,7 +1,7 @@ --- name: Chef Infra Client vendor: Progress (Chef) -category: Devops +category: DevOps description: Chef Infra Client requests all the cookbook files (including recipes, templates, resources, providers, attributes, and libraries) that it needs for every action identified in the run-list from the Chef Infra Server. product_url: https://docs.chef.io/ctl_chef_client/ works_on_arm: true From dd027f831e919d9554ce8716ceeb5c8b4858f31d Mon Sep 17 00:00:00 2001 From: Zach Lasiuk Date: Thu, 28 Mar 2024 10:31:14 -0500 Subject: [PATCH 2/2] added analytics --- .../layouts/partials/head/analytics.html | 7 ------ .../partials/head/conditional-redirect.html | 18 --------------- .../layouts/partials/head/head.html | 7 +++--- .../layouts/partials/head/search-icons.html | 23 ------------------- 4 files changed, 3 insertions(+), 52 deletions(-) delete mode 100644 themes/arm-design-system-hugo-theme/layouts/partials/head/analytics.html delete mode 100644 themes/arm-design-system-hugo-theme/layouts/partials/head/conditional-redirect.html delete mode 100644 themes/arm-design-system-hugo-theme/layouts/partials/head/search-icons.html diff --git a/themes/arm-design-system-hugo-theme/layouts/partials/head/analytics.html b/themes/arm-design-system-hugo-theme/layouts/partials/head/analytics.html deleted file mode 100644 index c87f2c3e..00000000 --- a/themes/arm-design-system-hugo-theme/layouts/partials/head/analytics.html +++ /dev/null @@ -1,7 +0,0 @@ -{{/* -Place analytics in the header as specified by the analytics team; load async to avoid blocking - -Where it is used: - - all, called from baseof -*/}} - diff --git a/themes/arm-design-system-hugo-theme/layouts/partials/head/conditional-redirect.html b/themes/arm-design-system-hugo-theme/layouts/partials/head/conditional-redirect.html deleted file mode 100644 index 018c3bd4..00000000 --- a/themes/arm-design-system-hugo-theme/layouts/partials/head/conditional-redirect.html +++ /dev/null @@ -1,18 +0,0 @@ -{{/* -Redirects specific pages that do not contain any content/info, but have to be potentially gotten to for clarity in breadcrumb structure - -Where it is used: - - all, called from baseof - -Pages to redirect to the homepage: - - /learning-paths/ - - /learning-paths/cross-platform/ -*/}} - - -{{ $lastUrlElement := index (split .Page.Permalink "/") (sub (len (split .Page.Permalink "/")) 2) }} -{{ $pages_to_redirect_home := slice "learning-paths" "cross-platform" }} - -{{if in $pages_to_redirect_home $lastUrlElement}} - -{{end}} \ No newline at end of file diff --git a/themes/arm-design-system-hugo-theme/layouts/partials/head/head.html b/themes/arm-design-system-hugo-theme/layouts/partials/head/head.html index c746e198..45be1e26 100644 --- a/themes/arm-design-system-hugo-theme/layouts/partials/head/head.html +++ b/themes/arm-design-system-hugo-theme/layouts/partials/head/head.html @@ -31,10 +31,6 @@ {{/* CSS file update to without leading slash */}} {{ $css_file_location = trim $css_home.Permalink "/"}} -{{- else -}} - {{/* Tracking for Adobe on staging environment only */}} - - {{- end -}} @@ -55,6 +51,9 @@ + + + diff --git a/themes/arm-design-system-hugo-theme/layouts/partials/head/search-icons.html b/themes/arm-design-system-hugo-theme/layouts/partials/head/search-icons.html deleted file mode 100644 index 9212b0f9..00000000 --- a/themes/arm-design-system-hugo-theme/layouts/partials/head/search-icons.html +++ /dev/null @@ -1,23 +0,0 @@ -{{/* -Inserts images into search results - -Where it is used: - - all, called from baseof -*/}} - - - -{{ $relativeURL := .Page.RelPermalink | relURL }} -{{ $urlParts := split $relativeURL "/" }} -{{ $firstUrlElement := index $urlParts 1 }} - - -{{ if ne $firstUrlElement "" }} - {{if eq $firstUrlElement "learning-paths" }} - - {{else if eq $firstUrlElement "install-guides" }} - - {{else if eq $firstUrlElement "tag"}} - - {{end}} -{{end}}