diff --git a/app/api/resources/templates/rapid/rapid_content.html b/app/api/resources/templates/rapid/rapid_content.html index d979f20..aa86880 100644 --- a/app/api/resources/templates/rapid/rapid_content.html +++ b/app/api/resources/templates/rapid/rapid_content.html @@ -33,7 +33,7 @@ {{ url_helper.render_url("Redirecting to", response.resolved_url) }} {% else %} - {{ url_helper.render_url("Redirecting to", "https://beta.ensembl.org/") }} + {{ url_helper.render_url("Redirecting to", "https://www.ensembl.org/") }} {% endif %}
@@ -41,4 +41,4 @@ You will be redirected to the new Ensembl website, where you will find the latest genomic information
- \ No newline at end of file + diff --git a/app/api/resources/templates/shared/appbar.html b/app/api/resources/templates/shared/appbar.html index da6b3cc..a9a3d80 100644 --- a/app/api/resources/templates/shared/appbar.html +++ b/app/api/resources/templates/shared/appbar.html @@ -1,7 +1,7 @@
@@ -22,4 +22,4 @@
Genome data & annotation
-
\ No newline at end of file +
diff --git a/app/api/resources/templates/shared/id_content.html b/app/api/resources/templates/shared/id_content.html index 85af5e7..5d4d25d 100644 --- a/app/api/resources/templates/shared/id_content.html +++ b/app/api/resources/templates/shared/id_content.html @@ -10,7 +10,7 @@
{{ response.message }}
- {{ url_helper.render_url("Go to", "https://beta.ensembl.org/genome-selector") }} + {{ url_helper.render_url("Go to", "https://www.ensembl.org/genome-selector") }} {% if response.archive_url %} {{ url_helper.render_url("Go to archive", response.archive_url) }} {% endif %} diff --git a/app/core/config.py b/app/core/config.py index c927197..0a49c3f 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -47,7 +47,7 @@ def normalize_app_prefix(prefix: str) -> str: FAST_MATCH_ENABLED: bool = config("FAST_MATCH_ENABLED", cast=bool, default=True) FAST_MATCH_DB_PATH: str = config("FAST_MATCH_DB_PATH", cast=str, default="") DEFAULT_APP = config("DEFAULT_APP", cast=str, default="feature-explorer") -ENSEMBL_URL = config("ENSEMBL_URL", cast=str, default="https://beta.ensembl.org") +ENSEMBL_URL = config("ENSEMBL_URL", cast=str, default="https://www.ensembl.org") STATIC_PATH = config("STATIC_PATH", cast=str, default="/resolver-static") RAPID_ARCHIVE_URL = config( "RAPID_ARCHIVE_URL", cast=str, default="https://rapid-archive.ensembl.org" @@ -55,7 +55,7 @@ def normalize_app_prefix(prefix: str) -> str: NCBI_DATASETS_URL = config( "NCBI_DATASETS_URL", cast=str, default="https://api.ncbi.nlm.nih.gov/datasets/v2" ) -SPECIES_MAPPING_DB_PATH = config("SPECIES_MAPPING_DB_PATH", cast=str, default="") +SPECIES_MAPPING_DB_PATH = config("SPECIES_MAPPING_DB_PATH", cast=str, default="./resolver_mappings.db") SPECIES_MAPPING_TABLE = config( "SPECIES_MAPPING_TABLE", cast=str, default="species_genome_uuid_mapping" ) diff --git a/resolver_mappings.db b/resolver_mappings.db index a178a35..ea3b9b6 100644 Binary files a/resolver_mappings.db and b/resolver_mappings.db differ diff --git a/sample-env b/sample-env index 2423f82..02a778f 100644 --- a/sample-env +++ b/sample-env @@ -1,11 +1,11 @@ PORT=8001 -ENSEMBL_SEARCH_HUB_API=https://beta.ensembl.org/api/search/stable-id +ENSEMBL_SEARCH_HUB_API=https://www.ensembl.org/api/search/stable-id DEFAULT_APP=feature-explorer -ENSEMBL_URL=http://beta.ensembl.org +ENSEMBL_URL=http://www.ensembl.org DEBUG=true NCBI_DATASETS_URL=https://api.ncbi.nlm.nih.gov/datasets/v2 SPECIES_MAPPING_DB_PATH=./resolver_mappings.db SPECIES_MAPPING_TABLE=species_genome_uuid_mapping APP_PREFIX=/ FAST_MATCH_ENABLED=true -FAST_MATCH_DB_PATH=/path/to/your/fast_match_db.redb \ No newline at end of file +FAST_MATCH_DB_PATH=/path/to/your/fast_match_db.redb diff --git a/sql/legacy_url_path_mappings.sql b/sql/legacy_url_path_mappings.sql index 2ed3314..46becab 100644 --- a/sql/legacy_url_path_mappings.sql +++ b/sql/legacy_url_path_mappings.sql @@ -1,5 +1,4 @@ -- Support both staging and production legacy Ensembl hosts. --- on the day of the switch to www, we replace beta.ensembl.org with www.ensembl.org CREATE TABLE IF NOT EXISTS legacy_url_path_mappings ( source_host TEXT NOT NULL DEFAULT '', @@ -70,14 +69,14 @@ VALUES ( '', '/multi/tools/blast', - 'https://beta.ensembl.org/tools/blast', + 'https://www.ensembl.org/tools/blast', TRUE ), -- VEP mappings ( '', '/multi/tools/vep', - 'https://beta.ensembl.org/tools/vep', + 'https://www.ensembl.org/tools/vep', TRUE ), ( @@ -89,21 +88,21 @@ VALUES ( '', '/tools/vep', - 'https://beta.ensembl.org/tools/vep', + 'https://www.ensembl.org/tools/vep', TRUE ), -- Search mappings ( '', '/multi/search/results', - 'https://beta.ensembl.org/genome-selector', + 'https://www.ensembl.org/genome-selector', TRUE ), -- Legacy division landing pages now share the new Ensembl homepage. ( '', '/index.html', - 'https://beta.ensembl.org/', + 'https://www.ensembl.org/', TRUE ); @@ -122,51 +121,51 @@ VALUES -- Map divisions to the new Ensembl. ( 'staging-plants.ensembl.org', - 'https://beta.ensembl.org', + 'https://www.ensembl.org', TRUE ), ( 'plants.ensembl.org', - 'https://beta.ensembl.org', + 'https://www.ensembl.org', TRUE ), ( 'staging-metazoa.ensembl.org', - 'https://beta.ensembl.org', + 'https://www.ensembl.org', TRUE ), ( 'metazoa.ensembl.org', - 'https://beta.ensembl.org', + 'https://www.ensembl.org', TRUE ), ( 'staging-fungi.ensembl.org', - 'https://beta.ensembl.org', + 'https://www.ensembl.org', TRUE ), ( 'fungi.ensembl.org', - 'https://beta.ensembl.org', + 'https://www.ensembl.org', TRUE ), ( 'staging-bacteria.ensembl.org', - 'https://beta.ensembl.org', + 'https://www.ensembl.org', TRUE ), ( 'bacteria.ensembl.org', - 'https://beta.ensembl.org', + 'https://www.ensembl.org', TRUE ), ( 'staging-protists.ensembl.org', - 'https://beta.ensembl.org', + 'https://www.ensembl.org', TRUE ), ( 'protists.ensembl.org', - 'https://beta.ensembl.org', + 'https://www.ensembl.org', TRUE ); diff --git a/tests/test_legacy_url_mapping.py b/tests/test_legacy_url_mapping.py index 86d4276..0850a84 100644 --- a/tests/test_legacy_url_mapping.py +++ b/tests/test_legacy_url_mapping.py @@ -34,13 +34,13 @@ def setUp(self): ( '', '/multi/tools/blast', - 'https://beta.ensembl.org/tools/blast', + 'https://www.ensembl.org/tools/blast', TRUE ), ( '', '/multi/search/results', - 'https://beta.ensembl.org/genome-selector', + 'https://www.ensembl.org/genome-selector', TRUE ), ( @@ -52,7 +52,7 @@ def setUp(self): ( '', '/tools/vep', - 'https://beta.ensembl.org/tools/vep', + 'https://www.ensembl.org/tools/vep', TRUE ), ( @@ -72,7 +72,7 @@ def setUp(self): VALUES ( 'staging-protists.ensembl.org', - 'https://beta.ensembl.org', + 'https://www.ensembl.org', TRUE ); """) @@ -92,18 +92,18 @@ def test_get_static_mapping_ignores_host_for_path_mappings(self): get_static_legacy_url_mapping( "https://staging-plants.ensembl.org/Multi/Tools/Blast" ), - "https://beta.ensembl.org/tools/blast", + "https://www.ensembl.org/tools/blast", ) self.assertEqual( get_static_legacy_url_mapping("https://www.ensembl.org/Multi/Tools/Blast"), - "https://beta.ensembl.org/tools/blast", + "https://www.ensembl.org/tools/blast", ) def test_get_static_mapping_normalizes_path_case_and_trailing_slash(self): """Treat case and a final slash as insignificant for exact path matches.""" self.assertEqual( get_static_legacy_url_mapping("https://www.ensembl.org/multi/tools/blast/"), - "https://beta.ensembl.org/tools/blast", + "https://www.ensembl.org/tools/blast", ) self.assertEqual( get_static_legacy_url_mapping("https://staging.ensembl.org/VEP/"), @@ -116,7 +116,7 @@ def test_get_static_mapping_discards_query_string(self): get_static_legacy_url_mapping( "https://www.ensembl.org/Multi/Search/Results?q=brca2" ), - "https://beta.ensembl.org/genome-selector", + "https://www.ensembl.org/genome-selector", ) def test_get_static_mapping_prefers_host_specific_path_mapping(self): @@ -136,30 +136,30 @@ def test_get_static_mapping_uses_generic_path_when_host_has_no_override(self): get_static_legacy_url_mapping( "https://www.ensembl.org/Multi/Search/Results" ), - "https://beta.ensembl.org/genome-selector", + "https://www.ensembl.org/genome-selector", ) self.assertEqual( get_static_legacy_url_mapping( "https://plants.ensembl.org/Multi/Search/Results" ), - "https://beta.ensembl.org/genome-selector", + "https://www.ensembl.org/genome-selector", ) self.assertEqual( get_static_legacy_url_mapping("https://staging.ensembl.org/Tools/VEP"), - "https://beta.ensembl.org/tools/vep", + "https://www.ensembl.org/tools/vep", ) self.assertEqual( get_static_legacy_url_mapping( "https://staging-plants.ensembl.org/Tools/VEP" ), - "https://beta.ensembl.org/tools/vep", + "https://www.ensembl.org/tools/vep", ) def test_get_static_mapping_handles_bare_host_homepage(self): """Resolve configured scheme-less host homepages.""" self.assertEqual( get_static_legacy_url_mapping("staging-protists.ensembl.org"), - "https://beta.ensembl.org", + "https://www.ensembl.org", ) def test_get_static_mapping_does_not_apply_host_mapping_to_paths(self): @@ -213,39 +213,39 @@ def test_seeded_static_mappings_resolve_current_legacy_urls(self): ), ( "https://staging.ensembl.org/Tools/VEP", - "https://beta.ensembl.org/tools/vep", + "https://www.ensembl.org/tools/vep", ), ( "https://staging-plants.ensembl.org/Tools/VEP", - "https://beta.ensembl.org/tools/vep", + "https://www.ensembl.org/tools/vep", ), ( "https://staging-metazoa.ensembl.org/Tools/VEP", - "https://beta.ensembl.org/tools/vep", + "https://www.ensembl.org/tools/vep", ), ( "https://staging-fungi.ensembl.org/Tools/VEP", - "https://beta.ensembl.org/tools/vep", + "https://www.ensembl.org/tools/vep", ), ( "https://staging-protists.ensembl.org/Tools/VEP", - "https://beta.ensembl.org/tools/vep", + "https://www.ensembl.org/tools/vep", ), ( "https://staging-bacteria.ensembl.org/Tools/VEP", - "https://beta.ensembl.org/tools/vep", + "https://www.ensembl.org/tools/vep", ), ( "https://bacteria.ensembl.org/index.html", - "https://beta.ensembl.org/", + "https://www.ensembl.org/", ), ( "https://plants.ensembl.org/index.html", - "https://beta.ensembl.org/", + "https://www.ensembl.org/", ), ( "https://staging-metazoa.ensembl.org/index.html", - "https://beta.ensembl.org/", + "https://www.ensembl.org/", ), ] diff --git a/tests/test_legacy_url_resolver.py b/tests/test_legacy_url_resolver.py index 000bb61..b24a5aa 100644 --- a/tests/test_legacy_url_resolver.py +++ b/tests/test_legacy_url_resolver.py @@ -46,7 +46,7 @@ def tearDown(self): ) def test_resolve_static_path_mapping_with_redirect(self, mock_species_lookup): """Resolve configured static legacy paths before species URL rules.""" - self.mock_static_mapping.return_value = "https://beta.ensembl.org/tools/blast" + self.mock_static_mapping.return_value = "https://www.ensembl.org/tools/blast" response = self.client.get( self.mock_url_resolver_api_url, @@ -62,7 +62,7 @@ def test_resolve_static_path_mapping_with_redirect(self, mock_species_lookup): self.assertEqual(response.status_code, 308) self.assertEqual( response.headers["location"], - "https://beta.ensembl.org/tools/blast", + "https://www.ensembl.org/tools/blast", ) self.assertEqual(response.headers["cache-control"], "no-store, max-age=0") self.mock_static_mapping.assert_called_once_with( @@ -76,7 +76,7 @@ def test_resolve_static_path_mapping_with_redirect(self, mock_species_lookup): ) def test_resolve_static_host_mapping_with_json_response(self, mock_species_lookup): """Return configured static host mappings for JSON clients.""" - self.mock_static_mapping.return_value = "https://beta.ensembl.org" + self.mock_static_mapping.return_value = "https://www.ensembl.org" response = self.client.get( self.mock_url_resolver_api_url, @@ -88,7 +88,7 @@ def test_resolve_static_host_mapping_with_json_response(self, mock_species_looku self.assertEqual(response.status_code, 200) self.assertEqual( response.json(), - {"resolved_url": "https://beta.ensembl.org"}, + {"resolved_url": "https://www.ensembl.org"}, ) self.assertEqual(response.headers["cache-control"], "no-store, max-age=0") self.mock_static_mapping.assert_called_once_with("staging-protists.ensembl.org")