-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Deprecate NewDefaultServer #3404
Conversation
Signed-off-by: Steve Coffman <steve@khanacademy.org>
What help do you want? |
All the deprecation warnings for all the test usage cause the linter to fail. 😢 I don't know of a great solution, so if you have a suggestion, I would appreciate it. I'm not sure of a great way to make a test only equivalent function without using a special build constraint tag that would then cause more people to stumble on more regular I could add a I could copy-paste the NewDefaultserver function to be nested inside the various call sites, but that's a lot of duplication. |
I can make a pass over it. I think, if you are deprecating something, you should go ahead and remove it from internal code. I can get a glass of red, listen to a podcast, and start ctrl-v-ing a whole bunch. |
#3406 has this branch as its base, as I can not push directly. |
* replace in init server template * update _examples * update plugin tests * grep default setup across testserver/singlefile with test helper * replace all other cases in testserver/singlefile * replace testserver/nullabledirectives * grep testserver/followschema with test helper; fix all other cases * replace all test helpers with code * lint * docs: introspection (big change) * docs: simple replacements in code examples * docs: overhaul of subscriptions * add introspection to federation example for js tests
Thanks again! |
How do you propose to replace it and what did "they find out the hard way"? |
In the code, the comment for it now tries to explain that you should make your own local version of it, customized to suit your own needs (only add the transports you want, and customize the cache and transports to match your workloads):
|
This was only there for tests and as an example, but people have tried to use it in their production environments and found out the hard way it wasn't intended for that. Deprecating will hopefully make this more clear.
However, all the deprecation warnings for all the test usage cause the linter to fail. 😢
I don't know of a great solution, so if you have a suggestion for how to fix this, I would appreciate it.
I'm not sure of a great way to make a test only equivalent function without using a special build constraint tag that would then cause more people to stumble on more regular
go test ./...
I could add a
//nolint:staticcheck // SA1019: handler.NewDefaultServer is deprecated but usage for test is ok
everywhere, but that ignores all staticcheck checks, not just the deprecation one.I could copy-paste the NewDefaultserver function to be nested inside the various call sites, but that's a lot of duplication.
Signed-off-by: Steve Coffman steve@khanacademy.org