epam / epam/cloud-pipeline

Backend for GUI Plugins

Open
#3,963 0 comments 0 reactions 1 assignee Claimed by @kbashpayev View on GitHub
kind/enhancement
Dominant language
Java
Stars
163
Forks
65
Avg merge
11h 46m
Merged PRs (30d)
29

Description

**Background**
Related to #3926
This issue describes implementation of backend for plugins framework. UI Plugin is represented as one or several js/css/etc files stored on the server in some folder.

**Approach**
Add a new entity stored in DB `UIPlugin`
- `id` - Long, primary key
- `name` - String
- `type` - enum [`LaunchForm`, `RunLog`]
- `path` - String within `pluginsFolder` defined in `SystemPreferences`

Add a new entity stored in DB `UIPluginAssignment` with the following fields:
- `id` - Long, primary key
- `plugin_id` - FK to `UIPlugin` table
- `tool_id`- id of Tool to assign plugin
- `pipeline_id` - id of Pipeline to assign plugin
- `version` - version of Pipeline or Tool to assign
- `sids` - `List` [`name`, `principal`] users for assignment

##### API
###### CRUD for `UIPlugin`
- `/plugins/` `GET` params: `type` optional - returns list of `UIPlugin` entries with filter by `type` if specified
- `/plugins/` `POST` - creates/updates `UIPlugin`, if `id` is specified - entry is updated, if `id` is missing - new entry is created
- `/plugins/$id` `GET` - returns `UIPlugin` entry by $id
- `/plugins/$id` `DELETE` - deletes `UIPlugin` entry by $id

###### Get plugin file content
- `/plugins/$id/$path` `GET` - returns content of plugin file specified by id and path, method should set response Content-type as `text/javascript`. Path is relative to `pluginsFolder` defined in `SystemPreferences`

###### CRUD for `UIPluginAssignment`
- `/plugins/assign` `GET` params: `tool_id` or `pipeline_id` optional, `version` optional - returns list of `UIPluginAssignment` entries assigned to specified tool/pipeline version
- `/plugins/assign` `POST` - creates/updates `UIPlugin`, if `id` is specified - entry is updated, if `id` is missing - new entry is created
- `/plugins/$id` `GET` - returns `UIPluginAssignment` entry by $id
- `/plugins/$id` `DELETE` - deletes `UIPluginAssignment` entry by $id

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.