Skip to content

ci(corpus): fix release publishing (GH_REPO) + publish-only recovery path - #336

Merged
jensholdgaard merged 2 commits into
mainfrom
corpus-publish-fix
Jul 2, 2026
Merged

ci(corpus): fix release publishing (GH_REPO) + publish-only recovery path#336
jensholdgaard merged 2 commits into
mainfrom
corpus-publish-fix

Conversation

@jensholdgaard

@jensholdgaard jensholdgaard commented Jul 2, 2026

Copy link
Copy Markdown
Owner

What

The corpus/otel-demo-v7 run failed after its 5-hour capture succeeded
in the cheap publish job: gh release createfatal: not a git repository.

Root cause: the publish job deliberately has no checkout (#251 split it off
so the write-capable token never coexists with the ~20 third-party demo images),
so gh cannot resolve the repository from a git remote. v6 predates that split
(created 2026-06-10; the split landed 2026-06-19) — v7 was the first publish
attempt since the split
, hitting the latent gap. Not a #332 regression: the
new attest/bundle steps all succeeded.

Fix: GH_REPO: ${{ github.repository }} on the publish step.

Recovery path (so the 5h capture isn't wasted): a new artifact_run_id
dispatch input skips the capture job and publishes from the otel-demo-corpus
artifact of the named earlier run (cross-run download-artifact with the
token). v7's artifact is retained until 2026-09-30. The publish job's if
accepts capture-success or capture-skipped-with-artifact; release notes now
record the capture run id; the input docs require passing the original
capture's parameters so the notes stay truthful.

After merge

Dispatch with artifact_run_id=28608068720 + release_tag=corpus/otel-demo-v7
(+ v6's parameters) → the first signed corpus release (attest +
otel-demo-corpus.intoto.jsonl from #332), minted from the already-captured
bytes in minutes instead of 5 hours.

Verification

YAML parses; actionlint clean. The publish path itself is only exercisable by
a real dispatch — which the post-merge recovery run performs.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a recovery/publish-only option for the capture workflow, letting you publish from a previous artifact run without re-running capture.
  • Bug Fixes

    • Improved release note accuracy by using the original captured run’s commit when publishing from a recovered artifact.
    • Updated artifact retrieval so publishing can pull from a specified workflow run when needed.

…path

The corpus/otel-demo-v7 publish failed after its 5-hour capture succeeded:
`gh release create` → "fatal: not a git repository". The publish job has no
checkout (deliberate — #251 split it off so the write token never coexists
with the third-party demo images), so `gh` cannot resolve the repository from
a git remote. v6 predates that split (2026-06-10 vs #251 on 2026-06-19); v7
was the first publish attempt since, hitting the latent gap. Fix: set
`GH_REPO: ${{ github.repository }}` on the publish step.

Also add the recovery path so the successful capture is not wasted: a new
`artifact_run_id` dispatch input skips the capture job and publishes from the
`otel-demo-corpus` artifact of the named earlier run (cross-run
download-artifact with the token; retained until 2026-09-30 for v7's run).
The release notes now record the capture run id, and the input docs require
passing the original capture's parameters so the notes stay truthful.

Verified: YAML parses; actionlint clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jensholdgaard
jensholdgaard requested a review from Copilot July 2, 2026 22:19
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds an artifact_run_id workflow_dispatch input to the capture-otel-demo-corpus workflow, enabling a recovery/publish-only path. Capture is skipped when this input is set; publish runs on success or on recovery, downloads artifacts from the specified run, and derives release notes' source commit from that run's SHA.

Changes

Workflow recovery/publish path

Layer / File(s) Summary
Recovery input and job gating
.github/workflows/capture-otel-demo-corpus.yml
Adds artifact_run_id workflow_dispatch input, skips capture job when set, and broadens publish job condition to allow running on recovery (capture skipped + artifact_run_id provided).
Artifact download and release note provenance
.github/workflows/capture-otel-demo-corpus.yml
Downloads the otel-demo-corpus artifact from a specified run (run-id) with github-token for cross-run access, and computes capture_sha via the GitHub API for release notes instead of always using the publishing run's SHA.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Workflow as GitHub Actions Workflow
  participant GhApi as GitHub Actions API
  participant Release as GitHub Release

  User->>Workflow: dispatch with artifact_run_id set
  Workflow->>Workflow: skip capture job
  Workflow->>Workflow: download otel-demo-corpus artifact from artifact_run_id
  Workflow->>GhApi: query head SHA of captured run
  GhApi-->>Workflow: capture_sha
  Workflow->>Release: publish release with notes referencing capture_sha
Loading

Possibly related PRs

  • jensholdgaard/ourios#73: Introduces the base capture-otel-demo-corpus.yml workflow logic that this PR extends with recovery/publish-only support.
  • jensholdgaard/ourios#79: Modifies the same release/publish logic and source-commit provenance in capture-otel-demo-corpus.yml.
  • jensholdgaard/ourios#172: Modifies the same release publication/notes/provenance section of capture-otel-demo-corpus.yml.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: release publishing fix plus a publish-only recovery path.
Description check ✅ Passed The description is detailed and covers the fix, recovery path, and verification, but the template's Related and Checklist sections are missing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch corpus-publish-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes GitHub release publishing for the capture-otel-demo-corpus workflow’s split publish job (which intentionally has no checkout) by explicitly setting GH_REPO, and adds a publish-only recovery path that can re-mint a release from an earlier successful capture artifact via a workflow-dispatch artifact_run_id.

Changes:

  • Add artifact_run_id workflow-dispatch input to support a publish-only recovery path that downloads otel-demo-corpus from a prior run.
  • Adjust job gating so publish can run when capture is skipped (recovery), while still requiring a successful capture or explicit recovery input.
  • Provide GH_REPO to the gh release step and include capture run id in release notes for better provenance.
Comments suppressed due to low confidence (1)

.github/workflows/capture-otel-demo-corpus.yml:366

  • actions/download-artifact is now configured for cross-run downloads (run-id + github-token). With explicit job permissions, the token needs actions: read to access artifacts from other runs; otherwise the recovery path can fail with authorization errors.
    permissions:
      contents: write
      # Sigstore-sign the corpus attestation (keyless OIDC) and store it.
      attestations: write
      id-token: write

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/capture-otel-demo-corpus.yml Outdated
Comment thread .github/workflows/capture-otel-demo-corpus.yml Outdated
Copilot's review of #336, both accepted:

- The artifact_run_id input doc named a non-existent `duration` input;
  corrected to `duration_seconds`.
- On the recovery path, `source commit` recorded the publish dispatch's
  GITHUB_SHA instead of the commit the capture ran at; the publish step now
  resolves the capture run's head_sha via the Actions API when
  CAPTURE_RUN_ID differs from the current run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

.github/workflows/capture-otel-demo-corpus.yml:367

  • The publish job now calls the Actions API (gh api …/actions/runs/...) and can download artifacts from another workflow run (download-artifact with run-id). With the current job-level permissions block, the token may not have actions: read, causing the recovery path to fail with permission errors (e.g., "Resource not accessible by integration"). Add actions: read to the publish job permissions.
    permissions:
      contents: write
      # Sigstore-sign the corpus attestation (keyless OIDC) and store it.
      attestations: write
      id-token: write

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/capture-otel-demo-corpus.yml (1)

362-367: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Add actions: read to the publish job
The recovery path uses cross-run download-artifact and gh api .../actions/runs/...; both need actions: read, so artifact_run_id dispatches will 403 until this permission is added.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/capture-otel-demo-corpus.yml around lines 362 - 367, The
publish job is missing the Actions read permission needed by its recovery flow.
Update the publish job permissions alongside the existing
contents/attestations/id-token entries so that the job also has actions: read,
which allows the download-artifact and gh api calls in the artifact_run_id
dispatch path to succeed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In @.github/workflows/capture-otel-demo-corpus.yml:
- Around line 362-367: The publish job is missing the Actions read permission
needed by its recovery flow. Update the publish job permissions alongside the
existing contents/attestations/id-token entries so that the job also has
actions: read, which allows the download-artifact and gh api calls in the
artifact_run_id dispatch path to succeed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3f76cd05-45f0-42eb-a217-6df8b0d2c234

📥 Commits

Reviewing files that changed from the base of the PR and between f4da8e5 and 95416ef.

📒 Files selected for processing (1)
  • .github/workflows/capture-otel-demo-corpus.yml

@jensholdgaard
jensholdgaard merged commit c8e2ea2 into main Jul 2, 2026
22 checks passed
@jensholdgaard
jensholdgaard deleted the corpus-publish-fix branch July 2, 2026 22:31
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