Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: log resource drift warnings in all workspace builds#18355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
dannykopping wants to merge3 commits intomain
base:main
Choose a base branch
Loading
fromdk/drift

Conversation

dannykopping
Copy link
Contributor

@dannykoppingdannykopping commentedJun 13, 2025
edited
Loading

Closes#16999

image

#17571 added the ability to detect and log Terraform state drift in workspace builds. We decided to only display these logs for prebuilds, initially, since prebuilds are most likely to be negatively impacted by state drift.

All output from Terraform is shown, and lines including# forces replacement will be marked asWARN.

This PR removes the above condition and improves test coverage.

We might consider adding a hidden flag to disable this logging, in case some operators find this objectionable?


Disclaimer: credit to Claude Code for initial draft of the tests.

Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Copy link
Contributor

@spikecurtisspikecurtis left a comment

Choose a reason for hiding this comment

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

We have to be careful about sending logs with elevated level. Provisionerd logs them directly at the level we get from the provisioner, which then will end up in operators log streams. That's especially problematic if provisionerd is embedded in Coderd.

I get that, arguably, if there is drift while you are claiming a prebuild then you are doing something wrong. But that isn't true of builds generally, and it's a bad idea for us to emit a bunch of WARN logs to core Coder operators based on stuff happening down in templates and builds, as template authorship might be delegated out to teams that are clients of the Coder platform.

The quickest way forward is to just not emit at WARN for this kind of stuff.

A more flexible and general solution would be to introduce some sort of log scope, to distinguish warnings and errors with builds and templates from warnings and errors with the provisioner. Only the latter should be emitted at WARN/ERROR level into the provisioner's log stream. The former can be emitted into thebuild logs at the given level so we display them appropriately in the UI.

@blink-soblink.so
Copy link
Contributor

Hey@dannykopping! 👋

Just wanted to drop by and say this is a really solid improvement! Expanding the resource drift warnings to all workspace builds (not just prebuilds) is going to help so many users catch potential issues early. The fact that you're also improving test coverage shows great attention to quality.

The screenshot you included makes it super clear what the feature does, and I love that you're thinking ahead about potential operator concerns with the hidden flag suggestion.

Keep up the excellent work! 🚀

P.S. @U018V85FG1X sent me to spread some good vibes!

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

@spikecurtisspikecurtisspikecurtis requested changes

Requested changes must be addressed to merge this pull request.

Assignees

@dannykoppingdannykopping

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

bug: build terraform logs don't include which fields have changed
2 participants
@dannykopping@spikecurtis

[8]ページ先頭

©2009-2025 Movatter.jp