Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs/design: Initial diagnostics design #108

Merged
merged 12 commits into from
Sep 2, 2021
Merged

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Aug 17, 2021

Reference: #24

@bflad bflad added documentation Improvements or additions to documentation design-doc Issues or pull requests about a design document, capturing design ideas and trade-offs. labels Aug 17, 2021
@bflad bflad added this to the v0.3.0 milestone Aug 17, 2021
@bflad bflad requested a review from a team August 17, 2021 15:51
Copy link
Contributor

@paddycarver paddycarver left a comment

Choose a reason for hiding this comment

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

I like the proposal, I agree with the recommendation at the end, and I think you did a really great job with this document. Amazing work.

I think the part I'm not seeing explicitly called out here that we talked about informally is your idea of validation helpers like Not, and how the different approaches intersect with that kind of work.

I think as we make diagnostics more prevalent throughout the codebase and require provider devs to interface with them more often, we're going to run into more and more situations where we're going to want to discriminate between diagnostics using more than just their severity, that different types or kinds of diagnostics will merit different handling. And I think your proposal will do a good job of addressing that.

I left some comments asking for clarification on things, but I think the proposal is good, I'm mostly just asking so we can surface and record context.

@@ -0,0 +1,293 @@
# Diagnostics

Early in the framework design, [errors were recommended over panics](./panic-error.md). This requires functions throughout the framework to appropriately handle error return values to ensure they are correctly returned back to Terraform for practitioner and developer feedback. Terraform CLI, however, allows two levels of contextualized feedback: warning and error diagnostics. Warnings generally signal an issue, but are not intended to prevent further execution, while errors generally will return early. This type of feedback is generally preferable over warning and error log entries, since Terraform itself is designed around human workflows and direct feedback, rather than a long running service or system.
Copy link
Contributor

Choose a reason for hiding this comment

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

This type of feedback is generally preferable over warning and error log entries, since Terraform itself is designed around human workflows and direct feedback, rather than a long running service or system.

This is a really good callout.

docs/design/diagnostics.md Outdated Show resolved Hide resolved
docs/design/diagnostics.md Outdated Show resolved Hide resolved
docs/design/diagnostics.md Outdated Show resolved Hide resolved
docs/design/diagnostics.md Outdated Show resolved Hide resolved
docs/design/diagnostics.md Outdated Show resolved Hide resolved
docs/design/diagnostics.md Outdated Show resolved Hide resolved
docs/design/diagnostics.md Show resolved Hide resolved
docs/design/diagnostics.md Outdated Show resolved Hide resolved
docs/design/diagnostics.md Outdated Show resolved Hide resolved
@bflad bflad requested a review from paddycarver August 31, 2021 17:30
Copy link
Contributor

@paddycarver paddycarver left a comment

Choose a reason for hiding this comment

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

This has everything I can think of in it. Great work.

@paddycarver paddycarver requested a review from kmoe August 31, 2021 19:54
Copy link
Member

@kmoe kmoe left a comment

Choose a reason for hiding this comment

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

LGTM, with optional readability fixes

docs/design/diagnostics.md Outdated Show resolved Hide resolved
docs/design/diagnostics.md Outdated Show resolved Hide resolved
bflad and others added 2 commits September 2, 2021 11:03
Co-authored-by: kmoe <5575356+kmoe@users.noreply.github.com>
@bflad bflad merged commit dfae688 into main Sep 2, 2021
@bflad bflad deleted the bflad-d-diagnostics-design branch September 2, 2021 15:20
@github-actions
Copy link

github-actions bot commented Oct 3, 2021

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
design-doc Issues or pull requests about a design document, capturing design ideas and trade-offs. documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants