Skip to content

fix: bump coder/trivy to converge random_* values passed into modules - #231

Merged
BobbyHo merged 1 commit into
mainfrom
chore/bump-coder-trivy-random-preset
Oct 27, 2026
Merged

BobbyHo merged 1 commit into
mainfrom
chore/bump-coder-trivy-random-preset

Conversation

@BobbyHo

@BobbyHo BobbyHo commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Preview uses Coder's fork of Trivy to evaluate Terraform templates. A fix for templates that pass a random_* value into a module was merged into that fork in coder/trivy#84. Preview only picks up the fork at the exact commit named in go.mod, so the fix does not reach preview on its own. This PR points preview at the commit that contains the fix.

Refs coder/trivy#84

How to navigate this PR
  • Only dependency files change. There is no production code and no test code.
  • go.mod: the replace line for github.com/aquasecurity/trivy now points to github.com/coder/trivy v0.0.0-20261026151418-65abc04915bd.
  • go.sum: the checksums for that version, created by go mod tidy.
Implementation
Expected Output
  • A template that passes a random_* resource value into a module now settles on a result, so preview stops getting stuck on that value.
  • Every submodule is evaluated on each pass, instead of evaluation stopping at the first submodule that changed.
  • Templates that do not use random_* values or modules behave the same as before.
Testing
  • No tests were added. The fix and its tests live in fix(terraform): converge when a random_* value reaches a module, and evaluate every submodule on each pass trivy#84.
  • go build ./... and go vet ./... pass.
  • go test ./... -skip Test_VerifyE2E passes.
  • Test_VerifyE2E/plan_stringindex fails locally because the coder/envbuilder v1.0.0 provider has no darwin_arm64 build. It fails the same way on main, so this change did not cause it. CI runs on Linux and should not hit it.
  • Not covered: preview has no test of its own for a random_* value passed into a module. That could be added as a follow-up.

Picks up coder/trivy#84. Preview now settles on a result when a
random_* resource value is passed into a module, and every submodule
is evaluated on each pass.
@BobbyHo
BobbyHo marked this pull request as ready for review October 26, 2026 15:31
@BobbyHo
BobbyHo requested review from a team and dylanhuff-at-coder October 26, 2026 15:32
@BobbyHo
BobbyHo merged commit 155f674 into main Oct 27, 2026
4 checks passed
@BobbyHo
BobbyHo deleted the chore/bump-coder-trivy-random-preset branch October 27, 2026 15:41
BobbyHo added a commit to coder/coder that referenced this pull request Oct 27, 2026
… passed into modules (#31357)

Update preview and Coder’s Trivy fork to fix dynamic parameters failing to settle when templates pass `random_*` values into modules. The upstream fix evaluates every submodule on each pass.

- Bump preview to `155f674f1c7b` and Trivy to `65abc04915bd`. Both updates are required because Go ignores dependencies’ `replace` directives.
- Only `go.mod` and `go.sum` change; no other module versions change. Regression tests live in the upstream Trivy fix.
- `go build ./...` and targeted Coder tests pass. Template ranking tests fail intermittently on both this branch and unmodified `main`, but pass in isolation.

Refs: [coder/trivy#84](coder/trivy#84), [coder/preview#231](coder/preview#231).
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