From a6d81977612b0f647f207abd44b92e36bc1b0483 Mon Sep 17 00:00:00 2001 From: Peyton Lee Date: Thu, 12 Nov 2026 12:03:43 -0800 Subject: [PATCH 1/2] feat: Handle FMS (`/allen/programs`) paths --- src/test/url_utils.test.ts | 6 ++++++ src/utils/url_utils.ts | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/test/url_utils.test.ts b/src/test/url_utils.test.ts index ac51edd4f..a69ac078e 100644 --- a/src/test/url_utils.test.ts +++ b/src/test/url_utils.test.ts @@ -31,6 +31,12 @@ describe("remapUrl", () => { expect(remapUri("/allen/aics/example/data.zarr")).toBe("https://vast-files.int.allencell.org/example/data.zarr"); }); + it("maps FMS file paths", () => { + expect(remapUri("/allen/programs/allencell/data/proj0/folder/some-data.ome.zarr")).toBe( + "https://s3.us-west-2.amazonaws.com/production.files.allencell.org/folder/some-data.ome.zarr" + ); + }); + it("maps example Human Organ Atlas GCS URL", () => { expect( remapUri( diff --git a/src/utils/url_utils.ts b/src/utils/url_utils.ts index cd129b1af..052930cde 100644 --- a/src/utils/url_utils.ts +++ b/src/utils/url_utils.ts @@ -2,6 +2,8 @@ const S3_URL_PREFIX = "s3://"; const GCS_URL_PREFIX = "gs://"; const VAST_FILES_PREFIX = "/allen/aics/"; const VAST_FILES_URL = "https://vast-files.int.allencell.org/"; +const FMS_FILES_PREFIX = "/allen/programs/allencell/data/proj0"; +const FMS_FILES_URL = "https://s3.us-west-2.amazonaws.com/production.files.allencell.org"; /** * Remaps non-standard URIs (e.g. S3 (`s3://`), Google Cloud Storage (`gs://`), or @@ -21,6 +23,9 @@ export function remapUri(url: string): string { } else if (newUrl.startsWith(VAST_FILES_PREFIX)) { // remap /allen/aics/... to https://vast-files.int.allencell.org/... newUrl = newUrl.replace(VAST_FILES_PREFIX, VAST_FILES_URL); + } else if (newUrl.startsWith(FMS_FILES_PREFIX)) { + // remap /allen/programs/allencell/data/proj0/... to https://s3.us-west-2.amazonaws.com/production.files.allencell.org/... + newUrl = newUrl.replace(FMS_FILES_PREFIX, FMS_FILES_URL); } return newUrl; From a886fdb78561521a1240b7229b362c53a3236cf1 Mon Sep 17 00:00:00 2001 From: Peyton Lee Date: Fri, 13 Nov 2026 12:23:48 -0800 Subject: [PATCH 2/2] refactor: Remove comments --- src/utils/url_utils.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/utils/url_utils.ts b/src/utils/url_utils.ts index 052930cde..c86d918d9 100644 --- a/src/utils/url_utils.ts +++ b/src/utils/url_utils.ts @@ -21,10 +21,8 @@ export function remapUri(url: string): string { // remap gs://bucket/key to https://storage.googleapis.com/bucket/key newUrl = newUrl.replace(GCS_URL_PREFIX, "https://storage.googleapis.com/"); } else if (newUrl.startsWith(VAST_FILES_PREFIX)) { - // remap /allen/aics/... to https://vast-files.int.allencell.org/... newUrl = newUrl.replace(VAST_FILES_PREFIX, VAST_FILES_URL); } else if (newUrl.startsWith(FMS_FILES_PREFIX)) { - // remap /allen/programs/allencell/data/proj0/... to https://s3.us-west-2.amazonaws.com/production.files.allencell.org/... newUrl = newUrl.replace(FMS_FILES_PREFIX, FMS_FILES_URL); }