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

Workspace loader #8838

Merged
merged 29 commits into from
Mar 5, 2018
Merged

Workspace loader #8838

merged 29 commits into from
Mar 5, 2018

Conversation

vitaliy-guliy
Copy link
Contributor

What does this PR do?

Adds an application for starting a workspace and loading corresponding IDE.

wsloader 01

wsloader 02

What issues does this PR fix or reference?

#8556
#8682

Release Notes

  • Application to start a workspace and open predefined IDE

Copy link
Contributor

@benoitf benoitf left a comment

Choose a reason for hiding this comment

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

I don't see unit tests of the loader ?

<url-pattern>/loader/*</url-pattern>
</servlet-mapping>

<security-role>
Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose we could remove security-role

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we have more strict checking ? like variables not used, emit only if there is no error in the code

@@ -0,0 +1,36 @@
/*******************************************************************************
* Copyright (c) 2015-2018 Red Hat, Inc.
Copy link
Contributor

Choose a reason for hiding this comment

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

it should be only 2018, in 2015 this loader didn't exist

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How it will be for pom.xml? 2018?

Copy link
Contributor

Choose a reason for hiding this comment

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

@vitaliy-guliy I would say yes
just specify correct inception year like https://github.com/eclipse/che/blob/master/dashboard/pom.xml#L27

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Then we will have following

Copyright (c) 2018-2018 Red Hat, Inc.

Copy link
Contributor

Choose a reason for hiding this comment

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

you may want to add

    <properties>
        <license_years>2018</license_years>
    </properties>

to have only

    Copyright (c) 2018 Red Hat, Inc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's decide. We have only 2018 or period 2018-2018.

Copy link
Contributor

Choose a reason for hiding this comment

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

up to you

]
},
resolve: {
extensions: ['.tsx', '.ts', '.js']
Copy link
Contributor

Choose a reason for hiding this comment

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

why .tsx on this project ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = merge(common, {
devtool: 'inline-source-map',
Copy link
Contributor

Choose a reason for hiding this comment

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

sourcemap is working if not enabled in tsconfig ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have just tested when disabled in tsconfig. It works but when debugging source files have a lot of extra information.

},
devServer: {
contentBase: './dist',
port: 3050,
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason to use 3050 instead of classical 3000 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just a historical reason. Changed to 3000.

@@ -0,0 +1,44 @@
/*******************************************************************************
* Copyright (c) 2015-2018 Red Hat, Inc.
Copy link
Contributor

Choose a reason for hiding this comment

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

2018

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@benoitf
Copy link
Contributor

benoitf commented Feb 20, 2018

is it also possible to have a docker build like for dashboard app, so if ppl don't have the expected nodejs version it's still fine

<parent>
<artifactId>che-assembly-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>6.1.0-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

version here is incorrect

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

<name>Che Workspace Loader :: Web App</name>
<inceptionYear>2018</inceptionYear>
<dependencies>
<dependency>
Copy link
Contributor

Choose a reason for hiding this comment

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

could you please explain why we're having this dependency ?
AFAIK this module is not using it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed as unused. Thanks.

<exclude>**/*.eot</exclude>
<exclude>**/*.css</exclude>
<exclude>**/*.woff</exclude>
</excludes>
Copy link
Contributor

Choose a reason for hiding this comment

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

is that the list of excludes is accurate ? it seems some of the files are not there so maybe the whole configuration can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

<artifactId>maven-source-plugin</artifactId>
<configuration>
<includePom>true</includePom>
<includes>
Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose this is a copy from dashboard module but then I'm not sure the include are expected

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

@benoitf
Copy link
Contributor

benoitf commented Feb 20, 2018

could you please also list CQsof new dependencies in the description of the PR ?

@vitaliy-guliy
Copy link
Contributor Author

@vitaliy-guliy
Copy link
Contributor Author

Docker build is added

@benoitf benoitf added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. kind/enhancement A feature request - must adhere to the feature request template. labels Feb 23, 2018
@ashumilova
Copy link
Contributor

@vitaliy-guliy CQ is approved https://dev.eclipse.org/ipzilla/show_bug.cgi?id=15581

@@ -0,0 +1,77 @@
// Karma configuration
Copy link
Contributor

Choose a reason for hiding this comment

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

it will require copyright headers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not actual

@@ -0,0 +1,77 @@
// Karma configuration
// Generated on Thu Feb 22 2018 15:39:12 GMT+0200 (EET)
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we could delete this generated line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not actual anymore

config.set({
webpack: webpackConfig,
mime: {
'text/x-typescript': ['ts','tsx']
Copy link
Contributor

Choose a reason for hiding this comment

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

do we have tsx ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not actual anymore

@benoitf
Copy link
Contributor

benoitf commented Feb 27, 2018

about the tests, I think that karma/mocha can be replaced in favor of jest
so, no need to have Chrome, etc, it runs very fast

$ ./node_modules/.bin/jest 
 PASS  test/test.spec.ts
  Workspace Loader
    ✓ > must have "workspace-loader" in DOM > (11ms)
    ✓ > test when workspace key is not specified (8ms)
    ✓ > test getWorkspace with test value (31ms)
    > must handle workspace
      ✓ > must be called (2ms)
    > must open IDE for RUNNING workspace
      ✓ > must be called (2ms)
    > must start STOPPED workspace
      ✓ > must be called (2ms)
    > must restart STOPPING workspace
      ✓ > must be called (2ms)

  console.error src/index.ts:32
    Workspace is not defined

Test Suites: 1 passed, 1 total
Tests:       7 passed, 7 total
Snapshots:   0 total
Time:        1.219s
Ran all test suites.

"src"
],
"compilerOptions": {
/* Basic Options */
Copy link
Contributor

Choose a reason for hiding this comment

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

JSON is not allowing comments, so all comments should be removed
you may check on any online JSON validator

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@vitaliy-guliy
Copy link
Contributor Author

Babel, karma and jasmine have been removed.
Now we use jest.
Passing tests become more quick.
Thanks.

@vitaliy-guliy
Copy link
Contributor Author

@benoitf Do we need to pass tests while compiling the app?

@benoitf
Copy link
Contributor

benoitf commented Feb 28, 2018

I would say it's better so PR build will fail if someone broke the tests

Copy link
Contributor

@benoitf benoitf left a comment

Choose a reason for hiding this comment

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

maybe new CQs are required for the tests ?

@vitaliy-guliy
Copy link
Contributor Author

@benoitf
Copy link
Contributor

benoitf commented Mar 1, 2018

@vitaliy-guliy could you add the version of jest in CQ and append it with "and later version" so we can easily update version without new CQs
also you've to click on the button Issues addressed, return CQ to IPTeam

@ashumilova ashumilova merged commit 3da13d5 into master Mar 5, 2018
@benoitf benoitf removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Mar 5, 2018
@benoitf benoitf added this to the 6.2.0 milestone Mar 5, 2018
hkolvenbach pushed a commit to hkolvenbach/che that referenced this pull request Mar 12, 2018
Adding workspace loader application.
@vitaliy-guliy vitaliy-guliy deleted the workspace-loader branch March 13, 2018 14:09
skabashnyuk pushed a commit that referenced this pull request Jan 3, 2020
Adding workspace loader application.
skabashnyuk pushed a commit to skabashnyuk/che that referenced this pull request Mar 11, 2020
Adding workspace loader application.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A feature request - must adhere to the feature request template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants