Skip to content

Wires module update workflow for external repo callers.#20

Merged
d-lazenby merged 24 commits into
mainfrom
add-workflow-wiring
Jun 4, 2026
Merged

Wires module update workflow for external repo callers.#20
d-lazenby merged 24 commits into
mainfrom
add-workflow-wiring

Conversation

@d-lazenby
Copy link
Copy Markdown
Contributor

@d-lazenby d-lazenby commented Jun 3, 2026

Summary

Wires the reusable Terraform module update workflow for external repository callers, adds contract validation, and expands consumer-facing documentation so downstream teams can adopt this tool reliably.

Context

No linked ticket. This branch (add-workflow-wiring) has been tested via a call from an external repository and is ready to merge.

Changes

  • Rewrote update-tf-modules.yml to support cross-repo workflow_call with configurable inputs, outputs (changed, pr_number, pr_url), and PR flow controls
  • Added contract validation workflow (test-reusable-workflow-contract.yml) that asserts output shape and enforces create_pr=false behaviour on each PR to main
  • Expanded README with versioning policy, compatibility contract, token/permissions model, failure modes, troubleshooting guidance, and a minimal caller example
  • Added manifest examples (example-manifest.yml, examples/update-modules-manifest.example.yml) as a quick-start reference for consumers
  • Hardened runtime configuration handling in config.py to ensure the package install location is correct when called from a workflow

Testing

  • Workflow invoked end-to-end from an external repository (https://github.com/datasciencecampus/test-update-tf-modules-workflow); PR was created successfully in the caller repo
  • Contract validation workflow confirms changed is always true/false and that pr_number/pr_url are empty when create_pr=false
  • Permissions troubleshooting path verified: explicit failure message and actionable guidance emitted when PR creation fails

Risks / Notes

  • updater_ref defaults to add-workflow-wiring and should be updated to main (or a version tag) post-merge

Next steps

  • Enrich the auto-generated update PR body with a concise run summary (changed file count, file list, workflow run link) reusing existing step outputs to avoid duplicated git diff logic
  • Add ADR and finalise README to track most recent updates

@d-lazenby d-lazenby requested a review from a team as a code owner June 3, 2026 16:37
Comment thread .github/workflows/test-reusable-workflow-contract.yml Fixed
@ColinDaglish
Copy link
Copy Markdown
Contributor

Resolve conflicts, address code QL security alert comment, and add link to the repo you've tested this on.

@d-lazenby d-lazenby force-pushed the add-workflow-wiring branch from b895442 to e216094 Compare June 4, 2026 10:51
Comment thread .github/workflows/update-tf-modules.yml Outdated
Comment thread .github/workflows/update-tf-modules.yml Outdated
Comment thread .github/workflows/update-tf-modules.yml Outdated
Comment thread .github/workflows/update-tf-modules.yml Outdated
Comment thread .github/workflows/update-tf-modules.yml Outdated
Comment thread example-manifest.yml
Comment thread README.md
@ColinDaglish
Copy link
Copy Markdown
Contributor

Getting this error on the caller repo:

Failed to queue workflow run: Invalid Argument - failed to parse workflow: error parsing called workflow "" -> "datasciencecampus/update-tf-modules/.github/workflows/update-tf-modules.yml@add-workflow-wiring" (source branch with sha:e216094f54a89c9ac4846b7464d72fb1db39a118) : (Line: 177, Col: 9): 'uses' is already defined

Comment thread .github/workflows/update-tf-modules.yml Outdated
Copy link
Copy Markdown
Contributor

@ColinDaglish ColinDaglish left a comment

Choose a reason for hiding this comment

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

Looking really good. On the whole I think this is nearly there.

Required

  • Fix versions to commit SHA's for mutability
  • Need to see working example

Optional

  • Consider hard coding values which won't change (e.g updater_repository)
  • Consider splitting readme into single purpose driven docs (contributing guidance, variable reference guide, etc).

Copy link
Copy Markdown
Contributor

@ColinDaglish ColinDaglish left a comment

Choose a reason for hiding this comment

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

Nice work!

@d-lazenby d-lazenby merged commit 7320c2b into main Jun 4, 2026
5 checks passed
@d-lazenby d-lazenby deleted the add-workflow-wiring branch June 4, 2026 15:20
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.

3 participants