-
Notifications
You must be signed in to change notification settings - Fork 0
feat!: consolidate storage schemas and add Redis provider (MAPCO-11262) #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
almog8k
merged 19 commits into
alpha
from
feat/consolidate-storage-schemas-redis-MAPCO-11262
Aug 6, 2026
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
0ea0111
fix: break import cycle that broke deep module imports
almog8k 99b4ad1
feat: add REDIS storage provider
almog8k e68ba23
refactor: extract reusable tile range and pyramid schemas
almog8k 1bbf32a
feat: add cache deletion job and task types
almog8k 13a09ec
feat: add provider-aware deletion task params schemas
almog8k c717667
feat: consolidate Redis deletion schemas for improved clarity and reu…
almog8k af050a9
refactor: improve formatting of tilesDeletionParamsSchema for consist…
almog8k b98f7e9
feat: rename tilesPath to tilesRelativePath for clarity in tilePyrami…
almog8k cb1b27f
feat: simplify tiles deletion schemas by removing unnecessary merges …
almog8k f0f8515
feat: remove redisCacheDeletionParamsSchema and related types for sim…
almog8k 6ec8f77
feat: remove redisCacheDeletionParamsSchema for simplification
almog8k 1f5a3b8
feat: add upload_package job to pack and upload npm package to Azure …
almog8k fbc2016
fix: add missing newline at end of pull-request.yaml
almog8k ddd7559
fix: remove unnecessary newline in pull-request.yaml
almog8k 0e26208
fix: correct naming of Cache_Deletion to Delete_Cache in DeletionJobT…
almog8k 99b608d
fix: remove unnecessary comment from resourcePathsSchema
almog8k fdb8d56
feat: enforce strict validation on tiles deletion schemas
almog8k 80d6432
fix: simplify comment in redisDeleteStoredResourcesParamsSchema
almog8k 3bb1efa
fix: remove unnecessary blank lines in pull-request.yaml
almog8k File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,34 @@ | ||
| import { z } from 'zod'; | ||
| import { SourceType } from '../../constants/core/constants'; | ||
| import { StorageProvider } from '../../constants/core/constants'; | ||
|
|
||
| export const fsStorageSchema = z.object({ | ||
| storageProvider: z.literal(SourceType.FS), | ||
| subPath: z.string().min(1), | ||
| export const s3BucketSchema = z.object({ | ||
| bucket: z.string().min(1), | ||
| }); | ||
|
|
||
| export const s3StorageSchema = z.object({ | ||
| storageProvider: z.literal(SourceType.S3), | ||
| bucket: z.string().min(1), | ||
| export const redisPrefixSchema = z.object({ | ||
| prefix: z.string().min(1), // Full Redis key prefix, e.g. `myLayer-redis_WorldCRS84` | ||
| }); | ||
|
|
||
| export const storageSchema = z.discriminatedUnion('storageProvider', [fsStorageSchema, s3StorageSchema]); | ||
| export const fsSubPathSchema = z.object({ | ||
| subPath: z.string().min(1), | ||
| }); | ||
|
|
||
| export const fsStorageSchema = z | ||
| .object({ | ||
| storageProvider: z.literal(StorageProvider.FS), | ||
| }) | ||
| .merge(fsSubPathSchema); | ||
|
|
||
| export const s3StorageSchema = z | ||
| .object({ | ||
| storageProvider: z.literal(StorageProvider.S3), | ||
| }) | ||
| .merge(s3BucketSchema); | ||
|
|
||
| export const redisStorageSchema = z | ||
| .object({ | ||
| storageProvider: z.literal(StorageProvider.REDIS), | ||
| }) | ||
| .merge(redisPrefixSchema); | ||
|
|
||
|
vitaligi marked this conversation as resolved.
|
||
| export const storageSchema = z.discriminatedUnion('storageProvider', [fsStorageSchema, s3StorageSchema, redisStorageSchema]); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| import type { z } from 'zod'; | ||
| import type { fsStorageSchema, s3StorageSchema, storageSchema } from '../../schemas'; | ||
| import type { fsStorageSchema, redisStorageSchema, s3StorageSchema, storageSchema } from '../../schemas'; | ||
|
|
||
| export type FsStorage = z.infer<typeof fsStorageSchema>; | ||
| export type S3Storage = z.infer<typeof s3StorageSchema>; | ||
| export type RedisStorage = z.infer<typeof redisStorageSchema>; | ||
| export type Storage = z.infer<typeof storageSchema>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| import z from 'zod'; | ||
| import { tileRangeSchema, tilesDeletionParamsSchema } from '../../schemas/core/tile.schema'; | ||
| import { tileRangeSchema } from '../../schemas/core/tile.schema'; | ||
|
|
||
| export type TilesDeletionParams = z.infer<typeof tilesDeletionParamsSchema>; | ||
| export type TileRange = z.infer<typeof tileRangeSchema>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,30 @@ | ||
| import z from 'zod'; | ||
| import { deleteTaskParamsSchema, deleteStoredResourcesParamsSchema } from '../../schemas/deletion/task.schema'; | ||
| import { | ||
| deleteStoredResourcesParamsSchema, | ||
| deleteTaskParamsSchema, | ||
| fsDeleteStoredResourcesParamsSchema, | ||
| fsTilesDeletionParamsSchema, | ||
| redisDeleteStoredResourcesParamsSchema, | ||
| redisTilesDeletionParamsSchema, | ||
| s3DeleteStoredResourcesParamsSchema, | ||
| s3TilesDeletionParamsSchema, | ||
| tilesDeletionParamsSchema, | ||
| } from '../../schemas/deletion/task.schema'; | ||
|
|
||
| //#region DeleteTaskParams | ||
| export type DeleteTaskParams = z.infer<typeof deleteTaskParamsSchema>; | ||
| //#endregion DeleteTaskParams | ||
|
|
||
| //#region TilesDeletionParams | ||
| export type TilesDeletionParams = z.infer<typeof tilesDeletionParamsSchema>; | ||
| export type S3TilesDeletionParams = z.infer<typeof s3TilesDeletionParamsSchema>; | ||
| export type FsTilesDeletionParams = z.infer<typeof fsTilesDeletionParamsSchema>; | ||
| export type RedisTilesDeletionParams = z.infer<typeof redisTilesDeletionParamsSchema>; | ||
| //#endregion TilesDeletionParams | ||
|
|
||
| //#region DeleteStoredResourcesParams | ||
| export type DeleteStoredResourcesParams = z.infer<typeof deleteStoredResourcesParamsSchema>; | ||
| export type S3DeleteStoredResourcesParams = z.infer<typeof s3DeleteStoredResourcesParamsSchema>; | ||
| export type FsDeleteStoredResourcesParams = z.infer<typeof fsDeleteStoredResourcesParamsSchema>; | ||
| export type RedisDeleteStoredResourcesParams = z.infer<typeof redisDeleteStoredResourcesParamsSchema>; | ||
| //#endregion DeleteStoredResourcesParams |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.