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

Support RunPlugin for Maven and Gradle plugins #1608

Merged
merged 5 commits into from
Feb 7, 2025

Conversation

mikhailshilkov
Copy link
Member

@mikhailshilkov mikhailshilkov commented Jan 29, 2025

This PR implements RunPlugin for the Java provider host. It's implemented for both Maven and Gradle but not other executors. For now, I assume we don't want folks to author plugins with less popular package managers, but we can also add those later.

To test RunPlugin, I creates a very basic provider gRPC service that implements only GetSchema. My test provider returns a hard-coded schema, and then tests validate the it goes smoothly through the CLI. Later on we can enhance those tests to be real resource providers.

All SDK classes are in the internal module.

Resolve #1606

@mikhailshilkov mikhailshilkov force-pushed the mikhailshilkov/runplugin branch 2 times, most recently from c973271 to a786e34 Compare January 30, 2025 07:56
@mikhailshilkov mikhailshilkov force-pushed the mikhailshilkov/runplugin branch from a786e34 to f328017 Compare February 5, 2025 16:25
@mikhailshilkov mikhailshilkov marked this pull request as ready for review February 5, 2025 16:45
@mikhailshilkov mikhailshilkov requested a review from a team as a code owner February 5, 2025 16:45
public CompletableFuture<GetSchemaResponse> getSchema(GetSchemaRequest request) {
throw new UnsupportedOperationException("Method 'getSchema' is not implemented");
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part of me thinks we should prefer interfaces with default implementations to abstract classes, but I don't know if there are important reasons to/to not to, so happy either way. I think Provider was an interface in TS and we found that a bit problematic at times, but TS interfaces don't support default implementations, so maybe that was it. Not sure.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's all internal for now in any case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the point of this PR, interface sounds like a great idea. I converted it for now, let's see how we want it to evolve later. It's all internal for now, indeed.

@mikhailshilkov mikhailshilkov merged commit 8f3cc40 into main Feb 7, 2025
23 checks passed
@mikhailshilkov mikhailshilkov deleted the mikhailshilkov/runplugin branch February 7, 2025 00:08
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.

Implement RunPlugin to enable source-based plugins written in Java
2 participants