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

fix: add severity levels to build errors #1285 #1544

Merged
merged 6 commits into from
May 21, 2024

Conversation

jonathanj-square
Copy link
Contributor

No description provided.

@jonathanj-square jonathanj-square requested review from a team and matt2e and removed request for a team May 20, 2024 21:35
@github-actions github-actions bot changed the title add severity levels to build errors #1285 feat: add severity levels to build errors #1285 May 20, 2024
@ftl-robot ftl-robot mentioned this pull request May 20, 2024
@jonathanj-square jonathanj-square changed the title feat: add severity levels to build errors #1285 fix: add severity levels to build errors #1285 May 20, 2024
@@ -132,6 +133,18 @@ func generateStruct(t reflect.Type, messages map[string]string) {
messages[t.Name()] = w.String()
}

// generateWellKnownNestedEnums generates the well-known nested enums for a given reflect.Type.
// Reflection cannot discover type aliased enums, so they need to get generated manually.
func generateWellKnownNestedEnums(t reflect.Type, w *strings.Builder) {
Copy link
Collaborator

@alecthomas alecthomas May 21, 2024

Choose a reason for hiding this comment

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

Ah awesome, I've been meaning to do something about enums for a while now.

This, and the "chicken and egg" problem of having the proto schema rely on the Go schema compiling and existing would be nice to solve in the general case. I think the permanent solution is to switch to static analysis. But this is great for now.

Copy link
Collaborator

@alecthomas alecthomas left a comment

Choose a reason for hiding this comment

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

I think it's okay to not have tests, the .proto file successfully compiling is sufficient.

@@ -14,3 +14,7 @@ func TestProtoRoundtrip(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, Normalise(testSchema), Normalise(actual))
}

func TestErrorProtoGeneration(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove if not used?

@alecthomas
Copy link
Collaborator

I think this needs to be plumbed through to the LSP too.

@jonathanj-square jonathanj-square merged commit 0934ea8 into main May 21, 2024
24 checks passed
@jonathanj-square jonathanj-square deleted the jonathanj/add-severity-levels-to-build-errors branch May 21, 2024 22:37
@matt2e matt2e added the approved Marks an already closed PR as approved label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Marks an already closed PR as approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants