From 3e2f6f2bcd8b76c9a28f6c6dfcc491b7f76fd0f1 Mon Sep 17 00:00:00 2001 From: yuanzhou Date: Thu, 11 Jun 2026 10:45:18 -0400 Subject: [PATCH 1/6] 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/6] 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/6] 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/6] 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/6] 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 From f8993c46bd7877d28d8903cf1dd79fcda00576e0 Mon Sep 17 00:00:00 2001 From: Derek Furst Date: Mon, 13 Jul 2026 13:54:58 -0400 Subject: [PATCH 6/6] moved placeholder tsv file and renamed. added 57 new hubmap ids that will be added soon, still with placeholder values. updated app.cfg.example --- doi-pages/doi-redirect.tsv | 61 +++++++++++++++++++ .../heads/main/doi-redirect/doi-redirects.tsv | 4 -- src/instance/app.cfg.example | 2 + 3 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 doi-pages/doi-redirect.tsv delete mode 100644 refs/heads/main/doi-redirect/doi-redirects.tsv diff --git a/doi-pages/doi-redirect.tsv b/doi-pages/doi-redirect.tsv new file mode 100644 index 00000000..8fd56e33 --- /dev/null +++ b/doi-pages/doi-redirect.tsv @@ -0,0 +1,61 @@ +hubmap_id landing_page_to_register data_information_page doi +HBM377.WFSM.936 test_landing_page1 https://purl.humanatlas.io/omap/1-human-lymph-node-ibex/v1. https://doi.org/10.35079/HBM377.WFSM.936 +HBM522.KQLL.594 test_landing_page2 https://purl.humanatlas.io/asct-b/lymph-vasculature/v1.5 https://doi.org/10.35079/HBM522.KQLL.594 +HBM838.CHFF.356 test_landing_page3 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM528.GWLG.472 test_landing_page4 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM286.QFNP.554 test_landing_page4 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM846.LZCV.363 test_landing_page5 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM663.DHKQ.865 test_landing_page6 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM629.BDQB.527 test_landing_page7 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM676.GTXH.329 test_landing_page8 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM653.SJPF.374 test_landing_page9 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM656.ZKVH.979 test_landing_page10 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM957.HKNH.796 test_landing_page11 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM639.WWMD.883 test_landing_page12 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM683.KXSC.925 test_landing_page13 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM353.CWQW.535 test_landing_page14 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM425.GDQX.743 test_landing_page15 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM646.WTZK.555 test_landing_page16 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM722.FWCH.887 test_landing_page17 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM284.KHZR.923 test_landing_page18 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM999.RGNX.353 test_landing_page19 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM236.WBVX.927 test_landing_page20 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM387.GWMM.369 test_landing_page21 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM283.JWPZ.657 test_landing_page22 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM678.SJXK.375 test_landing_page23 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM744.HXCC.628 test_landing_page24 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM523.FTSL.294 test_landing_page25 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM428.VFLB.998 test_landing_page26 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM646.LHSJ.765 test_landing_page27 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM226.CSDM.832 test_landing_page28 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM673.QFPX.636 test_landing_page29 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM967.WHNN.233 test_landing_page30 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM638.XQKL.755 test_landing_page31 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM428.HCDN.258 test_landing_page32 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM765.TCFP.373 test_landing_page33 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM698.RZDG.587 test_landing_page34 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM974.DJSV.344 test_landing_page35 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM443.ZFRL.298 test_landing_page36 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM858.WBVC.362 test_landing_page37 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM298.LDDB.387 test_landing_page38 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM253.VXLN.367 test_landing_page39 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM556.VHXG.898 test_landing_page40 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM674.XVGG.736 test_landing_page41 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM749.SCVF.253 test_landing_page42 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM425.QWWF.933 test_landing_page43 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM837.HCJN.829 test_landing_page44 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM288.RSVK.723 test_landing_page45 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM346.DFPP.785 test_landing_page46 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM646.NHKK.829 test_landing_page47 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM577.XHHB.694 test_landing_page48 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM449.BMVS.455 test_landing_page49 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM737.CVZK.963 test_landing_page50 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM244.DLVB.376 test_landing_page51 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM589.XHFM.629 test_landing_page52 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM442.NPRG.337 test_landing_page53 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM769.WSLR.852 test_landing_page54 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM447.MXVB.286 test_landing_page55 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM585.JSKG.833 test_landing_page56 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM437.GKTS.458 test_landing_page57 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM965.PTTW.982 test_landing_page58 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 +HBM854.FKSW.462 test_landing_page59 https://purl.humanatlas.io/asct-b/main-bronchus/v1.2 https://doi.org/10.35079/HBM467.LMBG.759 diff --git a/refs/heads/main/doi-redirect/doi-redirects.tsv b/refs/heads/main/doi-redirect/doi-redirects.tsv deleted file mode 100644 index 014394f4..00000000 --- a/refs/heads/main/doi-redirect/doi-redirects.tsv +++ /dev/null @@ -1,4 +0,0 @@ -hubmap_id landing_page_to_register data_information_page doi -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 diff --git a/src/instance/app.cfg.example b/src/instance/app.cfg.example index 37b4f792..d6449698 100644 --- a/src/instance/app.cfg.example +++ b/src/instance/app.cfg.example @@ -84,4 +84,6 @@ DOI_REDIRECT_URL = 'https://portal.hubmapconsortium.org/browse///doi-pages/doi-redirect.tsv'