Coder Social home page Coder Social logo

exasol / extension-manager Goto Github PK

View Code? Open in Web Editor NEW
2.0 6.0 0.0 992 KB

Exasol extension-manager

License: MIT License

TypeScript 4.01% Go 64.84% Shell 0.12% JavaScript 0.49% Java 29.75% Python 0.79%
exasol-integration administration-tools-and-libraries

extension-manager's Introduction

Exasol Extension Manager

Go Reference Build Status Extension Manager Java Client: Maven Central โ€“ Extension Manager Java Client, Extension integration tests library: Maven Central โ€“ Extension integration tests library

Quality Gate Status Coverage Code Smells Maintainability Rating Security Rating Bugs Vulnerabilities

This project contains the Exasol extension manager. It's a tool for installing and managing extensions like Virtual Schemas.

REST API Documentation

The extension-manager exposes a REST API for the frontend.

This API is documented via Swagger. In order to view it, checkout this repo, run go run ./... and open http://localhost:8080/swagger/index.html.

Additional Information

Developer Guides

Related Projects

extension-manager's People

Contributors

ckunki avatar jakobbraun avatar kaklakariada avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

extension-manager's Issues

Add endpoint for getting parameters

When users list the installed extensions they don't need to know the parameters. In order to keep the response small, we should

  • remove the parameters them from the list
  • and provide a separate endpoint GET /api/v1/extensionmanager/installations/{id}/{version} that returns the parameters.

This should be implemented before #65

Add error handling

Add error handling to the extension api
For

  • SqlClient
  • for methods like install

Currently requests return an 500 Internal server error also for missing parameters (e.g. dbHost URL param). A helpful error message and a code 4xx must be returned in this case.

Extension discovery

Make the extension-manager automatically pick up extension definition files.

Refactor URLs of the REST API requests

To have a uniform API we need to use the following request URLs:

GET /api/v1/extensionmanager/extensions (List)
PUT /api/v1/extensionmanager/extensions/{id}/{version}/install
DELETE /api/v1/extensionmanager/extensions/{id}/{version}

GET /api/v1/extensionmanager/installations
POST /api/v1/extensionmanager/installations/{id}/{version}/instances
GET /api/v1/extensionmanager/installations/{id}/{version}/instances
DELETE /api/v1/extensionmanager/installations/{id}/{version}/instances/{id}

Fix golangci-lint issues

When running golangci-lint with option --enable-all it finds many warnings in the source code. We should fix these warnings (or configure exclusions) and use --enable-all on the CI build.

We enabled the following linter presets: bugs,complexity,format,import,module,sql,comment,performance,test.

Presets error,style,metalinter,unused are still disabled because they cause too many false positives.

Document meaning of status 404 for GetExtensionDetails request

When GET /api/v1/extensionmanager/extensions/{extensionId}/{extensionVersion} returns status 404 it means that it's not possible to create an instance of the extension because it's not supported.

We need to document this in the OpenApi specification of the request.

Add prefix to log messages from extensions

JS Extensions can log via console.log(). These log messages should be prefixed with the extension id. This will simplify debugging because it's easy to see which extension wrote a log message.

Handle panics in validator JavaScript code

When validating parameters, EM executes JS code. When this code throws an Error (e.g. because of a bug), this will cause a panic in Go. In order to avoid crashing the server, we need to handle panics from the JS code.

Create Plugin Development Documentation

At the moment there is no documentation how to implement a Custom Plugin.
It would be good if we have a documentation for it and a separate Github Repository with a sample plugin.

Maybe a good feature for us would be that a plugin needs is own repository and the name needs to start with exasol-extension
Like exasol-extension-aws-vs-s3.
This is used by Terraform for discovering community plugins, maybe we want something similar.

Refactor transaction handling

Currently extensions are responsible for committing the transaction.
This should be done by EM itself.
EM must also check that the extension does not execute transaction management commands like commit or rollback and cause an error.

Fix failing dependency check build

Dependency check fails with the following error message:

 Error:  Failed to execute goal org.sonatype.ossindex.maven:ossindex-maven-plugin:3.2.0:audit (default-cli) on project extension-manager-client-java: Detected 1 vulnerable components:
Error:    com.fasterxml.jackson.core:jackson-core:jar:2.14.0:compile; https://ossindex.sonatype.org/component/pkg:maven/com.fasterxml.jackson.core/[email protected]?utm_source=ossindex-client&utm_medium=integration&utm_content=1.8.1
Error:      * 1 vulnerability found (7.5); https://ossindex.sonatype.org/vulnerability/sonatype-2022-6438

Move API to dedicated repo

The extension API has a different release cycle. For that reason we should move it to a dedicated repo. However, we did not do it's quite unstable until now and that would require a release for each change,

Add request for installing extensions

Extensions expect that the EXA_EXTENSION schema exists when the extension manager installs them.
So EM must create the schema before running the installation if it does not yet exist.

Add backend

Add a first implementation of the backend

Handle errors in JavaScript code

The JavaScript code of extension definitions potentially throws errors in case of programming errors. This causes the code to panic which crashes EM.
That's why we need to gracefully handle errors in JavaScript code.

Create infrastructure for extension registry

The extension registry is a json file that lists all available extensions.
We need to deploy an HTTPS endpoint that allows the extension manager to download the registry file.

Use matching extension manager version in integration tests

Currently integration tests always use the latest extension manager version. This is a problem for these reasons:

  • This will break existing tests for extensions when a new, incompatible version of the extension manager is published.
  • You want to test an extension against a specific previous release of extension manager.

Instead of using version latest the tests should use the EM version they where built against. We can implement this by using the current project version as default instead of latest in method ExtensionTestConfig.getExtensionManagerVersion().

  • Verify consistent versions in .project-keeper.yml and pom.xml (properties/revision)
  • Use current version for installing EM

Allow testing extensions with node

When loading an extension that calls registerExtension(createExtension()) in a Jest test, tests fail when loading the module because installedExtension is not defined:

    ReferenceError: installedExtension is not defined

      43 | }
      44 |
    > 45 | registerExtension(createExtension())
         |                  ^
      46 |

      at registerExtension (node_modules/@exasol/extension-manager-interface/src/api.ts:242:23)
      at Object.<anonymous> (src/extension.ts:45:18)
      at Object.<anonymous> (src/extension.test.ts:2:1)

A possible solution is to set global.installedExtension in registerExtension().

See also exasol/extension-manager-interface#12

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.