ci(docs): skip releases without docs source - #17656
Conversation
Greptile SummaryThe PR adds a release gate that checks the resolved tag commit for the docs package before requesting the protected production environment.
Confidence Score: 4/5This PR should not merge until the source probe distinguishes a confirmed missing package from GitHub API failures that should fail the gate. A repeated API error on a valid release is converted into a successful deploy=false result, silently preventing the production docs deployment. Files Needing Attention: .github/workflows/docs.yml
|
| Filename | Overview |
|---|---|
| .github/workflows/docs.yml | Adds the historical-release docs-source gate, but suppresses legitimate deployments when the contents API fails for reasons other than a missing file. |
Sequence Diagram
sequenceDiagram
participant R as Release gate
participant G as GitHub Contents API
participant P as Production docs job
R->>G: Check package.json at resolved commit
alt Request succeeds
G-->>R: File exists
R->>P: "deploy=true when other checks pass"
else Any error after retries
G-->>R: 404, 403, 5xx, or network failure
R->>R: "deploy=false and exit successfully"
R--xP: Production job skipped
end
Reviews (1): Last reviewed commit: "ci(docs): skip releases without docs sou..." | Re-trigger Greptile
| # requesting the protected production environment. | ||
| docs_source_available=false | ||
| for attempt in 1 2 3; do | ||
| if gh api "repos/$GITHUB_REPOSITORY/contents/docs/site/package.json?ref=$commit_sha" >/dev/null 2>&1; then |
There was a problem hiding this comment.
API failures suppress deployment
When the GitHub contents API returns repeated rate-limit, authorization, service, or network errors for a valid release, this check treats them as proof that the docs source is absent and exits successfully with deploy=false, causing the production docs deployment to be silently skipped.
📝 WalkthroughWalkthroughThe documentation release gate checks whether the resolved release commit contains Merge Risk: 🔵 Low · up to The release workflow now skips deployment when the docs source is absent, but other API failures may also be treated as missing source and cause a valid release deployment to be skipped. The change is mergeable with explicit owner follow-up to distinguish missing files from other errors. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description explains the workflow change and includes testing commands, but it omits most required template sections, including ELI5, What Changed, Why, Linked Issue, Visual Proof, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. Resolution Update the description to use the required headings. Add an issue link after "Fixes #", provide the required visual proof or state "N/A" with a reason, complete the testing checkboxes, address AI disclosure and review details, complete the Agent skill upstream boundary section, add Notes for security and compatibility impact, and complete the Checklist. Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: bdd993ea-ec7f-4f6d-a863-327dcdc34308
📒 Files selected for processing (1)
.github/workflows/docs.yml
Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review.
| # requesting the protected production environment. | ||
| docs_source_available=false | ||
| for attempt in 1 2 3; do | ||
| if gh api "repos/$GITHUB_REPOSITORY/contents/docs/site/package.json?ref=$commit_sha" >/dev/null 2>&1; then |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
printf '%s\n' '--- repository conventions ---'
for f in /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/*/*.md; do
[ -f "$f" ] && { printf '\n### %s\n' "$f"; head -80 "$f"; }
done
printf '%s\n' '--- workflow files ---'
git ls-files .github/workflows/docs.yml
printf '%s\n' '--- relevant workflow section ---'
sed -n '145,215p' .github/workflows/docs.ymlRepository: stablyai/orca
Length of output: 49672
🏁 Script executed:
printf '%s\n' '--- gh api contract ---'
if command -v gh >/dev/null 2>&1; then
gh help api 2>&1 | sed -n '1,180p'
else
printf '%s\n' 'gh executable unavailable'
fi
printf '%s\n' '--- workflow shell context ---'
sed -n '1,35p' .github/workflows/docs.ymlRepository: stablyai/orca
Length of output: 9073
🏁 Script executed:
if command -v gh >/dev/null 2>&1; then
gh help exit-codes 2>&1 | sed -n '1,160p'
else
printf '%s\n' 'gh executable unavailable'
fiRepository: stablyai/orca
Length of output: 662
Treat only a missing file as an absent docs source.
The gh api command returns a non-zero exit code for failures. After three failed attempts, this workflow treats every failure as a missing file and can silently skip valid deployments. Handle 404 as the skip condition and fail the gate for other errors.
There was a problem hiding this comment.
ℹ️ No critical issues — one minor robustness suggestion inline.
Reviewed changes
- Docs source guard —
release_gatenow checks the resolved immutable tag commit fordocs/site/package.json(3 attempts) and skips the protected production deployment when absent, so stable releases cut before the docs app existed no longer fail in the production job.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
| for attempt in 1 2 3; do | ||
| if gh api "repos/$GITHUB_REPOSITORY/contents/docs/site/package.json?ref=$commit_sha" >/dev/null 2>&1; then | ||
| docs_source_available=true | ||
| break | ||
| fi | ||
| [[ "$attempt" -eq 3 ]] || sleep "$((attempt * 5))" | ||
| done |
There was a problem hiding this comment.
The >/dev/null 2>&1 check conflates every gh api failure with "source absent": a 404 (correctly skip) is indistinguishable from a rate limit, network blip, or 5xx, which would silently skip a legitimate stable release's deployment after the retries exhaust. The sibling loops in this same step treat a final failure as ::error:: + exit 1 rather than a quiet skip. Consider only skipping on a definitive 404 (e.g. capture the API output and check for 404: Not Found / HTTP 404) so transient outages surface loudly instead of being misreported as "does not contain docs/site".

Summary
Guard the release-backed docs deployment against stable tags cut before
docs/siteexisted.The release gate now checks the resolved immutable tag commit for
docs/site/package.json(with retries) and skips deployment before requesting the protecteddocs-productionenvironment when the source is absent. This keeps old releases such asv1.4.193from entering a production job that cannot build the docs app.Testing
actionlint .github/workflows/docs.ymlgit diff --check