Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ARXIVCE-3081] ensure_pdf to work with old style arxiv ID #831

Merged
merged 2 commits into from
Jan 28, 2025

Conversation

ntai-arxiv
Copy link
Contributor

  • The fix itself is a single liner change in ensure_pdf().
  • The logging around is a little more verbose when it does not get PDF.
  • The test "test_ask_pdf_for_old_arxiv_id" added.
  • The set up removes the PDF in sync-test bucket.

To run the test, you need a GCP credential so it is not part of git workflow. Once we shift the CI/CD to Drone, we'd be able to run the tests on GCP. For now, run tests by hand. The test result attached.

image

@ntai-arxiv ntai-arxiv requested a review from a team January 28, 2025 19:05
@@ -390,7 +390,7 @@ def ensure_pdf(session, host, arxiv_id, timeout=0, protocol = "https", source_mt
timeout = PDF_WAIT_SEC if not timeout else timeout
archive = ('arxiv' if not arxiv_id.is_old_id else arxiv_id.archive)
pdf_file = Path(f"{PS_CACHE_PREFIX}/{archive}/pdf/{arxiv_id.yymm}/{arxiv_id.filename}v{arxiv_id.version}.pdf")
url = f"{protocol}://{host}/pdf/{arxiv_id.filename}v{arxiv_id.version}.pdf"
url = f"{protocol}://{host}/pdf/{arxiv_id.idv}.pdf"
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@@ -773,26 +773,31 @@ def submission_message_to_file_state(data: dict, log_extra: dict, ask_webnode: b
WEBNODE_REQUEST_COUNT = (WEBNODE_REQUEST_COUNT + 1) % n_webnodes
host, n_para = CONCURRENCY_PER_WEBNODE[min(n_webnodes - 1, max(0, my_tag))]
protocol = "http" if host.startswith("localhost:") else "https"
log_extra['webnode'] = host
Copy link
Contributor

Choose a reason for hiding this comment

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

I see that it is difficult to get the URL used to request the PDF due to ensure_pdf signature. 👍

@ntai-arxiv ntai-arxiv added this pull request to the merge queue Jan 28, 2025
Merged via the queue into develop with commit f2adb5a Jan 28, 2025
4 checks passed
@ntai-arxiv ntai-arxiv deleted the ARXIVCE-3081-ensure_pdf-olde-style-arxiv-id-fix branch January 28, 2025 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants