Repository navigation
feat(terraform): TerraformWatchOp, describeResources() over terraform show -json, and the GitHub cron watch (#2087) - #2099
Merged
Merged
Conversation
…how -json The observe position for the terraform lexicon (#2087). TerraformWatchOp inits, plans with -detailed-exitcode, and reports the result as a Drift search attribute. Its issue and pull-request modes hand the plan to the temporal lexicon's reconcilePr rather than growing a second copy of the gh calls; that activity had no way to be handed a body, so ReconcilePrArgs gains one field (body), used verbatim and suppressing the change-set derivation. Only the -no-color render can reach it: the plan JSON carries every attribute value the plan touches, and a test pins that no reference to it exists anywhere in the Op. describeResources runs init then show per configured root and matches values.root_module.resources[] (child_modules included) against the <root>/<address> keys buildRoots produces. The state file is the ownership answer here: an address the state carries is owned, anything else is unknown, which is why a declared module block reads present-but-unknown. A failed init or show reports every entity of that root read-failed with the root named, never absent. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JFvsuJmNqWXGUzzhJgb2oe
…on docs page examples/scheduled-watch is the recipe for a project with no Temporal: a TerraformWatchOp on a cron, with findingMode "issue", plus the generateOpsPipeline call that turns it into a GitHub Actions workflow. examples.test.ts pins that workflow against the real generator and the real Op discovery: the cron, workflow_dispatch, the per-Op concurrency group, issues: write and nothing wider, and a pinned terraform release unzip supplied through beforeScript, asserted to run before `chant run`. docs/pages/observation.mdx is the reader's version of why terraform sits on the trusted-state-file row of the third axis in concepts/lifecycle-models, and the lexicons overview gains its runtime observation coverage row. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JFvsuJmNqWXGUzzhJgb2oe
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.
Closes #2087.
The observe position for the terraform lexicon.
TerraformWatchOp(Init, Plan with-detailed-exitcode,Driftsearch attribute, optional Report) returns{ op, schedule? };issueandpull-requestmodes hand the-no-colorplan text toreconcilePras a caller-supplied body, and a test proves no plan JSON can reach it.describeResources()readsterraform show -jsonper declared root and keys rows the waybuildRoots()does; a root whose init or show fails reports every declared entity as not-observed withread-failed, never absent. Ownership is the state file: a resource in state isowned, a declared block the state has no row for isunknown(and withheld asfilteredunder--owned), and the observation page says so with a link to the lifecycle-models third axis.ownershipChannelis declared and the observation conformance suite runs with it. Ascheduled-watchexample generates the GitHub cron workflow throughgenerateOpsPipeline, asserted for the cron,workflow_dispatch, the concurrency group,issues: write, and the terraform install line.Two decisions to note.
reconcilePrgains an optionalbody, used verbatim and suppressing thechant lifecycle planderivation; itspull-requestmode still regenerates chant TypeScript, which is not a terraform answer, soissueis the mode with an end-to-end story today and the composite's doc says so (HCL regeneration is #2089). The schedule is built with core'screateResource("Temporal::Schedule", ...)rather than importing the temporal lexicon, since no lexicon imports another at runtime and a project installing terraform alone must still load it.Acceptance
src/composites/terraform-watch-op.tsreturns{ op, schedule? }; a test pins phases, the Drift outcome attribute, and that omittingschedulereturns no schedule.report,issueandpull-requesteach produce the expected step wiring;reportopens nothing.-no-colorplan text and that no plan JSON reaches it.src/describe-resources.tsmapsvalues.root_module.resources[]addresses tobuildRoots()keys, pinned by a recordedshow -jsonfixture.initorshowyields not-observed with reasonread-failedfor every declared entity of that root, never absent.owned, a resource found outside state reportsunknown, both tested.ownershipChanneldeclared on the plugin and passed to the conformance suite.describeObservationConformanceruns green with at least one present, one not-observed and one ownership scenario.generateOpsPipelineYAML: cron,workflow_dispatch, concurrency group,issues: write, the terraform install line.concepts/lifecycle-models.Gates: vitest on
lexicons/terraform,lexicons/temporalandpackages/core/src/op(982 passed),tsc --noEmitclean, repo-wide typecheck no regressions,check-lexicons.ts18 of 18 at 23/23, prose ratchet and diataxis check clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01JFvsuJmNqWXGUzzhJgb2oe