Skip to content

Commit

Permalink
Merge branch 'master' into extendQanaryPipelineAsComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
dschiese authored Jul 18, 2024
2 parents cec2f72 + b731a34 commit 5e0caff
Show file tree
Hide file tree
Showing 7 changed files with 316 additions and 263 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/pull-request-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
distribution: 'temurin'
java-version: '17'

- name: Build artifacts # To resolve internal, not yet published new versions
run: mvn clean install -Dgpg.skip -DskipTests -Ddockerfile.skip

- name: Execute tests
run: mvn test

545 changes: 293 additions & 252 deletions qanary-configuration-frontend/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions qanary-configuration-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.3",
"private": true,
"dependencies": {
"@babel/core": "7.24.0",
"@babel/core": "7.24.7",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^7.2.1",
Expand Down Expand Up @@ -34,7 +34,7 @@
]
},
"devDependencies": {
"@babel/core": "7.24.0",
"@babel/core": "7.24.7",
"axios": "^0.21.2"
}
}
3 changes: 1 addition & 2 deletions qanary_pipeline-template/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<artifactId>qa.pipeline</artifactId>
<groupId>eu.wdaqua.qanary</groupId>
<version>3.10.0</version>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
Expand Down Expand Up @@ -222,7 +221,7 @@
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>4.0.4</version>
<version>4.0.5</version>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -15,6 +16,7 @@
import de.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent;
import de.codecentric.boot.admin.server.notify.AbstractEventNotifier;
import eu.wdaqua.qanary.business.QanaryComponent;
import org.springframework.cache.annotation.Cacheable;
import reactor.core.publisher.Mono;

public class QanaryComponentRegistrationChangeNotifier extends AbstractEventNotifier {
Expand Down Expand Up @@ -45,22 +47,29 @@ protected Mono<Void> doNotify(InstanceEvent event, Instance instance) {
instance.getRegistration().getServiceUrl());
}
} else {
availableComponents.put(instanceName, null);
availableComponents.put(instanceName, instance);
}
} else {
logger.debug("Instance {} ({}) {}", instanceName, event.getInstance(), event.getType());
}
});
}

protected void addAvailableComponent(String instanceName, Instance instance) {
protected void addAvailableComponent(String instanceName, Instance instance) {
this.getAvailableComponents().put(instanceName, instance);
}

public List<String> getAvailableComponentNames() {
return new ArrayList<>(availableComponents.keySet());
}

@Cacheable(value = "availableComponents") // TODO: Handle changes ?
public Map<String, String> getComponentsAndAvailability(Map<String, Instance> availableComponents) {
Map<String,String> comps = availableComponents.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e->e.getValue().getStatusInfo().getStatus()));
logger.info("Comps: {}", comps);
return comps;
}

public Map<String, Instance> getAvailableComponents() {
return this.availableComponents;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
*/
@Controller
public class QanaryQuestionAnsweringController {

// the string used for the endpoints w.r.t. the question answering process
public static final String QUESTIONANSWERING = "/questionanswering";
public static final String QUESTIONANSWERINGFULL = "/questionansweringfull";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ <h2>Currently available Qanary components</h2>
<div id="componentfilterbox"><input title="filter components" type="text" id="componentfilterinput" onkeyup="filterComponentList()" name="componentfilterinput" placeholder="filter components"></div>
</div>
<ul id="sortable">
<li th:each="component : ${componentList}">
<input type="checkbox" name="componentlist[]" th:id="'componentlist'+${component}" th:value="${component}" />
<label th:for="'componentlist'+${component}" th:title="'activate '+${component}+' for the QA pipeline'" th:text="${component}" />
<span th:id="'annotationcount'+${component}"></span>
<li th:each="component : ${componentList}" th:style="'background-color: ' + (${component.value == 'OFFLINE'} ? '#999' : '')">
<input type="checkbox" name="componentlist[]" th:id="'componentlist'+${component.key}" th:value="${component.key}" th:attrappend="disabled=${component.value == 'OFFLINE' ? 'disabled' : null}"/>
<label th:for="'componentlist'+${component.key}" th:title="'activate '+${component.key}+' for the QA pipeline'" th:text="${component.key}" />
<span th:id="'annotationcount'+${component.key}"></span>
</li>
</ul>
</div>
</div>
</div>

0 comments on commit 5e0caff

Please sign in to comment.