-
-
Notifications
You must be signed in to change notification settings - Fork 249
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
sbt plugin rewrite #933
sbt plugin rewrite #933
Conversation
bb67c33
to
5afe750
Compare
…ings, we get invalid code generated. Fix that.
5afe750
to
1ebf6b0
Compare
One curious consideration is how sbt scripted tests are able to interpolate the current At some point in the future the |
Actually the scripted tests don't really need to be duplicated, they slow down the build quite a lot already and we expect the same code to be generated in both cases. I think a simple one would be enough. |
1ebf6b0
to
aa16c71
Compare
Yeah, that is quite surprising. Up from 13 minutes to 20 minutes certainly seems quite excessive. I wonder whether the penalty really is due to starting up an entire environment from scratch, so more gains would be made by merging the two existing tests into one, especially since it's more about existing of files instead of |
Also, maybe more broadly -- it may not be necessary to run scalafmt for these automatically generated source files, as they are never intended to be committed. At least on my machine, the startup penalty there is nontrivial, so it would benefit me personally. I don't believe it would significantly impact the tests here, though maybe a little bit. |
One breaking change here is renaming If you feel strongly about this, I can try to add a |
Yeah that would be nice to merge them if you know how to. Also I think the gitlab one slow so no need to run it twice. |
Maybe make it an optional param, that is true by default with the explicit command and false by default with the new way? |
Yeah the old name was unfortunate. Deprecating it would be nicer though, to ease the migration. |
I'll time it to see whether it actually is slow, then open a follow-up PR |
OK, out of curiosity I commented out scalafmt. Scripted test reduced in time from 70 seconds to 42 seconds. For auto-generated clients, we could delay scalafmt until the very end (since once scalafmt is fully initialized subsequent runs are fast), but the challenge here is |
367b2e8
to
b8315d4
Compare
I must admit, I don't fully understand the What will happen is |
47769e9
to
eb81c6f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I left a few remarks and questions, mostly around docs.
codegen-sbt/src/sbt-test/codegen/test-compile/src/main/graphql/schema.graphql
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, thanks!
I will merge but prevent the docs generation until the next release.
This PR adds a reimagined workflow for
caliban-codegen-sbt
, automatically generating clients from files placed insrc/main/graphql
I included what I presume is what's required for updating the docs, if anything more needs to be done there I'm happy to follow up.