Skip to content

HTM-1960: Custom extract functionality for layer attributes#1672

Merged
mprins merged 17 commits into
mainfrom
HTM-1960_Custom_extract_functionality_for_layer_attributes
May 12, 2026
Merged

HTM-1960: Custom extract functionality for layer attributes#1672
mprins merged 17 commits into
mainfrom
HTM-1960_Custom_extract_functionality_for_layer_attributes

Conversation

@mprins
Copy link
Copy Markdown
Contributor

@mprins mprins commented Apr 2, 2026

@mprins mprins self-assigned this Apr 2, 2026
@mprins mprins added enhancement New feature or request removed breaking possibly breaking changes that need extra attention during upgrade labels Apr 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 2, 2026

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 5 package(s) with unknown licenses.
See the Details below.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 8f5ec0a.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

License Issues

pom.xml

PackageVersionLicenseIssue Type
org.geotools:gt-csvNullUnknown License
org.geotools:gt-excel-writer35-RCNullUnknown License
org.geotools:gt-geojson-storeNullUnknown License
org.geotools:gt-geopkgNullUnknown License
org.geotools:gt-shapefileNullUnknown License
Allowed Licenses: MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, MPL-2.0, LGPL-2.1-only, EPL-2.0, EPL-1.0
Excluded from license check: pkg:maven/org.eclipse.angus/jakarta.mail@2.0.5?type=jar, pkg:maven/jakarta.ws.rs:jakarta.ws.rs-api@4.0.0?type=jar

OpenSSF Scorecard

PackageVersionScoreDetails
maven/org.geotools:gt-csv UnknownUnknown
maven/org.geotools:gt-excel-writer 35-RC UnknownUnknown
maven/org.geotools:gt-geojson-store UnknownUnknown
maven/org.geotools:gt-geopkg UnknownUnknown
maven/org.geotools:gt-shapefile UnknownUnknown

Scanned Files

  • pom.xml

@mprins mprins force-pushed the HTM-1960_Custom_extract_functionality_for_layer_attributes branch from 3d68eef to 4a7dc05 Compare April 2, 2026 11:48
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 2, 2026

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
543 1 542 2
View the full list of 1 ❄️ flaky test(s)
org.tailormap.api.controller.admin.TaskAdminControllerIntegrationTest::details_of_task

Flake rate in main: 45.00% (Passed 22 times, Failed 18 times)

Stack Traces | 0.019s run time
Status expected:<200> but was:<500>

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 2, 2026

Test Results

486 tests  +7   483 ✅ +6   10m 30s ⏱️ + 5m 24s
 58 suites +4     2 💤 +1 
 58 files   +4     1 ❌ ±0 

For more details on these failures, see this check.

Results for commit 8f5ec0a. ± Comparison against base commit cd7dd9f.

This pull request removes 12 and adds 19 tests. Note that renamed tests count towards both.
org.tailormap.api.controller.LayerExportControllerIntegrationTest ‑ invalid_output_format_not_accepted
org.tailormap.api.controller.LayerExportControllerIntegrationTest ‑ should_export_geo_json
org.tailormap.api.controller.LayerExportControllerIntegrationTest ‑ should_export_geo_json_with_filter
org.tailormap.api.controller.LayerExportControllerIntegrationTest ‑ should_export_geo_json_with_filter_and_sort
org.tailormap.api.controller.LayerExportControllerIntegrationTest ‑ should_export_geo_package
org.tailormap.api.controller.LayerExportControllerIntegrationTest ‑ should_export_large_filter_using_post
org.tailormap.api.controller.LayerExportControllerIntegrationTest ‑ should_export_large_filter_using_post_and_plus_in_output_format
org.tailormap.api.controller.LayerExportControllerIntegrationTest ‑ should_not_export_hidden_attributes_in_geo_json
org.tailormap.api.controller.LayerExportControllerIntegrationTest ‑ should_not_export_hidden_attributes_in_geo_json_when_requested
org.tailormap.api.controller.LayerExportControllerIntegrationTest ‑ should_return_export_capabilities_with_jdbc_feature_source
…
org.tailormap.api.controller.LayerExtractControllerIntegrationTest ‑ invalid_filter_should_fail_on_extract
org.tailormap.api.controller.LayerExtractControllerIntegrationTest ‑ invalid_filter_should_return_bad_request_on_extract_request
org.tailormap.api.controller.LayerExtractControllerIntegrationTest ‑ should_export_large_filter_to_csv
org.tailormap.api.controller.LayerExtractControllerIntegrationTest ‑ should_export_large_filter_to_excel
org.tailormap.api.controller.LayerExtractControllerIntegrationTest ‑ should_export_large_filter_to_geojson
org.tailormap.api.controller.LayerExtractControllerIntegrationTest ‑ should_export_large_filter_to_shape
org.tailormap.api.controller.LayerExtractControllerIntegrationTest ‑ should_export_large_output_to_csv
org.tailormap.api.controller.LayerExtractControllerIntegrationTest ‑ should_export_to_geopackage
org.tailormap.api.controller.LayerExtractControllerIntegrationTest ‑ should_export_wfs_to_csv_with_authentication
org.tailormap.api.controller.LayerExtractControllerLargeExcelIntegrationTest ‑ should_export_large_dataset_to_excel
…

♻️ This comment has been updated with latest results.

@mprins mprins force-pushed the HTM-1960_Custom_extract_functionality_for_layer_attributes branch from 4a7dc05 to 4fd0fc0 Compare April 3, 2026 08:40
matthijsln

This comment was marked as resolved.

@mprins mprins force-pushed the HTM-1960_Custom_extract_functionality_for_layer_attributes branch 2 times, most recently from b9bbb48 to e1cb81b Compare April 17, 2026 13:00
@mprins mprins force-pushed the HTM-1960_Custom_extract_functionality_for_layer_attributes branch 4 times, most recently from c35d02a to 17ff46d Compare April 28, 2026 15:03

@GetMapping("/formats")
public ResponseEntity<?> formats(
@Valid @ModelAttribute GeoServiceLayer layer,
@GetMapping("/formats")
public ResponseEntity<?> formats(
@Valid @ModelAttribute GeoServiceLayer layer,
@ModelAttribute GeoService service,
public ResponseEntity<?> formats(
@Valid @ModelAttribute GeoServiceLayer layer,
@ModelAttribute GeoService service,
@ModelAttribute Application application,
@Valid @ModelAttribute GeoServiceLayer layer,
@ModelAttribute GeoService service,
@ModelAttribute Application application,
@ModelAttribute AppTreeLayerNode appTreeLayerNode) {
@GetMapping(path = "/download/{downloadId}")
@Counted(value = "tailormap_api_extract_download", description = "Count of layer extract downloads")
public ResponseEntity<?> download(
@ModelAttribute GeoService service,
@Counted(value = "tailormap_api_extract_download", description = "Count of layer extract downloads")
public ResponseEntity<?> download(
@ModelAttribute GeoService service,
@ModelAttribute GeoServiceLayer layer,
public ResponseEntity<?> download(
@ModelAttribute GeoService service,
@ModelAttribute GeoServiceLayer layer,
@ModelAttribute Application application,
@ModelAttribute GeoService service,
@ModelAttribute GeoServiceLayer layer,
@ModelAttribute Application application,
@ModelAttribute AppTreeLayerNode appTreeLayerNode,
@mprins mprins force-pushed the HTM-1960_Custom_extract_functionality_for_layer_attributes branch from 3e74069 to 3ab9dea Compare April 29, 2026 12:01
@mprins mprins force-pushed the HTM-1960_Custom_extract_functionality_for_layer_attributes branch 2 times, most recently from 3ef963f to 8ded6a3 Compare May 5, 2026 15:31
@mprins mprins force-pushed the HTM-1960_Custom_extract_functionality_for_layer_attributes branch from d9c823f to ee0c726 Compare May 8, 2026 19:50
@mprins mprins enabled auto-merge (rebase) May 8, 2026 19:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR continues the migration from the legacy layer /export workflow to the new /extract workflow for exporting layer attributes, introducing viewer SSE support, server-side extract generation (CSV/GeoJSON/XLSX/Shapefile/GeoPackage), and updated OpenAPI/configuration plus extensive integration tests.

Changes:

  • Add viewer SSE endpoint (/events/{clientId}) and a dedicated viewerSseEventBus to isolate viewer SSE traffic from admin broadcasts.
  • Implement server-side extract creation pipeline with progress reporting and download endpoint, including new utilities (UUIDv7) and GeoTools-backed writers.
  • Remove legacy /export API + tests, update OpenAPI schemas/specs, configuration properties, build/deps, and add new unit/integration tests for /extract.

Reviewed changes

Copilot reviewed 31 out of 32 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/test/resources/application.properties Updates test configuration to new tailormap-api.extract.* settings.
src/test/java/org/tailormap/api/util/UUIDv7Test.java Adds unit tests for UUIDv7 generation/parsing/ordering.
src/test/java/org/tailormap/api/geotools/collection/ProgressReportingFeatureIteratorTest.java Adds unit test for iterator input validation.
src/test/java/org/tailormap/api/geotools/collection/ProgressReportingFeatureCollectionTest.java Adds tests validating progress callbacks for decorated feature collections.
src/test/java/org/tailormap/api/controller/TestUrls.java Removes URL constant no longer needed after export removal.
src/test/java/org/tailormap/api/controller/SseParsingUtils.java Adds test utility helpers for parsing/counting SSE messages.
src/test/java/org/tailormap/api/controller/ServerSentEventsControllerInvalidInputIntegrationTest.java Adds integration test for SSE clientId validation.
src/test/java/org/tailormap/api/controller/ServerSentEventsControllerIntegrationTest.java Adds integration tests for viewer/admin SSE separation + keep-alive behavior.
src/test/java/org/tailormap/api/controller/LayerExtractControllerRestrictedFormatsIntegrationTest.java Adds integration tests for allowed/disallowed extract formats and input validation.
src/test/java/org/tailormap/api/controller/LayerExtractControllerLargeExcelIntegrationTest.java Adds large XLSX extract integration test and validates output.
src/test/java/org/tailormap/api/controller/LayerExtractControllerIntegrationTest.java Adds end-to-end integration tests for multiple extract formats and error paths.
src/test/java/org/tailormap/api/controller/LayerExportControllerIntegrationTest.java Removes legacy /export endpoint tests.
src/main/resources/openapi/viewer-schemas.yaml Cleans up schema refs and removes legacy export schema.
src/main/resources/openapi/viewer-api.yaml Removes /export paths and adds /events + /extract endpoints to the spec.
src/main/resources/openapi/status-responses.yaml Adds ServerSentEventResponse schema for SSE payloads.
src/main/resources/application.properties Switches from tailormap-api.export.* to tailormap-api.extract.* defaults and documentation.
src/main/java/org/tailormap/api/util/UUIDv7.java Adds UUIDv7 utility for time-sortable event IDs.
src/main/java/org/tailormap/api/service/CreateLayerExtractService.java Implements extract generation, progress/error SSE emission, and cleanup scheduling.
src/main/java/org/tailormap/api/geotools/collection/ProgressReportingFeatureIterator.java Adds iterator wrapper to emit progress callbacks.
src/main/java/org/tailormap/api/geotools/collection/ProgressReportingFeatureCollection.java Adds feature collection wrapper that produces progress-reporting iterators.
src/main/java/org/tailormap/api/controller/ServerSentEventsController.java Adds viewer SSE controller and keep-alive broadcaster using UUIDv7.
src/main/java/org/tailormap/api/controller/LayerExtractController.java Adds /extract controller (formats, extract start, download).
src/main/java/org/tailormap/api/controller/LayerExportController.java Removes legacy /export controller implementation.
src/main/java/org/tailormap/api/controller/admin/ServerSentEventsAdminController.java Ensures admin SSE JSON is single-line (consistent SSE framing).
src/main/java/org/tailormap/api/configuration/TailormapConfig.java Adds viewerSseEventBus bean with defaults matching eventbus auto-config.
src/main/java/org/tailormap/api/configuration/base/WebMvcConfig.java Registers enum converter for ExtractOutputFormat.
src/main/java/org/tailormap/api/configuration/AsyncConfig.java Adds async executor for extract tasks.
README.md Documents having separate admin vs viewer SSE buses/streams.
pom.xml Updates GeoTools version/deps/repos and buildpack JVM options for native access.
build/qa/PMD-ruleset_for_TM.xml Updates PMD config to recognize Awaitility untilAsserted as an assertion.
build/ci/docker-compose.yml Minor formatting change.
.mvn/jvm.config Enables native access for the build JVM.

Comment thread src/main/java/org/tailormap/api/service/CreateLayerExtractService.java Outdated
Comment thread pom.xml Outdated
Comment thread src/main/resources/openapi/viewer-api.yaml
Comment thread src/main/resources/openapi/viewer-api.yaml
Comment thread src/main/resources/openapi/viewer-api.yaml Outdated
Comment thread pom.xml Outdated
Comment thread src/main/resources/openapi/viewer-api.yaml Outdated
mprins added 15 commits May 11, 2026 12:25
…t endpoint

we still need some, now obsoleted, generated code to keep the compiler happy so that is moved to a temporary schema file
For now use GeoTools 35-SNAPSHOT to make geojson export work, see https://osgeo-org.atlassian.net/browse/GEOT-7894
…s more robust

Add --enable-native-access=ALL-UNNAMED for the native sqlite/geopackage driver
@mprins mprins force-pushed the HTM-1960_Custom_extract_functionality_for_layer_attributes branch from 99397c7 to e46618e Compare May 11, 2026 10:26
@mprins mprins force-pushed the HTM-1960_Custom_extract_functionality_for_layer_attributes branch from e46618e to 8b3efdc Compare May 11, 2026 11:21
@mprins mprins requested review from a team, KJLammers, mvdstruijk and steinkobben May 11, 2026 16:39
@mprins mprins changed the title [WIP] HTM-1960: Custom extract functionality for layer attributes HTM-1960: Custom extract functionality for layer attributes May 12, 2026
@mprins
Copy link
Copy Markdown
Contributor Author

mprins commented May 12, 2026

test failure org.tailormap.api.controller.admin.TaskAdminControllerIntegrationTest::details_of_task is known to be flaky

@mprins mprins disabled auto-merge May 12, 2026 09:31
@mprins mprins merged commit 6a24203 into main May 12, 2026
29 of 33 checks passed
@mprins mprins deleted the HTM-1960_Custom_extract_functionality_for_layer_attributes branch May 12, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking possibly breaking changes that need extra attention during upgrade enhancement New feature or request removed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants