Skip to content

Handle transient DOI lookup failures in arXiv correction workflow#1106

Merged
pancetta merged 3 commits into
sourcefrom
copilot/fix-ci-run
Jun 15, 2026
Merged

Handle transient DOI lookup failures in arXiv correction workflow#1106
pancetta merged 3 commits into
sourcefrom
copilot/fix-ci-run

Conversation

Copilot AI commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

The arxiv_to_publications_correct workflow could fail the entire CI job when a DOI lookup returned a network error or malformed metadata. This change makes the correction script treat those cases as per-entry failures and continue processing the rest of the issue payload.

  • Workflow failure mode

    • Replace uncaught requests failures with explicit handling for DOI fetch errors.
    • Add request timeouts so the job does not hang indefinitely on upstream DOI/Crossref calls.
  • Metadata parsing hardening

    • Guard JSON decoding and required metadata access (author, issued) before deriving the replacement BibTeX key.
    • Skip incomplete or invalid responses with a clear log message instead of exiting the script.
  • Bibliography update safety

    • Verify the referenced entry still exists and is still unpublished before mutating pint.bib.
    • Treat stale or already-updated issue content as ignorable input rather than a hard failure.
def fetch_doi_content(url, accept_header, description):
    try:
        response = requests.get(url, headers={'Accept': accept_header}, timeout=30)
        response.raise_for_status()
    except RequestException as exc:
        print(f'Ignoring {url}, failed to fetch {description}: {exc}\n\n')
        return None
    return response

@pancetta

Copy link
Copy Markdown
Member

@copilot remove the cached files

Copilot AI commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

@copilot remove the cached files

Addressed in aa5587d.

Copilot AI requested a review from pancetta June 15, 2026 05:20
@pancetta pancetta marked this pull request as ready for review June 15, 2026 05:20
@pancetta pancetta merged commit 42d5290 into source Jun 15, 2026
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