Skip to content

fix(ci): seed the adhoc release repo so releases can be tagged - #12375

Merged
nwparker merged 1 commit into
mainfrom
nwparker/adhoc-repo-seed
Aug 4, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/adhoc-repo-seed

Conversation

@nwparker

@nwparker nwparker commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

What

config/scripts/setup-adhoc-release-repo.sh created stablyai/orca-adhoc with gh repo create and no initial commit. Adds --add-readme, plus a precheck that fails immediately if the repo has no commits.

Why

Publishing a GitHub release creates a git tag, and a tag needs a commit to point at. An empty repo accepts the draft — drafts carry no tag — so the adhoc pipeline built, signed, notarized, uploaded all nine artifacts, verified the update manifest, and only then failed:

HTTP 422: Validation Failed (repos/stablyai/orca-adhoc/releases/363749390)
Repository is empty.

~25 minutes in, after the notary round trip. The draft-discard step cleaned up correctly, so nothing was stranded, but the whole run was wasted.

The live repo has since been seeded by hand (ff9ca5b), so this is about the next time someone runs the setup script — a re-provision, or a fourth channel modelled on this one. The precheck exists because a repo created before this change is still empty and the failure only surfaces at the very end.

Verification

  • bash -n clean.
  • The adhoc pipeline now completes end to end: run 30742467603, all steps green, v1.4.164-adhoc.20260802094839 published with both architectures and latest-mac.yml.

Made with Orca 🐋

gh repo create leaves the repo empty, and publishing a release creates a
git tag that needs a commit to point at. The adhoc build got all the way
through notarization and upload before failing on "Repository is empty".

Co-authored-by: Orca <[email protected]>
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The setup script now creates new adhoc release repositories with a README commit. It checks both new and existing repositories for at least one commit. It stops with an actionable error when a repository is empty.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change, cause, impact, and verification, but omits the required template sections for screenshots, testing checklist, AI review, security audit, and notes. Use the repository template headings and add the missing screenshots statement, testing results, AI review report, security audit, and platform-specific notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states that the change seeds the adhoc release repository so CI can create release tags.
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 docstrings
  • Create stacked PR
  • Commit on current branch

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.

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2c7bfccf-2806-4825-8c98-780d0981ae37

📥 Commits

Reviewing files that changed from the base of the PR and between 0586bab and 7d0e6ea.

📒 Files selected for processing (1)
  • config/scripts/setup-adhoc-release-repo.sh

Comment on lines +54 to +57
# Also checked outside the create branch: a repo made before --add-readme is here.
if ! gh api "repos/$ADHOC_REPO/commits" --jq 'length' >/dev/null 2>&1; then
fail "$ADHOC_REPO has no commits — releases cannot be tagged. Add any file to it first."
fi

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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

: "${ADHOC_REPO:?Set ADHOC_REPO to OWNER/REPO}"

for attempt in 1 2 3 4 5; do
  set +e
  response="$(gh api "repos/$ADHOC_REPO/commits?per_page=1" \
    --include \
    --jq 'length' 2>&1)"
  exit_code=$?
  set -e

  printf 'attempt=%s exit=%s\n%s\n' "$attempt" "$exit_code" "$response"

  if [ "$exit_code" -eq 0 ]; then
    exit 0
  fi

  sleep "$attempt"
done

exit 1

Repository: stablyai/orca

Length of output: 206


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "Locate file:"
git ls-files 'config/scripts/setup-adhoc-release-repo.sh' || true

if [ -f config/scripts/setup-adhoc-release-repo.sh ]; then
  echo "Relevant lines:"
  sed -n '45,65p' config/scripts/setup-adhoc-release-repo.sh | cat -n

  echo "All gh api exits:"
  rg -n "gh api|fail \\(" config/scripts/setup-adhoc-release-repo.sh
fi

echo "Check gh availability/version:"
if command -v gh >/dev/null 2>&1; then
  gh --version | sed -n '1,5p'
else
  echo "gh not installed"
fi

Repository: stablyai/orca

Length of output: 1732


🌐 Web query:

GitHub REST API list commits empty repository 409 Conflict

💡 Result:

When you attempt to list commits using the GitHub REST API (GET /repos/{owner}/{repo}/commits) on an empty repository, the API returns a 409 Conflict status code with the error message "Git Repository is empty." [1][2][3]. This behavior occurs because the repository lacks the necessary Git data (such as a commit history) required to return a list of commits [2]. The 409 Conflict status is the standard response from the GitHub API when interacting with repository content in a state that does not support the requested operation, such as an empty or uninitialized repository [2]. To resolve this and begin managing the repository via the API, you must first initialize the repository by adding content. You can do this by using the "Create or update file contents" endpoint (PUT /repos/{owner}/{repo}/contents/{path}) to commit an initial file to the repository [2][4]. Once the repository has at least one commit, subsequent requests to the list commits endpoint will return a 200 OK status with the commit history.

Citations:


Use status-aware availability retries for the API check.

This non-zero gh api condition reports every API failure as an empty repository. Authentication, permission, rate-limit, network, and transient 409 failures receive the same error message. Capture the response/status, use bounded retries for repository availability, and keep a separate error path for API failures.

@nwparker
nwparker merged commit c9c1683 into main Aug 4, 2026
43 checks passed
@nwparker
nwparker deleted the nwparker/adhoc-repo-seed branch August 4, 2026 01:02
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…yai#12375)

gh repo create leaves the repo empty, and publishing a release creates a
git tag that needs a commit to point at. The adhoc build got all the way
through notarization and upload before failing on "Repository is empty".

Co-authored-by: Orca <[email protected]>
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.

1 participant