-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Fetch latest version for references, if not specified #128
Conversation
**Story:** As a developer using Confluent's schema registry, I want to always have a remote reference pointing at the latest remote version. There are cases where the version is unknown, or where it drifts between environments. By simply using the latest version, a large burden of managing versions across environments in our build file is lifted. As a developer using this plugin, I don't want to necessarily specify the remote schema version when specifying my references. I need a method of communicating this in my definition(s). **Implementation** A new method has been added to the Subject class, addReference(name: String, subject:String). When a reference is not specified with a verion, the compatibility and register tasks will fetch the latest version from the configured schema registry.
This is a feature that exists in the Maven plugin Confluent manages. Not having this feature has caused my team immense pain and churn. For what it's worth, in talking with Confluent folks, they don't seem too interested in making/owning a Gradle plugin, as well. I suppose that could change, though. |
Hello @ndwhelan and thank you for using this plugin. I wish you had created an issue first because It could have saved you some time doing this PR 😞 Thus there is improvment to do:
As for the interest in a Gradle plugin from Confluent I think they are pretty happy to have this plugin updated without costing them a cent 👀 If you want I can update this PR to reflect the 2 actions I listed above or I can let you do the changes yourself ? Once again sorry for the time spent and the pain in your team 🙏 |
Ah jeeze. Yeah, I'll update things. |
…schema registry accepts `-1` to use the latest version
Yeah, I can do all of that today.
…On Wed, Apr 19, 2023, 3:07 AM Florian Garcia ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In README.md
<#128 (comment)>
:
> +* For remote references, if no version is specified, the latest version of schema is fetched and used from the schema registry.
+ You can also specify `-1` for the same functionality
maybe we can move this part in the paragraph line 183 ?
If you have references to other schemas required before the register,
you can call the `addReference("name", "subject", version)`, this will add a reference to use from the registry.
The addReference calls can be chained.
``` ?
------------------------------
In README.md
<#128 (comment)>
:
> @@ -207,6 +207,18 @@ if you need information about the registered id.
}
}
```
+* For remote references, if no version is specified, the latest version of schema is fetched and used from the schema registry.
+ You can also specify `-1` for the same functionality
+```groovy
+schemaRegistry {
+ url = 'http://registry-url:8081'
+ register {
+ subject('avroWithRemoteReferences', '/absolutPath/dependent/path.avsc', "AVRO")
+ .addReference('avroSubject', 'avroSubjectType')
+ .addReference('avroSubjectTwo', 'avroSubjectTwoType', -1)
Instead of redefining the whole example, could you update one of the
reference in the register (and compatibility) examples ?
------------------------------
In README.md
<#128 (comment)>
:
> +* For remote references, if no version is specified, the latest version of schema is fetched and used from the schema registry.
+ You can also specify `-1` for the same functionality
Also, as this also work for compatibility, can you update the
documentation for this part too ?
—
Reply to this email directly, view it on GitHub
<#128 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHINQZXDSVRWA62MNHJA23XB6MKNANCNFSM6AAAAAAXC6FSAU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I updated the README! Thanks for the feedback! |
Thank you for the PR 🙏 |
Story:
As a developer using Confluent's schema registry, I want to always have a remote reference pointing at the latest remote version. There are cases where the version is unknown, or where it drifts between environments. By simply using the latest version, a large burden of managing versions across environments in our build file is lifted.
As a developer using this plugin, I don't want to necessarily specify the remote schema version when specifying my references. I need a method of communicating this in my definition(s).
Implementation
A new method has been added to the Subject class, addReference(name: String, subject:String). When a reference is not specified with a verison, the compatibility and register tasks will fetch the latest version from the configured schema registry.
I updated tests to use the new
@TempDir
in JUnit5, which I also think is an improvement over using the shadowed JUnit 4 class. I added some updates to the README, but please let me know if I could add more.