Skip to content

Fix citation generation workflow and remove debug-only timeout issue - #2

Merged
jxchen01 merged 4 commits into
mainfrom
copilot/track-failure-build-issue
Oct 1, 2026
Merged

jxchen01 merged 4 commits into
mainfrom
copilot/track-failure-build-issue

Conversation

Copilot AI commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix the GitHub CI citation update flow so it actually publishes updated citations instead of silently succeeding with no file diff.

Changes

  • Removed the expensive debug dump step from the citation workflow to reduce runtime and noise.
  • Increased the workflow timeout to allow the citation job to complete without being force-cancelled.
  • Added a Crossref fallback in _cite/util.py so DOI citation generation still succeeds when Manubot/DOI resolution is flaky or unavailable.
  • Kept the normal push-to-main flow so updated citations are committed and the site rebuilds from the generated YAML.

Why

The citation job was relying on a brittle Manubot/DOI lookup path that could fail without producing a changed _data/citations.yaml, leaving the site stale while the workflow reported success.

Copilot AI and others added 2 commits September 30, 2026 15:53
Co-authored-by: jxchen01 <7811075+jxchen01@users.noreply.github.com>
Co-authored-by: jxchen01 <7811075+jxchen01@users.noreply.github.com>
@jxchen01
jxchen01 marked this pull request as ready for review October 1, 2026 06:34
@jxchen01

jxchen01 commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
PR Preview Action v1.4.7
🚀 Deployed preview to https://MMV-Lab.github.io/mmv-lab.github.io/preview/pr-2/
on branch gh-pages at 2026-10-01 06:36 UTC

…PR branch

Co-authored-by: jxchen01 <7811075+jxchen01@users.noreply.github.com>
Copilot AI requested a review from jxchen01 October 1, 2026 06:37
@jxchen01
jxchen01 requested a balanced review from Copilot October 1, 2026 06:38
@jxchen01
jxchen01 merged commit 2393d9e into main Oct 1, 2026
4 checks passed
@jxchen01
jxchen01 deleted the copilot/track-failure-build-issue branch October 1, 2026 06:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The new Crossref fallback indexes get_safe(...)[0] and date_parts[0] without guarding for empty lists, so sparse Crossref responses raise uncaught IndexErrors that defeat the fallback's purpose.

Review effort: Balanced
Findings: 3 Medium severity · 1 Low severity

Open (4)
What changed in this PR

This PR aims to make the citation-update CI flow more reliable. The citation job (_cite/cite.py → cite_with_manubot) depends on Manubot/DOI resolution, which can fail transiently and leave _data/citations.yaml unchanged while the workflow still reports success. The PR adds a Crossref metadata fallback so a failed Manubot lookup can still yield a citation, hardens the Manubot subprocess handling, and tweaks the workflow (removes a debug step, raises the citation build step's timeout).

Changes:

  • Added crossref_citation_fallback in _cite/util.py to fetch CSL-like metadata from the Crossref API when Manubot/DOI resolution fails.
  • Refactored cite_with_manubot to capture stderr, detect empty Manubot output, and fall back to Crossref before raising.
  • Removed the Debug dump step and raised the "Build updated citations" step timeout from 15 to 60 minutes.
File Description
_cite/​util.py Adds Crossref fallback and reworks the Manubot subprocess/parse/error path; the fallback has unguarded list indexing that can raise IndexError on sparse Crossref records and drops previous error logging.
.github/​workflows/​update-citations.yaml Removes the debug-dump step and raises the citation build step timeout to 60 minutes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread _cite/util.py
return None

message = get_safe(payload, "message", {})
title = get_safe(message, "title", [""])[0]
Comment thread _cite/util.py
Comment on lines +198 to +199
month = date_parts[0][1] if len(date_parts[0]) > 1 else "1"
day = date_parts[0][2] if len(date_parts[0]) > 2 else "1"
Comment thread _cite/util.py
manubot = json.loads(stdout)[0]
except Exception:
raise Exception("Couldn't parse Manubot response")
manubot = crossref_citation_fallback(_id)
Comment thread _cite/util.py
Comment on lines +227 to +235
output = subprocess.Popen(commands, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
stdout = output[0] or b""
if not stdout:
raise ValueError("No stdout from Manubot")
manubot = json.loads(stdout)[0]
except Exception:
raise Exception("Couldn't parse Manubot response")
manubot = crossref_citation_fallback(_id)
if not manubot:
raise Exception("Manubot could not generate citation")
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.

3 participants