Skip to content

ci: fix Fern devnotes artifact lookup#667

Merged
andreatgretel merged 1 commit into
mainfrom
andreatgretel/fix/fern-devnotes-ci
May 15, 2026
Merged

ci: fix Fern devnotes artifact lookup#667
andreatgretel merged 1 commit into
mainfrom
andreatgretel/fix/fern-devnotes-ci

Conversation

@andreatgretel

@andreatgretel andreatgretel commented May 15, 2026

Copy link
Copy Markdown
Contributor

📋 Summary

Fixes the post-merge Publish Fern devnotes failure by making the notebook artifact lookup explicit about which repository to query. After the Fern publishing change, this workflow runs gh from the Actions workspace root rather than a checkout, so repo inference no longer works.

🔗 Related Issue

N/A. Follow-up to failed workflow run https://github.com/NVIDIA-NeMo/DataDesigner/actions/runs/25939020504.

🔄 Changes

  • Pass --repo "$GITHUB_REPOSITORY" to the gh run list notebook lookup.
  • Pass --repo "$GITHUB_REPOSITORY" to the matching gh run download artifact fetch.
  • Keep the existing fallback order unchanged.

🧪 Testing

  • Verified the patched gh run list command from /tmp with GITHUB_REPOSITORY=NVIDIA-NeMo/DataDesigner.
  • Verified the patched gh run download command downloads the notebooks artifact from the latest successful release docs run.
  • /home/ubuntu/Code/repos/DataDesigner/checkouts/main/.venv/bin/ruff check --fix .
  • /home/ubuntu/Code/repos/DataDesigner/checkouts/main/.venv/bin/ruff format .
  • make test not run - workflow-only fix.
  • Unit tests added/updated: N/A - workflow-only fix.
  • E2E tests added/updated: N/A - workflow-only fix.

✅ Checklist

  • Follows commit message conventions
  • Commits are signed off (DCO)
  • Architecture docs updated: N/A - workflow-only fix

@andreatgretel andreatgretel requested a review from a team as a code owner May 15, 2026 20:27
@greptile-apps

greptile-apps Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes the post-merge Publish Fern devnotes workflow failure by explicitly passing --repo "$GITHUB_REPOSITORY" to both gh run list and gh run download in the notebook artifact lookup step. Without it, gh tried to infer the repository from the local git directory, which doesn't exist when the step runs from the Actions workspace root rather than a checkout path.

  • gh run list now receives --repo "$GITHUB_REPOSITORY" so it queries the correct repository regardless of working directory.
  • gh run download receives the same flag so artifact fetching is consistent with the list step.

Confidence Score: 5/5

Minimal two-line change to a CI workflow; both gh commands now explicitly target the correct repository using the standard $GITHUB_REPOSITORY built-in variable.

The fix is surgical and matches the root cause described in the PR: the notebook lookup step has no working-directory, so it runs from the runner workspace root (not a git checkout), making implicit repo inference fail. Adding the explicit --repo flag resolves this without side effects. $GITHUB_REPOSITORY is always populated in GitHub Actions, and the rest of the workflow (fallback loop, error handling, subsequent steps) is unchanged.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/publish-fern-devnotes.yml Adds --repo "$GITHUB_REPOSITORY" to gh run list and gh run download in the notebook artifact lookup step so repo inference works when the step runs outside a git checkout directory.

Sequence Diagram

sequenceDiagram
    participant GHA as GitHub Actions Runner
    participant GH as gh CLI
    participant API as GitHub API

    GHA->>GH: gh run list --repo "$GITHUB_REPOSITORY" --workflow "build-fern-docs.yml" --status success --event release
    GH->>API: GET /repos/NVIDIA-NeMo/DataDesigner/actions/workflows/.../runs
    API-->>GH: "[{ databaseId: 12345, ... }]"
    GH-->>GHA: "last_run_id=12345"

    GHA->>GH: gh run download 12345 --repo "$GITHUB_REPOSITORY" --name notebooks --dir website/docs/notebooks
    GH->>API: GET /repos/NVIDIA-NeMo/DataDesigner/actions/runs/12345/artifacts
    API-->>GH: notebooks artifact
    GH-->>GHA: artifact downloaded → exit 0
Loading

Reviews (1): Last reviewed commit: "ci: fix Fern devnotes artifact lookup" | Re-trigger Greptile

@github-actions

Copy link
Copy Markdown
Contributor

Code Review: PR #667 — ci: fix Fern devnotes artifact lookup

Summary

Two-line fix to .github/workflows/publish-fern-devnotes.yml adding explicit --repo "$GITHUB_REPOSITORY" to both the gh run list and gh run download calls used to locate the upstream notebooks artifact. Addresses a regression where the workflow now runs from the Actions workspace root (no checkout in scope) so gh's repo auto-inference no longer resolves to NVIDIA-NeMo/DataDesigner. The fallback order around the helper is unchanged.

Findings

Correctness

  • The fix is targeted and matches the reported failure mode. gh infers the repo from the current working directory's git remote; without a checkout, that inference fails and the call either errors or returns runs from an unrelated repo. Pinning --repo "$GITHUB_REPOSITORY" is the canonical resolution.
  • GITHUB_REPOSITORY is always populated by the GitHub Actions runtime in the form owner/repo, so the substitution is safe inside this workflow context.
  • Both the listing and the download are pinned consistently — no risk of listing a run from one repo and trying to download from another.
  • The 2>/dev/null || true guard on gh run list is preserved, so transient lookup failures still fall through to the next candidate workflow rather than aborting.

Style & Conventions

  • Quoting of "$GITHUB_REPOSITORY" is correct and consistent with the surrounding "$workflow" / "$@" style in the same helper.
  • No unrelated edits — change is appropriately minimal for a workflow-only fix.

Risk / Blast Radius

  • Scope is one workflow file (publish-fern-devnotes.yml); no Python, no package code, no tests touched. Import-direction and namespace invariants in AGENTS.md are unaffected.
  • Worst case if the env var were empty (it won't be in CI): gh would error on --repo "", the || true swallows it for gh run list, and the gh run download failure would short-circuit the if, falling through to the next candidate. So the failure mode is graceful — same as today's broken state, not worse.

Test Coverage

  • PR description notes manual verification of both patched commands against NVIDIA-NeMo/DataDesigner. That's the appropriate level of validation for a workflow fix; no automated test surface exists for gh invocations inside CI YAML, and adding one would be disproportionate.

Security

  • No secrets handling changes. GITHUB_REPOSITORY is a non-sensitive env var. No new external network surface.

Suggestions (non-blocking)

  • Optional: consider exporting GH_REPO="$GITHUB_REPOSITORY" once at the top of the step rather than passing --repo per-call. gh honors GH_REPO as a fallback and it would prevent future drift if more gh calls are added to this helper. Not worth blocking on for a two-line fix.

Verdict

Approve. The change is minimal, correct, addresses the documented post-merge failure, and carries effectively zero risk to the rest of the codebase. Manual verification is appropriate given the workflow-only scope.

@andreatgretel andreatgretel merged commit cd604a5 into main May 15, 2026
55 checks passed
@andreatgretel andreatgretel deleted the andreatgretel/fix/fern-devnotes-ci branch May 20, 2026 15:25
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