Skip to content

Commit

Permalink
Merge pull request eclipse-che#13 in CLD/slx.cloud-che from feature/u…
Browse files Browse the repository at this point in the history
…pdatemaster to master

updated to 6.1.0 stable, new keycloak theme

* commit 'e58465aaeea236ff051b8176af4581a443c0fd88': (115 commits)
  fixed fonts and added google fonts fallback
  added box shadow fix
  added lato regular as bold
  added lato light italic
  updated license header
  added Lato Light to fonts, removed CHE from login page
  ST-3764, ST-3613 Create keycloak docker image, and use the latest login theme
  Remove commented
  Updated version to 6.1.0 tag
  [maven-release-plugin] prepare release 6.1.0
  RELEASE: Update dependencies versions
  RELEASE: Update parent pom version
  RELEASE: Set tags in Dockerfiles
  CHE-8747. Fix displaying pull request panel (eclipse-che#8760)
  Add different style for focusable element (eclipse-che#8757)
  Selenium: Add most common methods to the "SeleniumWebDriverHelper" (eclipse-che#8746)
  Selenium: increase timeout to check that a menu item is enabled (eclipse-che#8755)
  Support enter press in refactoring rename form (eclipse-che#8754)
  Selenium: change a way for selecting an element from suggestions list (eclipse-che#8736)
  CHE-7278 Properly handle restarting the workspace (eclipse-che#8612)
  ...
  • Loading branch information
Hanno Kolvenbach committed Feb 16, 2018
2 parents 14b4d8c + e58465a commit 968d71b
Show file tree
Hide file tree
Showing 844 changed files with 14,799 additions and 7,213 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ wsagent/che-core-api-languageserver*/** @evidolob @dkuleshov
wsagent/che-core-api-testing*/** @evidolob
wsagent/che-wsagent-core/** @skabashnyuk
wsagent/wsagent-local/** @skabashnyuk
wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/search/server/** @skabashnyuk
wsagent/che-core-api-project/src/test/java/org/eclipse/che/api/search/** @skabashnyuk
2 changes: 1 addition & 1 deletion agents/bootstrapper/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>6.1.0-SNAPSHOT</version>
<version>6.1.0</version>
</parent>
<artifactId>bootstrapper</artifactId>
<name>Agents :: Bootstrapper</name>
Expand Down
2 changes: 1 addition & 1 deletion agents/exec/che-exec-agent-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>exec-agent-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>6.1.0-SNAPSHOT</version>
<version>6.1.0</version>
</parent>
<artifactId>che-exec-agent-client</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion agents/exec/che-exec-agent-shared/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>exec-agent-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>6.1.0-SNAPSHOT</version>
<version>6.1.0</version>
</parent>
<artifactId>che-exec-agent-shared</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion agents/exec/installer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>exec-agent-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>6.1.0-SNAPSHOT</version>
<version>6.1.0</version>
</parent>
<artifactId>exec-agent</artifactId>
<name>Agent :: Exec</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,13 @@ fi

EXEC_AGENT_PORT=${CHE_SERVER_EXEC_AGENT_HTTP_PORT:-4412}

$HOME/che/exec-agent/che-exec-agent -addr :${EXEC_AGENT_PORT} -cmd ${SHELL_INTERPRETER} -logs-dir $HOME/che/exec-agent/logs

LOGS_DIR=''
## Checks whether workspace logs root exists if it does override exec-agent logs directory otherwise default folder would be used
if [ -d "${CHE_WORKSPACE_LOGS_ROOT__DIR}" ]; then
LOGS_DIR=$CHE_WORKSPACE_LOGS_ROOT__DIR/exec-agent
else
LOGS_DIR=$HOME/che/exec-agent/logs
fi

$HOME/che/exec-agent/che-exec-agent -addr :${EXEC_AGENT_PORT} -cmd ${SHELL_INTERPRETER} -logs-dir $LOGS_DIR
2 changes: 1 addition & 1 deletion agents/exec/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>6.1.0-SNAPSHOT</version>
<version>6.1.0</version>
</parent>
<artifactId>exec-agent-parent</artifactId>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion agents/git-credentials/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>6.1.0-SNAPSHOT</version>
<version>6.1.0</version>
</parent>
<artifactId>git-credentials-agent</artifactId>
<name>Git Credentials Agent</name>
Expand Down
29 changes: 22 additions & 7 deletions agents/go-agents/core/event/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@ func NewBus() *Bus {
// Pub publishes an event to the interested consumers.
func (bus *Bus) Pub(e E) {
bus.RLock()
defer bus.RUnlock()
cons, ok := bus.consumers[e.Type()]
consumers, ok := bus.consumers[e.Type()]
bus.RUnlock()

if ok {
for idx, v := range cons {
for _, v := range consumers {
v.Accept(e)
if tmpCons, ok := v.(TmpConsumer); ok && tmpCons.IsDone() {
bus.rm(e.Type(), idx)
bus.Rm(tmpCons)
}
}
}
Expand All @@ -81,19 +82,20 @@ func (bus *Bus) Pub(e E) {
func (bus *Bus) Sub(consumer Consumer, eType string) {
bus.Lock()
defer bus.Unlock()
bus.consumers[eType] = append(bus.consumers[eType], consumer)
bus.consumers[eType] = append(bus.copyConsumers(eType), consumer)
}

// SubAny does the same as Sub func, but for multiple event types.
func (bus *Bus) SubAny(consumer Consumer, types ...string) {
bus.Lock()
defer bus.Unlock()
for _, t := range types {
bus.consumers[t] = append(bus.consumers[t], consumer)
bus.consumers[t] = append(bus.copyConsumers(t), consumer)
}
}

// Rm removes given consumer from the bus, == operator is used to determine
// Rm removes given consumer from the bus, == operator is used
// to determine what elements should be removed.
// Returns true if consumer is removed.
func (bus *Bus) Rm(consumer Consumer) bool {
return bus.RmIf(func(c Consumer) bool { return c == consumer })
Expand Down Expand Up @@ -126,6 +128,10 @@ func (bus *Bus) Clear() map[string][]Consumer {
return tmp
}

// Removes consumer subscribed to a given type and placed at a
// given index. If it is the last consumer then the whole slice is removed,
// otherwise a copy of slice is used, so concurrently publishing go-routines are not affected.
// Note that this function MUST be called within an appropriate lock.
func (bus *Bus) rm(key string, idx int) {
arr := bus.consumers[key]
if len(arr) == 1 {
Expand All @@ -137,3 +143,12 @@ func (bus *Bus) rm(key string, idx int) {
bus.consumers[key] = newArr
}
}

// Returns a copy of consumers of a given event type.
// Note that this function MUST be called within an appropriate lock.
func (bus *Bus) copyConsumers(eType string) []Consumer {
consumers := bus.consumers[eType]
snapshot := make([]Consumer, len(consumers))
copy(snapshot, consumers)
return snapshot
}
54 changes: 54 additions & 0 deletions agents/go-agents/core/event/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
package event_test

import (
"sync"
"testing"

"github.com/eclipse/che/agents/go-agents/core/event"
Expand Down Expand Up @@ -80,6 +81,42 @@ func TestRmItself(t *testing.T) {
}
}

func TestManyTmpConsumersAreProperlyHandled(t *testing.T) {
publishingRoutinesCount := 5
eventsToPublish := 1000
subscribersCount := 100

bus := event.NewBus()
for i := 0; i < subscribersCount; i++ {
bus.Sub(&testTmpConsumer{hitsUntilDone: publishingRoutinesCount * eventsToPublish}, "test")
}

startWaiter := &sync.WaitGroup{}
startWaiter.Add(publishingRoutinesCount)

completionWaiter := &sync.WaitGroup{}
completionWaiter.Add(publishingRoutinesCount)

for i := 0; i < publishingRoutinesCount; i++ {
go func() {
startWaiter.Done()
startWaiter.Wait()

for j := 0; j < eventsToPublish; j++ {
bus.Pub(&testEvent{"test"})
}

completionWaiter.Done()
}()
}

completionWaiter.Wait()

if len(bus.Clear()) != 0 {
t.Fatal("All TmpConsumers must be removed")
}
}

type testEvent struct{ eType string }

func (te *testEvent) Type() string { return te.eType }
Expand Down Expand Up @@ -109,3 +146,20 @@ func checkAccepts(t *testing.T, tc *testConsumer, expected int) {
t.Fatalf("Consumer id = '%s'. Expected accepts %d != Actual %d", tc.id, expected, tc.accepts)
}
}

type testTmpConsumer struct {
sync.Mutex
hitsUntilDone int
}

func (c *testTmpConsumer) Accept(e event.E) {
c.Lock()
defer c.Unlock()
c.hitsUntilDone--
}

func (c *testTmpConsumer) IsDone() bool {
c.Lock()
defer c.Unlock()
return c.hitsUntilDone <= 0
}
2 changes: 1 addition & 1 deletion agents/go-agents/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>6.1.0-SNAPSHOT</version>
<version>6.1.0</version>
</parent>
<artifactId>go-agents</artifactId>
<name>Agent :: Golang agents</name>
Expand Down
23 changes: 23 additions & 0 deletions agents/ls-camel/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012-2018 Red Hat, Inc.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
Red Hat, Inc. - initial API and implementation
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>6.1.0</version>
</parent>
<artifactId>ls-camel-agent</artifactId>
<name>Language Server Apache Camel Agent</name>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "org.eclipse.che.ls.camel",
"version": "1.0.0",
"name": "Apache Camel language server",
"description": "Apache Camel intellisense",
"dependencies": [],
"properties": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#
# Copyright (c) 2012-2018 Red Hat, Inc.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#


is_current_user_root() {
test "$(id -u)" = 0
}

is_current_user_sudoer() {
sudo -n true > /dev/null 2>&1
}

set_sudo_command() {
if is_current_user_sudoer && ! is_current_user_root; then SUDO="sudo -E"; else unset SUDO; fi
}

set_sudo_command
unset PACKAGES
command -v tar >/dev/null 2>&1 || { PACKAGES=${PACKAGES}" tar"; }
command -v curl >/dev/null 2>&1 || { PACKAGES=${PACKAGES}" curl"; }

AGENT_BINARIES_URI=https://github.com/lhein/camel-language-server/releases/download/untagged-d42064681113e838bd59/camel-lsp-server-1.0.0-SNAPSHOT.jar
CHE_DIR=$HOME/che
LS_DIR=${CHE_DIR}/ls-camel
LS_LAUNCHER=${LS_DIR}/launch.sh

if [ -f /etc/centos-release ]; then
FILE="/etc/centos-release"
LINUX_TYPE=$(cat $FILE | awk '{print $1}')
elif [ -f /etc/redhat-release ]; then
FILE="/etc/redhat-release"
LINUX_TYPE=$(cat $FILE | cut -c 1-8)
else
FILE="/etc/os-release"
LINUX_TYPE=$(cat $FILE | grep ^ID= | tr '[:upper:]' '[:lower:]')
LINUX_VERSION=$(cat $FILE | grep ^VERSION_ID=)
fi

MACHINE_TYPE=$(uname -m)

mkdir -p ${CHE_DIR}
mkdir -p ${LS_DIR}


###############################
### Install Apache Camel LS ###
###############################

curl -L -s ${AGENT_BINARIES_URI} -o ${LS_DIR}/camel-lsp-server.jar

touch ${LS_LAUNCHER}
chmod +x ${LS_LAUNCHER}
echo "java -jar ${LS_DIR}/camel-lsp-server.jar" > ${LS_LAUNCHER}
2 changes: 1 addition & 1 deletion agents/ls-csharp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>6.1.0-SNAPSHOT</version>
<version>6.1.0</version>
</parent>
<artifactId>ls-csharp-agent</artifactId>
<name>Language Server C# Agent</name>
Expand Down
2 changes: 1 addition & 1 deletion agents/ls-json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>6.1.0-SNAPSHOT</version>
<version>6.1.0</version>
</parent>
<artifactId>ls-json-agent</artifactId>
<name>Language Server Json Agent</name>
Expand Down
2 changes: 1 addition & 1 deletion agents/ls-php/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>6.1.0-SNAPSHOT</version>
<version>6.1.0</version>
</parent>
<artifactId>ls-php-agent</artifactId>
<name>Language Server PHP Agent</name>
Expand Down
2 changes: 1 addition & 1 deletion agents/ls-python/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>6.1.0-SNAPSHOT</version>
<version>6.1.0</version>
</parent>
<artifactId>ls-python-agent</artifactId>
<name>Language Server python Agent</name>
Expand Down
2 changes: 1 addition & 1 deletion agents/ls-typescript/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>6.1.0-SNAPSHOT</version>
<version>6.1.0</version>
</parent>
<artifactId>ls-typescript-agent</artifactId>
<name>Language Server typescript Agent</name>
Expand Down
2 changes: 1 addition & 1 deletion agents/ls-yaml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>6.1.0-SNAPSHOT</version>
<version>6.1.0</version>
</parent>
<artifactId>ls-yaml-agent</artifactId>
<name>Language Server Yaml Agent</name>
Expand Down
Loading

0 comments on commit 968d71b

Please sign in to comment.