Skip to content

refactor: adopt shared export-name converter for Layer Metadata (MAPCO-10823)#104

Open
razbroc wants to merge 2 commits into
masterfrom
feat/adopt-shared-export-name-converter
Open

refactor: adopt shared export-name converter for Layer Metadata (MAPCO-10823)#104
razbroc wants to merge 2 commits into
masterfrom
feat/adopt-shared-export-name-converter

Conversation

@razbroc

@razbroc razbroc commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

What

Replaces Overseer's private convertObjectKeysToSnakeCase with the shared convertKeysToExportColumns from @map-colonies/raster-shared, so the Layer Metadata and Layer Parts export tables derive snake_case column names from one source. Removes the duplicated util (and its spec).

Behavior-preserving

The metadata feature has no resolutionDegree key (it uses maxResolutionDeg/minResolutionDeg), so the converter's lone override never fires — Overseer's output columns are unchanged. Verified: full unit suite 191/191, export handler 17/17, typecheck clean.

⚠️ Depends on

@map-colonies/raster-shared with the export-name converter (MapColonies/raster-shared#212). Dependency bumped to ^8.3.0-alpha.0; merge/npm ci after that publishes.

Closes #103

🤖 Generated with Claude Code

…#103)

Replaces Overseer's private convertObjectKeysToSnakeCase with the shared
convertKeysToExportColumns from @map-colonies/raster-shared, so the Layer Metadata and
Layer Parts export tables derive snake_case column names from one source. Behavior-preserving:
the metadata feature has no resolutionDegree key (it uses maxResolutionDeg/minResolutionDeg),
so the converter's override does not change Overseer's output. Removes the duplicated util and
bumps raster-shared to ^8.3.0-alpha.0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@razbroc razbroc changed the title refactor: adopt shared export-name converter for Layer Metadata (#103) refactor: adopt shared export-name converter for Layer Metadata (MAPCO-10823) Jun 29, 2026
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 6, 2026 10:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 refactors Overseer’s Layer Metadata export to stop using a private camelCase→snake_case converter and instead use the shared export-name converter from @map-colonies/raster-shared, removing the duplicated local util (and its unit spec).

Changes:

  • Replaced convertObjectKeysToSnakeCase usage in the export job handler with @map-colonies/raster-shared’s converter.
  • Removed the local src/utils/db/dbUtils.ts converter and its unit test.
  • Bumped @map-colonies/raster-shared to ^8.3.0-alpha.0.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/unit/utils/dbUtils.spec.ts Removes unit tests for the deleted local snake_case converter.
src/utils/db/dbUtils.ts Removes the duplicated local convertObjectKeysToSnakeCase utility.
src/job/models/export/exportJobHandler.ts Uses the shared raster-shared key-to-column converter when generating GPKG metadata properties.
package.json Updates the raster-shared dependency version to pick up the shared converter implementation.
Comments suppressed due to low confidence (1)

src/job/models/export/exportJobHandler.ts:355

  • createGpkgMetadata now relies on convertKeysToGpkgColumns, but the existing unit tests for ExportJobHandler don’t assert the resulting column/property key names (they use expect.any(Object) for the metadata passed to ogr2ogr). To preserve the acceptance criterion (“column names unchanged”), add a test that verifies specific key conversions for Layer Metadata (e.g., maxResolutionDeg -> max_resolution_deg, minResolutionDeg -> min_resolution_deg) and that no unexpected renames occur.
  private createGpkgMetadata(feature: Feature<Polygon | MultiPolygon, GpkgArtifactProperties>): Feature<Polygon | MultiPolygon> {
    const snakeCaseProps = convertKeysToGpkgColumns(feature.properties);
    return {
      ...feature,
      properties: snakeCaseProps,
    };

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 8 to 12
CallbacksStatus,
CleanupData,
convertKeysToGpkgColumns,
ExportFinalizeFullProcessingParams,
ExportFinalizeType,
Comment thread package.json
Comment on lines 49 to 53
"@map-colonies/mc-utils": "^6.0.1",
"@map-colonies/prometheus": "^1.0.0",
"@map-colonies/raster-shared": "^8.1.0",
"@map-colonies/raster-shared": "^8.3.0-alpha.0",
"@map-colonies/read-pkg": "^1.0.0",
"@map-colonies/schemas": "^1.18.0",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adopt shared export-name converter for Layer Metadata table

2 participants