Merge branch 'main' into bug5924

This commit is contained in:
Axel Uhl committed 2025-01-29 13:00:59 +01:00
commit a14dfdeeaf
9 files changed
+59 -39

No files matched your search

+4 -4
View File
@@ -19,11 +19,11 @@ jobs:
with:
ref: ${{ github.event_name == 'workflow_dispatch' && github.workflow_dispatch.ref || github.event.workflow_run.head_branch }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
- name: Login to ghcr.io to upload sailing-analytics image
uses: docker/login-action@v3
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
@@ -54,7 +54,7 @@ jobs:
fi
echo "RELEASE=${RELEASE}" >>${GITHUB_ENV}
- name: Build & push Docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
with:
build-args: RELEASE=${{ env.RELEASE }}
tags: ghcr.io/sap/sailing-analytics:${{ env.RELEASE }}${{ env.BRANCH == 'main' && github.event.inputs.release == '' && ',ghcr.io/sap/sailing-analytics:latest' || env.BRANCH == 'docker-17' && github.event.inputs.release == '' && ',ghcr.io/sap/sailing-analytics:latest-17' || '' }}
@@ -16,7 +16,7 @@ jobs:
ref: docker-17
fetch-depth: 0 # fetch the whole thing to make sure the histories merge
- name: Merge main into docker-17
uses: devmasx/merge-branch@master
uses: devmasx/merge-branch@854d3ac71ed1e9deb668e0074781b81fdd6e771f # v1.4.0
env:
GH_TOKEN: ${{ secrets.REPO_TOKEN_FOR_MERGE_AND_PUSH }}
with:
@@ -27,7 +27,7 @@ jobs:
GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git fetch sapsailing main:sapsailing_main
GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git push -f origin sapsailing_main:sapsailing_main
- name: Merge sapsailing/main into main
uses: devmasx/merge-branch@master
uses: devmasx/merge-branch@854d3ac71ed1e9deb668e0074781b81fdd6e771f # v1.4.0
env:
GH_TOKEN: ${{ secrets.REPO_TOKEN_FOR_MERGE_AND_PUSH }}
with:
+6 -6
View File
@@ -28,7 +28,7 @@ jobs:
sudo chown root:root /mnt/large-swapfile
sudo swapon /mnt/large-swapfile
- name: Collect Workflow Telemetry
uses: catchpoint/workflow-telemetry-action@v2
uses: catchpoint/workflow-telemetry-action@94c3c3d9567a0205de6da68a76c428ce4e769af1 # v2.0.0
with:
comment_on_pr: false
- name: Check out the repository to the runner
@@ -42,16 +42,16 @@ jobs:
java-version: '8'
mvn-toolchain-id: 'JavaSE-1.8'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3.2.2
with:
log-accepted-android-sdk-licenses: 'false'
cmdline-tools-version: 9123335 # This corresponds to human-friendly version number 8.0
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.11.0
uses: supercharge/mongodb-github-action@90004df786821b6308fb02299e5835d0dae05d0d #v1.12.0
with:
mongodb-version: 7.0
- name: Start RabbitMQ
uses: namoshek/rabbitmq-github-action@v1
uses: namoshek/rabbitmq-github-action@58b841360ede0e19fc5e4929fc2477ecc09193d8 # v1.1.0
with:
version: '3.8.9'
ports: '5672:5672'
@@ -69,7 +69,7 @@ jobs:
path: build.log
retention-days: 90
- name: Collect Test Reports
uses: dorny/test-reporter@v1
uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5 # v1.9.1
if: always()
with:
name: Maven Tests
@@ -105,7 +105,7 @@ jobs:
- name: Create Release
id: create_release
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docker-17' || startsWith(github.ref, 'refs/heads/releases/') }}
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
with:
tag_name: ${{ env.SIMPLE_VERSION_INFO }}
name: ${{ env.SIMPLE_VERSION_INFO }}
@@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
name: "Metadata Creation Tool"
steps:
- uses: SAP/metadata-creation-tool-for-reuse@main
- uses: SAP/metadata-creation-tool-for-reuse@881317602f9e4df00d1c7073bf6f15cbade835c4 # main at 2025-01-29
with:
repository_url: "${{ github.server_url }}/${{ github.repository }}"
access_token: "${{ secrets.REUSE_ACCESS_TOKEN }}"
@@ -18,7 +18,8 @@ Import-Package: com.sap.sailing.domain.igtimiadapter.shared,
org.json.simple,
org.json.simple.parser,
org.osgi.framework;version="1.3.0",
org.osgi.util.tracker;version="1.3.1"
org.osgi.util.tracker;version="1.3.1",
slash.common.io
Require-Bundle: com.sap.sailing.domain,
com.sap.sailing.expeditionconnector,
com.sap.sailing.declination,
@@ -1,5 +1,6 @@
package com.sap.sailing.server.gateway.windimport.routeconverter;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.util.ArrayList;
@@ -7,6 +8,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
@@ -22,9 +24,12 @@ import com.sap.sailing.domain.trackfiles.TrackFileImportDeviceIdentifier;
import com.sap.sailing.domain.trackimport.GPSFixImporter;
import com.sap.sailing.server.gateway.windimport.AbstractWindImporter;
import com.sap.sailing.server.trackfiles.RouteConverterGPSFixImporterFactory;
import com.sap.sse.common.Util;
import com.sap.sse.common.Util.Pair;
import com.sap.sse.common.impl.MillisecondsTimePoint;
import slash.common.io.NotClosingUnderlyingInputStream;
public class RouteconverterWindImporter extends AbstractWindImporter {
private static final Logger logger = Logger.getLogger(RouteconverterWindImporter.class.getName());
@@ -58,33 +63,43 @@ public class RouteconverterWindImporter extends AbstractWindImporter {
}
private Map<WindSource, ? extends Iterable<Wind>> readWind(String filename, InputStream inputStream, Charset charset) throws Exception {
final Map<WindSource, List<Wind>> result = new HashMap<>();
final GPSFixImporter importer = RouteConverterGPSFixImporterFactory.INSTANCE.createRouteConverterGPSFixImporter();
final GPSFixImporter.Callback callback = new GPSFixImporter.Callback() {
@Override
public void addFix(GPSFix fix, TrackFileImportDeviceIdentifier device) {
if (fix instanceof GPSFixMoving) { // only with COG/SOG can we turn this into a Wind fix
final Wind wind = new WindImpl(fix.getPosition(), fix.getTimePoint(), ((GPSFixMoving) fix).getSpeed());
final WindSource windSource = WindSource.fromTypeAndId(device.getTrackName());
if (windSource.getType().canBeStored()) {
result.computeIfAbsent(windSource, ws->new ArrayList<>()).add(wind);
try {
final Map<WindSource, List<Wind>> result = new HashMap<>();
final GPSFixImporter importer = RouteConverterGPSFixImporterFactory.INSTANCE.createRouteConverterGPSFixImporter();
final GPSFixImporter.Callback callback = new GPSFixImporter.Callback() {
@Override
public void addFix(GPSFix fix, TrackFileImportDeviceIdentifier device) {
if (fix instanceof GPSFixMoving) { // only with COG/SOG can we turn this into a Wind fix
final Wind wind = new WindImpl(fix.getPosition(), fix.getTimePoint(), ((GPSFixMoving) fix).getSpeed());
final WindSource windSource = WindSource.fromTypeAndId(device.getTrackName());
if (windSource.getType().canBeStored()) {
result.computeIfAbsent(windSource, ws->new ArrayList<>()).add(wind);
}
}
}
}
};
if (filename.toLowerCase().endsWith("zip")) {
logger.info("Routeconverter file "+filename+" is a ZIP file");
final ZipInputStream zipInputStream = new ZipInputStream(inputStream);
ZipEntry entry;
while ((entry=zipInputStream.getNextEntry()) != null) {
if (entry.getName().toLowerCase().endsWith(".txt")) {
logger.info("Reading Routeconverter wind data from "+filename+"'s ZIP entry "+entry.getName());
importer.importFixes(zipInputStream, charset, callback, /* inferSpeedAndBearing */ false, entry.getName());
};
if (filename.toLowerCase().endsWith("zip")) {
logger.info("Routeconverter file "+filename+" is a ZIP file");
final ZipInputStream zipInputStream = new ZipInputStream(inputStream);
ZipEntry entry;
while ((entry=zipInputStream.getNextEntry()) != null) {
final String entryName = entry.getName();
final int extensionStart = entryName.lastIndexOf('.');
if (extensionStart == -1 || Util.contains(importer.getSupportedFileExtensions(), entryName.substring(extensionStart+1))) {
logger.info("Reading Routeconverter wind data from "+filename+"'s ZIP entry "+entry.getName());
importer.importFixes(new NotClosingUnderlyingInputStream(zipInputStream), charset, callback, /* inferSpeedAndBearing */ false, entry.getName());
}
}
} else {
importer.importFixes(inputStream, charset, callback, /* inferSpeedAndBearing */ false, filename);
}
return result;
} finally {
try {
inputStream.close();
} catch (IOException e) {
logger.log(Level.WARNING, "An exception occurred while trying to close the input stream from which we're reading wind", e);
}
} else {
importer.importFixes(inputStream, charset, callback, /* inferSpeedAndBearing */ false, filename);
}
return result;
}
}
@@ -219,7 +219,7 @@ public class RouteConverterGPSFixImporterImpl extends BaseRouteConverterGPSFixIm
@Override
public Iterable<String> getSupportedFileExtensions() {
//TODO the list is not yet complete
return Arrays.asList("gpx", "kml", "kmz");
return Arrays.asList("gpx", "kml", "kmz", "txt");
}
@Override
@@ -33,7 +33,11 @@
wind source types and IDs, e.g., <tt>"EXPEDITION (DC-FE-AAHJ)"</tt> and can be
imported again in the Tracked Races / Wind panel now (see "Routeconverter"-based
wind import).</li>
</ul> <h2 class="articleSubheadline">December 2024</h2>
<li>Fixed wind import from ZIP files exported by the Sailing Analytics. So far, file extensions
of the files wrapped in the ZIP file were checked to be ".txt" which therefore ignored the
.gpx, .kml, etc. file types that we normally export ourselves.</li>
</ul>
<h2 class="articleSubheadline">December 2024</h2>
<ul class="bulletList">
<li>The Igtimi WindBot connector has been re-designed. This became necessary because
Riedel Communications GmbH deprecated and then stopped their "Riot" back-end