Skip to content

Commit

Permalink
Merge branch 'main' into feature/1336-Add-dark-mode
Browse files Browse the repository at this point in the history
* main:
  No issue. Slightly improving PDF editor visual
  No issue: Experiment with a Jenkinsfile
  No issue: Experiment with a Jenkinsfile
  No issue: Experiment with a Jenkinsfile
  No issue: Experiment with a Jenkinsfile
  No issue: Experiment with a Jenkinsfile
  #4058 - Cannot export texts containing certain characters as UIMA CAS XMI
  #3673 - Update dependencies
  #4066 - Display document name on export failure
  No issue. Minor additions to BioC format description
  #4062 - ViewportTracker should focus on block-like elements
  #4058 - Cannot export texts containing certain characters as UIMA CAS XMI
  #4032 - Allow using externalized strings from backend code
  #4060 - Clean up redundant code in annotation handlers
  #4026: Support for error tracking with Sentry
  • Loading branch information
reckart committed Jul 1, 2023
2 parents 4b36b30 + f877408 commit d88b802
Show file tree
Hide file tree
Showing 59 changed files with 520 additions and 748 deletions.
170 changes: 170 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
config = [
agentLabel: '',
maven: 'Maven 3',
jdk: 'Zulu 11',
extraMavenArguments: '',
wipeWorkspaceBeforeBuild: true,
wipeWorkspaceAfterBuild: true
]

pipeline {
parameters {
string(
name: 'extraMavenArguments',
defaultValue: config.extraMavenArguments,
description: "Extra arguments to be passed to Maven (for testing; overrides only current build)")
string(
name: 'agentLabel',
defaultValue: config.agentLabel,
description: "Eligible agents (in case a build keeps running on a broken agent; overrides only current build)")
booleanParam(
name: 'wipeWorkspaceBeforeBuild',
defaultValue: config.wipeWorkspaceBeforeBuild,
description: "Wipe workspace before build (for testing; next build only)")
booleanParam(
name: 'wipeWorkspaceAfterBuild',
defaultValue: config.wipeWorkspaceAfterBuild,
description: "Wipe workspace after build (for testing; next build only)")
}

agent {
label agentLabel
}

tools {
maven config.maven
jdk config.jdk
}

options {
buildDiscarder(logRotator(
numToKeepStr: '25',
artifactNumToKeepStr: '5'
))
skipDefaultCheckout()
}

stages {
stage("Checkout code") {
steps {
script {
if (params.wipeWorkspaceBeforeBuild) {
echo "Wiping workspace..."
cleanWs(cleanWhenNotBuilt: true,
deleteDirs: true,
disableDeferredWipeout: true,
notFailBuild: true)
}
}

dir('checkout') {
checkout scm
}
}
}

// Display information about the build environment. This can be useful for debugging
// build issues.
stage("Info") {
steps {
echo '=== Environment variables ==='
script {
if (isUnix()) {
sh 'printenv'
}
else {
bat 'set'
}
}
}
}

// Perform a merge request build. This is a conditional stage executed with the GitLab
// sources plugin triggers a build for a merge request. To avoid conflicts with other
// builds, this stage should not deploy artifacts to the Maven repository server and
// also not install them locally.
stage("PR build") {
when { branch 'PR-*' }

steps {
script {
currentBuild.description = 'Triggered by: <a href="' + CHANGE_URL + '">' + BRANCH_NAME +
': ' + env.CHANGE_BRANCH + '</a> (' + env.CHANGE_AUTHOR_DISPLAY_NAME + ')'
}

dir('checkout') {
withMaven(maven: config.maven, jdk: config.jdk, mavenLocalRepo: "$WORKSPACE/.repository") {
script {
def mavenCommand = 'mvn ' +
params.extraMavenArguments +
' -B -Dmaven.test.failure.ignore=true clean verify';

if (isUnix()) {
sh script: mavenCommand
}
else {
bat script: mavenCommand
}
}
}

script {
def mavenConsoleIssues = scanForIssues tool: mavenConsole()
def javaIssues = scanForIssues tool: java()
def javaDocIssues = scanForIssues tool: javaDoc()
publishIssues id: "analysis", issues: [mavenConsoleIssues, javaIssues, javaDocIssues]
}
}
}
}

// Perform a SNAPSHOT build of a main branch. This stage is typically executed after a
// merge request has been merged. On success, it deploys the generated artifacts to the
// Maven repository server.
stage("SNAPSHOT build") {
when { branch pattern: "main|release/.*", comparator: "REGEXP" }

steps {
dir('checkout') {
withMaven(maven: config.maven, jdk: config.jdk, mavenLocalRepo: "$WORKSPACE/.repository") {
script {
def mavenCommand = 'mvn ' +
params.extraMavenArguments +
' -B -Dmaven.test.failure.ignore=true clean verify'

if (isUnix()) {
sh script: mavenCommand
}
else {
bat script: mavenCommand
}
}
}

script {
def mavenConsoleIssues = scanForIssues tool: mavenConsole()
def javaIssues = scanForIssues tool: java()
def javaDocIssues = scanForIssues tool: javaDoc()
def spotBugsIssues = scanForIssues tool: spotBugs()
def taskScannerIssues = scanForIssues tool: taskScanner()
publishIssues id: "analysis", issues: [mavenConsoleIssues, javaIssues, javaDocIssues, spotBugsIssues, taskScannerIssues]
}
}
}
}
}

post {
success {
script {
if (params.wipeWorkspaceAfterBuild) {
echo "Wiping workspace..."
cleanWs(cleanWhenNotBuilt: false,
deleteDirs: true,
disableDeferredWipeout: true,
notFailBuild: true)
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,12 @@ File exportAnnotationDocument(SourceDocument document, String user, FormatSuppor
File exportAnnotationDocument(SourceDocument document, String user, FormatSupport aFormat,
String fileName, Mode mode, boolean stripExtension,
Map<Pair<Project, String>, Object> aBulkOperationContext)
throws UIMAException, IOException, ClassNotFoundException;
throws UIMAException, IOException;

File exportAnnotationDocument(SourceDocument aDocument, String aUser, FormatSupport aFormat,
Mode aMode, boolean aStripExtension,
Map<Pair<Project, String>, Object> aBulkOperationContext)
throws UIMAException, IOException, ClassNotFoundException;
throws UIMAException, IOException;

/**
* @return a type system with all the types that should be present in an exported CAS. This
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package de.tudarmstadt.ukp.clarin.webanno.api.export;

import java.io.File;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.zip.ZipEntry;
Expand All @@ -40,7 +41,7 @@ default List<Class<? extends ProjectExporter>> getExportDependencies()

void exportData(FullProjectExportRequest aRequest, ProjectExportTaskMonitor aMonitor,
ExportedProject aExProject, File aStage)
throws Exception;
throws ProjectExportException, IOException, InterruptedException;

void importData(ProjectImportRequest aRequest, Project aProject, ExportedProject aExProject,
ZipFile aZip)
Expand Down
7 changes: 6 additions & 1 deletion inception/inception-app-webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,11 @@
<groupId>io.sentry</groupId>
<artifactId>sentry-spring-boot-starter</artifactId>
</dependency>

<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry-log4j2</artifactId>
</dependency>

<!-- DATABASE / HIBERNATE -->

<dependency>
Expand Down Expand Up @@ -954,6 +958,7 @@
<usedDependency>commons-logging:commons-logging</usedDependency>
<!-- Monitoring - used via reflection / optional -->
<usedDependency>io.sentry:sentry-spring-boot-starter</usedDependency>
<usedDependency>io.sentry:sentry-log4j2</usedDependency>
<!-- Themes -->
<usedDependency>com.googlecode.wicket-jquery-ui:wicket-kendo-ui-theme-bootstrap</usedDependency>
<usedDependency>com.googlecode.wicket-jquery-ui:wicket-jquery-ui-theme-uilightness</usedDependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package de.tudarmstadt.ukp.clarin.webanno.constraints.export;

import java.io.File;
import java.io.IOException;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
Expand Down Expand Up @@ -52,7 +53,7 @@ public class ConstraintsExporter
@Override
public void exportData(FullProjectExportRequest aRequest, ProjectExportTaskMonitor aMonitor,
ExportedProject aExProject, File aStage)
throws Exception
throws IOException
{
File constraintsDir = new File(aStage + CONSTRAINTS);
FileUtils.forceMkdir(constraintsDir);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.uima.UIMAException;
import org.slf4j.Logger;
Expand Down Expand Up @@ -102,11 +103,13 @@ public List<Class<? extends ProjectExporter>> getImportDependencies()
*
* @param aStage
* The folder where curated documents are copied to be exported as Zip File
* @throws IOException
* @throws ProjectExportException
*/
@Override
public void exportData(FullProjectExportRequest aRequest, ProjectExportTaskMonitor aMonitor,
ExportedProject aExProject, File aStage)
throws Exception
throws IOException, ProjectExportException
{
Project project = aRequest.getProject();

Expand Down Expand Up @@ -166,7 +169,7 @@ public void exportData(FullProjectExportRequest aRequest, ProjectExportTaskMonit

private void exportAdditionalFormat(Map<Pair<Project, String>, Object> bulkOperationContext,
SourceDocument srcDoc, File curationDir, FormatSupport format)
throws ProjectExportException, IOException, ClassNotFoundException, UIMAException
throws ProjectExportException, IOException
{
File curationFile = null;
try {
Expand All @@ -175,6 +178,11 @@ private void exportAdditionalFormat(Map<Pair<Project, String>, Object> bulkOpera
var filename = CURATION_USER + "." + getExtension(curationFile.getName());
FileUtils.copyFile(curationFile, new File(curationDir, filename));
}
catch (UIMAException | IOException e) {
throw new ProjectExportException("Error exporting annotations of " + srcDoc.getName()
+ " for user [" + CURATION_USER + "] as [" + format.getName() + "]: "
+ ExceptionUtils.getRootCauseMessage(e), e);
}
finally {
if (curationFile != null) {
forceDelete(curationFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public CurationWorkflowExporter(CurationService aCurationService)
@Override
public void exportData(FullProjectExportRequest aRequest, ProjectExportTaskMonitor aMonitor,
ExportedProject aExProject, File aStage)
throws Exception
{
Project project = aRequest.getProject();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import de.tudarmstadt.ukp.clarin.webanno.export.model.ExportedProject;
import de.tudarmstadt.ukp.clarin.webanno.model.Project;
import de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument;
import de.tudarmstadt.ukp.clarin.webanno.xmi.XmiFormatSupport;
import de.tudarmstadt.ukp.inception.annotation.storage.CasStorageServiceImpl;
import de.tudarmstadt.ukp.inception.annotation.storage.config.CasStorageBackupProperties;
import de.tudarmstadt.ukp.inception.annotation.storage.config.CasStorageCachePropertiesImpl;
Expand All @@ -60,6 +59,8 @@
import de.tudarmstadt.ukp.inception.export.DocumentImportExportServiceImpl;
import de.tudarmstadt.ukp.inception.export.config.DocumentImportExportServiceProperties;
import de.tudarmstadt.ukp.inception.export.config.DocumentImportExportServicePropertiesImpl;
import de.tudarmstadt.ukp.inception.io.xmi.XmiFormatSupport;
import de.tudarmstadt.ukp.inception.io.xmi.config.UimaFormatsPropertiesImpl.XmiFormatProperties;
import de.tudarmstadt.ukp.inception.project.export.ProjectExportServiceImpl;
import de.tudarmstadt.ukp.inception.schema.AnnotationSchemaService;

Expand Down Expand Up @@ -103,9 +104,10 @@ public void setUp() throws Exception
casStorageService = spy(new CasStorageServiceImpl(driver,
new CasStorageCachePropertiesImpl(), null, schemaService));

var xmiFormatSupport = new XmiFormatSupport(new XmiFormatProperties());
importExportSerivce = new DocumentImportExportServiceImpl(repositoryProperties,
asList(new XmiFormatSupport()), casStorageService, schemaService, properties,
checksRegistry, repairsRegistry);
asList(xmiFormatSupport), casStorageService, schemaService, properties,
checksRegistry, repairsRegistry, xmiFormatSupport);

// Dynamically generate a SourceDocument with an incrementing ID when asked for one
when(documentService.getSourceDocument(any(), any())).then(invocation -> {
Expand Down
2 changes: 1 addition & 1 deletion inception/inception-diam/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
Expand Down
Loading

0 comments on commit d88b802

Please sign in to comment.