Skip to content

feat: carry tiles storage on the tiles-deletion task params (MAPCO-11294) - #117

Merged
almog8k merged 8 commits into
masterfrom
feat/tiles-deletion-sub-path-MAPCO-11294
Aug 10, 2026
Merged

feat: carry tiles storage on the tiles-deletion task params (MAPCO-11294)#117
almog8k merged 8 commits into
masterfrom
feat/tiles-deletion-sub-path-MAPCO-11294

Conversation

@almog8k

@almog8k almog8k commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator
Question Answer
Bug fix
New feature
Breaking change
Deprecations
Documentation
Tests added
Chore

Related issues: MAPCO-11294
Epic: MAPCO-11261 — Redis cache deletion, move to cleaner

Further information:

Summary

Makes the FS variant of the range-based tiles-deletion task carry its own subPath, so the Cleaner locates tiles from the task params instead of from its own configuration — mirroring what the S3 variant does with bucket.

Why this is more than one added field

The ticket describes adding subPath, but raster-shared 9.0.0-alpha.0 (MAPCO-11262) rebuilt tilesDeletionParamsSchema as a real z.discriminatedUnion('storageProvider', …). The old flat shape no longer typechecks at all, so adopting it means renaming the discriminator and supplying the per-provider locator on both branches — not just the FS one.

src/task/models/deletionTaskManager.ts:

  • FS{ storageProvider: 'FS', subPath } from storage.internalPvc.tilesSubPath — the ticket's actual ask.
  • S3{ storageProvider: 'S3', bucket } from S3.tilesBucket — required by the union, not optional to skip.
  • tilesPathtilesRelativePath, sourceProviderstorageProvider.

Storage is resolved once in the constructor (resolveTilesStorage()) and spread into every emitted task, mirroring DeleteLayerHandler.createCleanerTasks. Both config keys were already plumbed through Helm by MAPCO-11213, so there are no config or chart changes here.

Contract change — needs MAPCO-11295

The task params overseer emits changed shape. The Cleaner keeps reading the FS sub-path from its own strategies.tilesDeletion.fsSubPath config until MAPCO-11295 lands, so the new field is inert until then. That ticket must ship before this reaches production.

…294)

Adopt the provider-aware tilesDeletionParamsSchema from raster-shared 9.0.0-alpha.0
so the Cleaner locates tiles from the task params instead of its own configuration.

The range-based tiles-deletion params are now a discriminated union on
storageProvider, so the flat shape no longer typechecks:

- FS  -> { storageProvider, subPath }  from storage.internalPvc.tilesSubPath
- S3  -> { storageProvider, bucket }   from S3.tilesBucket
- tilesPath -> tilesRelativePath, sourceProvider -> storageProvider

Storage is resolved once in the constructor and spread into every emitted task,
mirroring DeleteLayerHandler.createCleanerTasks.

Note: the emitted task params contract changed. The Cleaner keeps reading the FS
sub-path from its own config until MAPCO-11295 lands.

@vitaligi vitaligi 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.

side note buildTasks() & pushTasks() should be private on TileDeletionTaskManager

Comment thread src/task/models/deletionTaskManager.ts Outdated
Comment thread tests/unit/task/tileDeletionTaskManager/tileDeletionTaskManager.spec.ts Outdated
Comment thread tests/unit/task/tileDeletionTaskManager/tileDeletionTaskManager.spec.ts Outdated
Comment thread tests/unit/task/tileDeletionTaskManager/tileDeletionTaskManager.spec.ts Outdated
Comment thread src/job/models/deletion/deleteLayerHandler.ts
@almog8k
almog8k merged commit 687fdf9 into master Aug 10, 2026
4 checks passed
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.

2 participants