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

Fetch latest version for references, if not specified #128

Merged
merged 3 commits into from
Apr 19, 2023

Conversation

ndwhelan
Copy link
Contributor

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.

**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.
@ndwhelan
Copy link
Contributor Author

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.

@ImFlog
Copy link
Owner

ImFlog commented Apr 18, 2023

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 😞
Fetching the latest version for a reference is already supported, If you take a look at the example, you will find some references using -1 that will fetch the last version of the reference.

Thus there is improvment to do:

  • Update the DSL to fetch the latest version (like what you done with the addReference without the version arg but that should default to -1
  • Update the documentation

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 🙏

@ndwhelan
Copy link
Contributor Author

Ah jeeze. Yeah, I'll update things.

…schema registry accepts `-1` to use the latest version
@ndwhelan
Copy link
Contributor Author

ndwhelan commented Apr 19, 2023 via email

@ndwhelan
Copy link
Contributor Author

I updated the README! Thanks for the feedback!

@ImFlog ImFlog merged commit 67eb31f into ImFlog:master Apr 19, 2023
@ImFlog
Copy link
Owner

ImFlog commented Apr 19, 2023

Thank you for the PR 🙏
I will release this with the download schema with metadata feature.

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.

3 participants