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

deploy date in new header #734

Merged
merged 5 commits into from
Sep 23, 2024
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
1 change: 1 addition & 0 deletions browse/templates/list/new.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
</ul>

<p>See <a id="recent-{{ context }}" aria-labelledby="recent-{{ context }}" href="/list/{{ context }}/recent">recent</a> articles</p>
<h3>Showing new listings for {{announced.strftime('%A, %-d %B %Y')}}</h3>
{% endblock %}

{% block items %}
Expand Down
19 changes: 12 additions & 7 deletions script/sync_prod_to_gcp/submissions_to_gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,18 @@ def update_metadata(self):
abs_path = self.source_path(".abs")
dates = []
try:
with open(abs_path, "r", encoding="utf-8") as abs_fd:
for line in abs_fd.readlines():
sline = line.strip()
if sline == "":
break
if sline.startswith("Date"):
dates.append(sline)
with open(abs_path, "rb") as abs_fd:
abstract = abs_fd.read()
for line in abstract.split(b'\n'):
try:
sline = line.decode('utf-8')
if sline == "":
break
if sline.startswith("Date"):
dates.append(sline)
except UnicodeDecodeError:
# Don't care the non- uft-8 lines as date line is a generated text.
pass

except FileNotFoundError as exc:
msg = f"abs file {abs_path} does not exist"
Expand Down
7 changes: 3 additions & 4 deletions script/sync_prod_to_gcp/sync_published_to_gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,8 @@ def mime_from_fname(filepath):
if blob is None or blob.size != localpath.stat().st_size or key in REUPLOADS:
destination = bucket.blob(key)
with open(localpath, 'rb') as fh:

destination.upload_from_file(fh, content_type=mime_from_fname(localpath))
upload_logger.debug(
upload_logger.info(
f"upload: completed upload of {localpath} to gs://{GS_BUCKET}/{key} of size {localpath.stat().st_size}")
try:
destination.metadata = {"localpath": localpath, "mtime": get_file_mtime(localpath)}
Expand All @@ -505,7 +504,7 @@ def mime_from_fname(filepath):
upload_logger.error(f"upload: could not set time on GS object gs://{GS_BUCKET}/{key}", exc_info=True)
return "upload", localpath, key, "uploaded", ms_since(start), localpath.stat().st_size
else:
upload_logger.debug(f"upload: Not uploading {localpath}, gs://{GS_BUCKET}/{key} already on gs")
upload_logger.info(f"upload: Not uploading {localpath}, gs://{GS_BUCKET}/{key} already on gs")
return "upload", localpath, key, "already_on_gs", ms_since(start), 0


Expand Down Expand Up @@ -545,7 +544,7 @@ def sync_to_gcp(todo_q, host):

if action != 'build_html+upload':
summary_q.put((job['paper_id'], ms_since(start)) + res)
logger.debug("success uploading %s", job['paper_id'], extra=extra)
logger.info("success uploading %s", job['paper_id'], extra=extra)
sleep(0.5)
except Exception as ex:
extra.update({CATEGORY: "upload"})
Expand Down
2 changes: 1 addition & 1 deletion script/sync_prod_to_gcp/webnode_pdf_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def ping_callback(message: Message) -> None:
help_needed = os.environ.get("TEX_COMPILATION_RECIPIENT", "help@arxiv.org")
subject = f"TeX compilation for {paper_id}v{version} failed"
mail_body = f"Hello EUST,\nTex compilation for {paper_id}v{version} has failed. Please resolve the issue.\n\nThis message is generated by a bot on arxiv-sync.serverfarm.cornell.edu.\n"
cmd = ["/usr/bin/mail", "-r", "developers@arxiv.org", "-s", subject, help_needed]
cmd = ["echo", "/usr/bin/mail", "-r", "developers@arxiv.org", "-s", subject, help_needed]
mail = subprocess.Popen(cmd,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
try:
Expand Down
1 change: 1 addition & 0 deletions tests/listings/db/test_db_listing_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def test_new_listing_page( client_with_db_listings):
assert rv.status_code == 200
text = rv.text
assert "Replacement submissions" in text
assert "Showing new listings for Thursday, 3 February 2011" in text
assert "arXiv:math/0510544" in text
assert "Leibniz superalgebras graded by finite root systems" in text
assert "showing 1 of 1 entries" in text
Expand Down
Loading