Skip to content

feat: add automated available modules table generation in README.md and related tests#89

Open
nhs-oliverslater wants to merge 5 commits into
mainfrom
feature/autoupdate-module-list-in-readme
Open

feat: add automated available modules table generation in README.md and related tests#89
nhs-oliverslater wants to merge 5 commits into
mainfrom
feature/autoupdate-module-list-in-readme

Conversation

@nhs-oliverslater

Copy link
Copy Markdown
Contributor

Description

This update introduces automation for generating the "Available modules" section in README.md, ensuring it remains in sync with the actual Terraform modules. Tests for the automated generation have been included to verify functionality.

Additional - for checks to pass - It also enhances the Vale configuration and adds an ACM module to the Dependabot configuration (though these also exist on other branches).

Context

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

@nhs-oliverslater nhs-oliverslater requested review from a team and saliceti as code owners June 22, 2026 21:16
@nhs-oliverslater nhs-oliverslater changed the title Feature/autoupdate module list in readme feat: add automated available modules table generation in README.md and related tests Jun 22, 2026
@nhs-oliverslater nhs-oliverslater enabled auto-merge (squash) June 22, 2026 21:16
@nhs-oliverslater nhs-oliverslater requested a review from a team as a code owner June 22, 2026 21:56
@nhs-oliverslater nhs-oliverslater force-pushed the feature/autoupdate-module-list-in-readme branch from 7a22e43 to 49c0f61 Compare June 23, 2026 08:25
@nhs-oliverslater nhs-oliverslater removed request for a team and saliceti June 23, 2026 09:00

@dave4420 dave4420 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is as far as I got with looking at this PR before I got interrupted with meetings.

Comment on lines +157 to +158
# Extract description and wraps from metadata using simple grep/sed
# This approach works without requiring yq/jq

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

But we have yq (and jq) listed in .tool-versions, so why not use yq?

Eventually someone will try to use multiline syntax or something for one of these fields and be quite justifiably upset when it doesn't work.

fi

# Write table row
printf "| \`%s\`${legacy_indicator} | %s | %s |\n" "${module_name}" "${wraps}" "${description}" >> "${temp_table}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As a matter of hygiene, we shouldn't interpolate into the format string.

Suggested change
printf "| \`%s\`${legacy_indicator} | %s | %s |\n" "${module_name}" "${wraps}" "${description}" >> "${temp_table}"
printf "| \`%s\`%s | %s | %s |\n" "${module_name}" "${legacy_indicator}" "${wraps}" "${description}" >> "${temp_table}"

Comment on lines +208 to +209
temp_readme=$(mktemp)
trap 'rm -f "${temp_table}" "${temp_modules}" "${temp_readme}"' EXIT

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm being picky, but it would be less confusing if we only set the trap once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants