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

Study/Devfile: proper object hierarchy for tools in the schema and java model #12587

Closed
skabashnyuk opened this issue Feb 4, 2019 · 2 comments
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed.

Comments

@skabashnyuk
Copy link
Contributor

skabashnyuk commented Feb 4, 2019

Description

We have in mind to support quite a lot of different tools in devfile

tools:
  - name: mvn-stack
    type: dockerImage
    image: maven:3.5.4-jdk-8
    entryPoint: sleep infinity
    persistentVolumes:
      - name: maven-repo
        containerPath: /root/.m2
    services:
      - name: spring-boot
        port: 8080
    mountProjectsSources: true
  - name: mysql
    type: kubernetes
    local: petclinic.yaml
    selector:
      app.kubernetes.io/name: mysql
      app.kubernetes.io/component: database
      app.kubernetes.io/part-of: petclinic
  - name: theia-ide
    type: cheEditor
    id: eclipse/theia:0.0.3
  - name: jdt.ls
    type: chePlugin
    id: eclipse/theia-jdtls:0.0.3

At this time we support cheEditor, chePlugin, kubernetes tools. But there is no proper class hierarchy. I Neither in json schema neither in Devtool model. It just a set of fields. It can become a problem when we will introduce complex tools such as dockerImage tool #12389

In this issue we would like to have a study how we can have proper object hierarchy for tools in schema and in model
To look like this. See CloudAppDefinition.
devfile

@skabashnyuk skabashnyuk added kind/task Internal things, technical debt, and to-do tasks to be performed. team/platform labels Feb 4, 2019
@mshaposhnik
Copy link
Contributor

There was two directions during work on this issue, which are related each other:

  1. Check if any on the JSON schema to POJO generators support and can generate hierarchical structure of the tools object;
  2. Check is there is an JSON-schema validators that can handle more complex tool definitions and be compliant with 07 schema draft - support "if"/"else"/"then" constructions etc.

As for the POJO, there is currently no library which can generate classes with any kind of hierarchy,
the only way to achieve this is to reject POJO autogeneration and use manually created objects model.

As for the schema, recommended by schema comitee library https://github.com/everit-org/json-schema could be good replacement for current one, since it supports latest draft features, but has license limitations since it uses org.json api which cannot be used in eclipse projects. See rejected CQ's for explanation:

@mshaposhnik
Copy link
Contributor

Since we\re unable to apply new validator now, there is issue to imporove the messaging in the current one: #12694

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed.
Projects
None yet
Development

No branches or pull requests

2 participants