Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/api/resources/templates/rapid/rapid_content.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
</div>
{{ 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 %}
</div>
<div class="redirect-text">
<span>
You will be redirected to the new Ensembl website, where you will find the latest genomic information
</span>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions app/api/resources/templates/shared/appbar.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="topbar">
<div class="topbar-left">
<div class="home-link">
<a href="https://beta.ensembl.org/" aria-label="Ensembl home page">
<a href="https://www.ensembl.org/" aria-label="Ensembl home page">
{% include "shared/_home_icon.html" %}
</a>
</div>
Expand All @@ -22,4 +22,4 @@
<div class="topbar-right">
<span>Genome data & annotation</span>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion app/api/resources/templates/shared/id_content.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="error-message">
{{ response.message }}
</div>
{{ 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 %}
Expand Down
4 changes: 2 additions & 2 deletions app/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ 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"
)
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"
)
Expand Down
Binary file modified resolver_mappings.db
Binary file not shown.
6 changes: 3 additions & 3 deletions sample-env
Original file line number Diff line number Diff line change
@@ -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
FAST_MATCH_DB_PATH=/path/to/your/fast_match_db.redb
31 changes: 15 additions & 16 deletions sql/legacy_url_path_mappings.sql
Original file line number Diff line number Diff line change
@@ -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 '',
Expand Down Expand Up @@ -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
),
(
Expand All @@ -89,21 +88,21 @@ VALUES
(
'',
'/tools/vep',
'https://beta.ensembl.org/tools/vep',
'https://www.ensembl.org/tools/vep',

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.

Sorry, what's happening here? /tools/vep is redirected to /tools/vep?

@bilalebi bilalebi Aug 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, there is no point in having that mapping any more 👍

Wait! that means:

Any host with /tools/vep will take you to https://www.ensembl.org/tools/vep

Examples:

You can try it now with those links above, though it will still be taking you to beta

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
);

Expand All @@ -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
);
44 changes: 22 additions & 22 deletions tests/test_legacy_url_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
),
(
Expand All @@ -52,7 +52,7 @@ def setUp(self):
(
'',
'/tools/vep',
'https://beta.ensembl.org/tools/vep',
'https://www.ensembl.org/tools/vep',
TRUE
),
(
Expand All @@ -72,7 +72,7 @@ def setUp(self):
VALUES
(
'staging-protists.ensembl.org',
'https://beta.ensembl.org',
'https://www.ensembl.org',
TRUE
);
""")
Expand All @@ -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/"),
Expand All @@ -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):
Expand All @@ -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):
Expand Down Expand Up @@ -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/",
),
]

Expand Down
8 changes: 4 additions & 4 deletions tests/test_legacy_url_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(
Expand All @@ -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,
Expand All @@ -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")
Expand Down
Loading