feat: add consolidated module-index JSON files and auto-update workflow#2762
Closed
jaredfholgate wants to merge 1 commit into
Closed
feat: add consolidated module-index JSON files and auto-update workflow#2762jaredfholgate wants to merge 1 commit into
jaredfholgate wants to merge 1 commit into
Conversation
Adds three JSON files under docs/static/module-indexes/ generated from the
existing CSV indexes:
* modules.json - merged Bicep + Terraform module data (resource modules
matched on ProviderNamespace+ResourceType; pattern and
utility modules listed per ecosystem). Sorted array.
* bicep.json - minimal map keyed by ModuleName (moduleType, displayName,
status) for consumption by the Bicep VS Code extension.
* terraform.json - Terraform equivalent of bicep.json.
Tooling:
* utilities/tools/platform/Set-ModuleIndexesJson.ps1 - generator (parses the
CSVs, normalises rows, emits deterministic UTF-8 (no BOM) + LF output).
* utilities/pipelines/sharedScripts/New-AutoMergePullRequest.ps1 - generic
helper that detects changes for a given file list, creates a timestamped
branch, opens a PR (with a {{CHANGED_FILES}} placeholder in the body)
using the GitHub App and auto-merges it.
* .github/workflows/platform.updateModuleIndexesJson.yml - runs on push to
main (when CSVs/scripts/workflow change) or workflow_dispatch. Uses the
AVM GitHub App (AVM_APP_CLIENT_ID / AVM_APP_PRIVATE_KEY) and opens an
auto-merged PR via the shared helper.
|
Important The "Needs: Triage 🔍" label must be removed once the triage process is complete! Tip For additional guidance on how to triage this issue/PR, see the AVM Issue Triage documentation. |
Contributor
|
@jaredfholgate are we going to close this in favour of our other approach we have planned to flip this around? |
Member
Author
Yes. I'll close this for now. This was triggered by the Bicep VSCode extension PR, but I think we can solve that by adding what they need to the existing metadata endpoint instead? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds three consolidated module-index JSON files under
docs/static/module-indexes/, plus the tooling and CI to keep them in sync with the existing CSV indexes.Generated JSON files
modules.jsonProviderNamespace+ResourceTypeso each resource appears once with both ecosystems nested under it. Pattern and utility modules are listed per ecosystem.bicep.jsonModuleName{ moduleType, displayName, status }— designed to be consumed by the Bicep VS Code extension AVM provider (PR #18958).terraform.jsonModuleNamebicep.json.All files are deterministic, UTF-8 (no BOM), LF line endings, sorted, trailing newline.
New tooling
utilities/tools/platform/Set-ModuleIndexesJson.ps1— generator. Reads the six CSVs (BicepResourceModules.csv,BicepPatternModules.csv,BicepUtilityModules.csvand the Terraform equivalents), normalises the rows (drops theModuleOwnersGHTeamcolumn), matches resource modules across ecosystems, and writes the three JSONs.utilities/pipelines/sharedScripts/New-AutoMergePullRequest.ps1— generic shared helper for any future "regenerate file → open & auto-merge PR" workflow. Takes a file list, branch prefix, title and a body with a{{CHANGED_FILES}}placeholder; usesgit status --porcelain(handles untracked-on-first-run); creates a timestamped branch, opens a PR viaghand merges with--admin(or--autoif-Adminis omitted). Validated with-WhatIf.New workflow
.github/workflows/platform.updateModuleIndexesJson.yml:mainwhen any of the source CSVs, the generator script, the shared PR helper or this workflow itself change, plusworkflow_dispatch. (No cron — all inputs are in-repo, so there is nothing to drift between pushes.)AVM_APP_CLIENT_ID/AVM_APP_PRIVATE_KEY(same secrets asavm-terraform-governance).<app-slug>[bot]with the correct<id>+<app-slug>[bot]@users.noreply.github.comemail (governance pattern).New-AutoMergePullRequestto publish them via an auto-merged PR.pwsh;permissions: contents: read(writes go through the App token).Notes / open questions
environment: platform(this repo's existing convention).avm-terraform-governanceusesenvironment: avm— happy to switch if preferred.--adminfor an immediate auto-merge. If branch protection is configured to reject this for App identities, swap to--autoin the workflow'sNew-AutoMergePullRequestcall (just drop the-Adminswitch).