Skip to content
This repository has been archived by the owner on Jan 20, 2023. It is now read-only.

Create Unified plugin broker that merges functionality of all the plugin type specific brokers #37

Merged
merged 8 commits into from
Mar 25, 2019

Conversation

garagatyi
Copy link

What does this PR do?

Note: This PR is designed to be reviewed in a commit-by-commit manner. Commit message of each commit explains what was changed in the corresponding commit.

Add new unified plugin broker that should co-exist with other plugin brokers for the time being.
It accepts plugin meta.yaml entries of all the types instead of type specific as other brokers do.
It sorts meta.yaml entries depending on the type and pass them to the appropriate broker implementations.
Tested locally with config.json containing all the meta.yaml entries from the repo for manual testing of other brokers.

What issues does this PR fix or reference?

Closes redhat-developer/rh-che#1304

Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
@garagatyi garagatyi changed the title Unified broker Create Unified plugin broker that merges functionality of all the plugin type specific brokers Mar 20, 2019
Copy link
Member

@sleshchenko sleshchenko left a comment

Choose a reason for hiding this comment

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

LGTM

brokers/unified/broker.go Outdated Show resolved Hide resolved
Copy link
Contributor

@amisevsk amisevsk left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@davidfestal davidfestal left a comment

Choose a reason for hiding this comment

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

Great. I'll be able to use the unified broker in the initContainer I create in the CRD controller. 1 container instead of 3 at workspace start. I'll rebase my current work on brokers on this change.

@garagatyi
Copy link
Author

@davidfestal not sure whether it is good time to do that. We also plan to move meta download from plugin registry in unified broker. With this improvement you would be able to remove some code from CRD POC codebase

@garagatyi
Copy link
Author

@davidfestal @sleshchenko @amisevsk I made plugin type matching case insensitive, please take a look and approve again

@davidfestal
Copy link
Contributor

@davidfestal not sure whether it is good time to do that. We also plan to move meta download from plugin registry in unified broker. With this improvement you would be able to remove some code from CRD POC codebase

In fact I was already planning to open a very lightweight PR on plugin brokers with my local changes that allowed me to reuse them as is in the CRD Controller. I'll do it as soon as your current PR is merged: It included the promotion of the processPlugin() methods to public visibility, which is now provided by your PR.

And then I plan to integrate in the CRD controller new features / refactorings of the che-plugin-broker as soon as they are merged. The idea is to keep up-to-date and use standard components as much as possible.

Copy link
Contributor

@amisevsk amisevsk left a comment

Choose a reason for hiding this comment

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

LGTM still.

If we're matching case-insensitive, does it make sense to include that in some tests? E.g. the type on the added test config could be lower case.

Copy link
Member

@sleshchenko sleshchenko left a comment

Choose a reason for hiding this comment

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

LGTM

@garagatyi
Copy link
Author

If we're matching case-insensitive, does it make sense to include that in some tests? E.g. the type on the added test config could be lower case.

@amisevsk you are right, I'll need to add tests for that

@garagatyi
Copy link
Author

@amisevsk I added unit tests and couple of fixes that I was needed for testing or that I discovered along the way

@garagatyi
Copy link
Author

Guys I did some changes. I checked them on Che - everything works fine. I started workspace with plugins of each kind.
Please, add your reviews again

Oleksandr Garagatyi added 7 commits March 25, 2019 10:13
This broker is capable of processing Che plugins of all
types. Depending on the plugin type it calls an appropriate
plugin broker implementation.
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
@garagatyi garagatyi merged commit 207ca2c into master Mar 25, 2019
@garagatyi garagatyi deleted the unifiedBroker branch March 25, 2019 08:16
@garagatyi garagatyi mentioned this pull request Mar 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Merge plugin brokers into a single program - unified plugin broker
5 participants