-
Notifications
You must be signed in to change notification settings - Fork 13
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
Upgrade to Buf CLI version 1.35.1 #213
Conversation
ca1e520
to
ef0d006
Compare
ef0d006
to
b3a1f75
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.
Thanks for picking up the migration to v2 - I have been away and didn't realize how much had been done since I last looked.
src/test/kotlin/build/buf/gradle/BreakingWithProtobufGradleTest.kt
Outdated
Show resolved
Hide resolved
@andrewparmet I was able to get almost everything to pass with fairly minimal changes:
This should allow things to move forward. Next steps are to get the ignored test to pass and do add additional test coverage for cases that combine |
src/main/kotlin/build/buf/gradle/ProtobufGradlePluginSupport.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/build/buf/gradle/ProtobufGradlePluginSupport.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/build/buf/gradle/ProtobufGradlePluginSupport.kt
Outdated
Show resolved
Hide resolved
I think there are still some test behaviors that need to be nailed down, but I think this is a reasonable milestone with all existing tests passing and minimal behavior changes. |
build.gradle.kts
Outdated
implementation(libs.jacksonModuleKotlin) | ||
implementation(libs.jacksonDataformatYaml) |
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.
nit: alphabetical order and separation of dependency types
implementation(libs.jacksonModuleKotlin) | |
implementation(libs.jacksonDataformatYaml) | |
implementation(libs.jacksonDataformatYaml) | |
implementation(libs.jacksonModuleKotlin) | |
gradle/libs.versions.toml
Outdated
jacksonModuleKotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version.ref = "jackson" } | ||
jacksonDataformatYaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version.ref = "jackson" } |
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.
nit: alphabetical order
jacksonModuleKotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version.ref = "jackson" } | |
jacksonDataformatYaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version.ref = "jackson" } | |
jacksonDataformatYaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version.ref = "jackson" } | |
jacksonModuleKotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version.ref = "jackson" } |
import java.io.File | ||
|
||
internal class BufYamlGenerator { | ||
val yamlMapper = ObjectMapper(YAMLFactory()).registerKotlinModule() |
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.
private
?
): String { | ||
val bufYaml = | ||
bufYamlFile?.let { | ||
yamlMapper.readValue(it, object : TypeReference<MutableMap<String, Any>>() {}) |
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.
For some reason a few tests were failing depending on how the Jackson object mapper was initialized. I will look into it further, but for now tests are all passing in CI. |
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.
I'd expect you to have to register the YAML module.
All tests pass now. A couple of tests now specify an older Buf version.
Older comment:
This currently disables two tests in
BreakingWithProtobufGradleTest
:normally breaking schema with an ignore
schema with multi-directory workspace
I'm still trying to see if I can reasonably get them to pass.