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

Add pedantic mode #5245

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add pedantic mode #5245

wants to merge 1 commit into from

Conversation

Jarema
Copy link
Member

@Jarema Jarema commented Mar 26, 2024

This adds pedantic mode as requested in #4959

Draft, as I need to make sure all cases are covered and tested.
I also want to check if the amount of changes in arguments passed to assigment functions could be reduced.

Signed-off-by: Tomasz Pietrek tomasz@nats.io

Copy link
Contributor

@ripienaar ripienaar left a comment

Choose a reason for hiding this comment

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

I left some comments here, in general this now looks like it does the right thing and I did some tests and it looks good.

server/consumer.go Outdated Show resolved Hide resolved
server/consumer.go Outdated Show resolved Hide resolved
server/stream.go Outdated Show resolved Hide resolved
@Jarema Jarema force-pushed the pedantic branch 2 times, most recently from f6623a7 to b9165ad Compare April 23, 2024 18:44
Pedantic mode intention has been added to all paths.
Now it need to be properly handled and tested

Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
@Jarema Jarema requested a review from ripienaar May 9, 2024 00:20
@Jarema Jarema marked this pull request as ready for review May 10, 2024 15:48
@Jarema Jarema requested a review from a team as a code owner May 10, 2024 15:48
Copy link
Contributor

@ripienaar ripienaar left a comment

Choose a reason for hiding this comment

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

Some minor changes from me what I unfortunately over looked when we were in draft

@@ -36,6 +36,14 @@ import (
"github.com/nats-io/nuid"
)

// StreamRequest is used to create or update a stream.
type StreamRequest struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

We have CreateConsumerRequest which seems very clear, where StreamRequest seems ambigious - we have many other kinds of stream request other than create/update. So maybe a better for this would be nice.

Stream string `json:"stream_name"`
Config ConsumerConfig `json:"config"`
Action ConsumerAction `json:"action"`
Pedantic bool `json:"pedantic"`
Copy link
Contributor

Choose a reason for hiding this comment

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

we could probably make this omitempty also same as in the stream one

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.

None yet

2 participants