From 3e2f6f2bcd8b76c9a28f6c6dfcc491b7f76fd0f1 Mon Sep 17 00:00:00 2001 From: yuanzhou Date: Thu, 11 Jun 2026 10:45:18 -0400 Subject: [PATCH 1/5] Update VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ee4c1b2e..d62d896a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.6.17 +2.6.18 From 190dc15bfc1c6dc01b27f7359ef6cafe306926ad Mon Sep 17 00:00:00 2001 From: Derek Furst Date: Mon, 29 Jun 2026 18:10:14 -0400 Subject: [PATCH 2/5] pushing dummy doi-redirects.tsv for testing --- refs/heads/main/doi-redirect/doi-redirects.tsv | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 refs/heads/main/doi-redirect/doi-redirects.tsv diff --git a/refs/heads/main/doi-redirect/doi-redirects.tsv b/refs/heads/main/doi-redirect/doi-redirects.tsv new file mode 100644 index 00000000..2a277e5c --- /dev/null +++ b/refs/heads/main/doi-redirect/doi-redirects.tsv @@ -0,0 +1,3 @@ +hubmap_id landing_page_to_register data_information_page doi +test_hubmap_ id1test_landing_page1 test_data_information_page1 test_doi1 +test_humbap_id2 test_landing_page2 test_data_information_page2 test_doi2 From 94d09519a57d1088ae483646b9dea7c456f3bfbb Mon Sep 17 00:00:00 2001 From: Derek Furst Date: Wed, 1 Jul 2026 02:10:10 -0400 Subject: [PATCH 3/5] wip, testing redirect with a valid url --- .../heads/main/doi-redirect/doi-redirects.tsv | 2 +- src/app.py | 42 +++++++++++-------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/refs/heads/main/doi-redirect/doi-redirects.tsv b/refs/heads/main/doi-redirect/doi-redirects.tsv index 2a277e5c..fb508091 100644 --- a/refs/heads/main/doi-redirect/doi-redirects.tsv +++ b/refs/heads/main/doi-redirect/doi-redirects.tsv @@ -1,3 +1,3 @@ hubmap_id landing_page_to_register data_information_page doi -test_hubmap_ id1test_landing_page1 test_data_information_page1 test_doi1 +test_hubmap_ id1test_landing_page1 https://example.com test_doi1 test_humbap_id2 test_landing_page2 test_data_information_page2 test_doi2 diff --git a/src/app.py b/src/app.py index 0bb46f15..4cd24fb4 100644 --- a/src/app.py +++ b/src/app.py @@ -265,29 +265,37 @@ def http_internal_server_error(e): ## sets the reference_redirects dict which is used ## by the /redirect method below try: + csv_reader_list = [] reference_redirects = {} url = app.config['REDIRECTION_INFO_URL'] + url2 = app.config['SECONDARY_REDIRECTION_INFO_URL'] # Use Memcached to improve performance response = schema_manager.make_request_get(url) resp_txt = response.content.decode('utf-8') cr = csv.reader(resp_txt.splitlines(), delimiter='\t') - - first = True - id_column = None - redir_url_column = None - for row in cr: - if first: - first = False - header = row - column = 0 - for label in header: - if label == 'hubmap_id': id_column = column - if label == 'data_information_page': redir_url_column = column - column = column + 1 - if id_column is None: raise Exception(f"Column hubmap_id not found in {url}") - if redir_url_column is None: raise Exception (f"Column data_information_page not found in {url}") - else: - reference_redirects[row[id_column].upper().strip()] = row[redir_url_column] + csv_reader_list.append(cr) + response2 = schema_manager.make_request_get(url2) + resp_txt2 = response2.content.decode('utf-8') + cr2 = csv.reader(resp_txt2.splitlines(), delimiter='\t') + csv_reader_list.append(cr2) + + for csv_reader in csv_reader_list: + first = True + id_column = None + redir_url_column = None + for row in csv_reader: + if first: + first = False + header = row + column = 0 + for label in header: + if label == 'hubmap_id': id_column = column + if label == 'data_information_page': redir_url_column = column + column = column + 1 + if id_column is None: raise Exception(f"Column hubmap_id not found in {url}") + if redir_url_column is None: raise Exception (f"Column data_information_page not found in {url}") + else: + reference_redirects[row[id_column].upper().strip()] = row[redir_url_column] rr = redirect('abc', code = 307) print(rr) except Exception: From 985b42fb9a5e1809a334827a03ea33d652978640 Mon Sep 17 00:00:00 2001 From: Derek Furst Date: Wed, 1 Jul 2026 16:04:26 -0400 Subject: [PATCH 4/5] updated test tsv file to have real hubmap_ids and redirect links that are not in the existing tsv --- refs/heads/main/doi-redirect/doi-redirects.tsv | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/refs/heads/main/doi-redirect/doi-redirects.tsv b/refs/heads/main/doi-redirect/doi-redirects.tsv index fb508091..447d6138 100644 --- a/refs/heads/main/doi-redirect/doi-redirects.tsv +++ b/refs/heads/main/doi-redirect/doi-redirects.tsv @@ -1,3 +1,4 @@ hubmap_id landing_page_to_register data_information_page doi -test_hubmap_ id1test_landing_page1 https://example.com test_doi1 -test_humbap_id2 test_landing_page2 test_data_information_page2 test_doi2 +HBM377.WFSM.936 test_landing_page1 https://purl.humanatlas.io/vocab/hravs#HRAVS_1000501 test_doi1 +HBM522.KQLL.594 test_landing_page2 https://purl.humanatlas.io/vocab/hravs#HRAVS_1000971 test_doi2 +HBM838.CHFF.356 test_landing_page3 https://purl.humanatlas.io/vocab/hravs#HRAVS_1000361 test_doi3 From f2546568723703ac58f4c385bce783a05b7f15af Mon Sep 17 00:00:00 2001 From: Derek Furst Date: Wed, 1 Jul 2026 16:07:36 -0400 Subject: [PATCH 5/5] fixed redirect urls in test tsv --- refs/heads/main/doi-redirect/doi-redirects.tsv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/refs/heads/main/doi-redirect/doi-redirects.tsv b/refs/heads/main/doi-redirect/doi-redirects.tsv index 447d6138..014394f4 100644 --- a/refs/heads/main/doi-redirect/doi-redirects.tsv +++ b/refs/heads/main/doi-redirect/doi-redirects.tsv @@ -1,4 +1,4 @@ hubmap_id landing_page_to_register data_information_page doi -HBM377.WFSM.936 test_landing_page1 https://purl.humanatlas.io/vocab/hravs#HRAVS_1000501 test_doi1 -HBM522.KQLL.594 test_landing_page2 https://purl.humanatlas.io/vocab/hravs#HRAVS_1000971 test_doi2 -HBM838.CHFF.356 test_landing_page3 https://purl.humanatlas.io/vocab/hravs#HRAVS_1000361 test_doi3 +HBM377.WFSM.936 test_landing_page1 https://purl.humanatlas.io/omap/1-human-lymph-node-ibex/v1. test_doi1 +HBM522.KQLL.594 test_landing_page2 https://purl.humanatlas.io/asct-b/lymph-vasculature/v1.5 test_doi2 +HBM838.CHFF.356 test_landing_page3 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 test_doi3