Skip to content

ci(nightly): allow forcing a build of the release branch tip - #14015

Merged
levivannoort merged 1 commit into
mainfrom
ci/nightly-force
Sep 30, 2026
Merged

levivannoort merged 1 commit into
mainfrom
ci/nightly-force

Conversation

@levivannoort

Copy link
Copy Markdown
Member

What does this PR do?

The nightly job only builds the newest commit on the active release branch that has a green CI push run. 2.0.x has no green push run yet, so every nightly fails at Resolve the build with No green CI run on 2.0.x.

This adds a force boolean input to workflow_dispatch. A manual run with force=true builds the tip of the release branch and skips the CI check, and the run logs a warning naming the commit it built. The scheduled run still waits for a green commit, as before.

gh workflow run nightly.yml -R appwrite/appwrite -f force=true

Why 2.0.x is red

From the CI run on #13936:

Those still need a backport to 2.0.x. Until then, this lets the channel publish.

Test Plan

  • actionlint .github/workflows/nightly.yml passes.
  • After merge, a manual run with force=true should resolve 2.0.x at ce4553b270 and publish 2.0-nightly.<date>.

The nightly only builds the newest commit with a green CI push run, so a
red release branch blocks the channel entirely. A manual dispatch can now
pass force=true to build the branch tip without the CI check. The
scheduled run keeps the green-only gate.
@levivannoort levivannoort self-assigned this Sep 30, 2026
@ghost

ghost commented Sep 30, 2026

Copy link
Copy Markdown

🔵 Tier A · Mergeable after minor fixes

The forced lookup needs an empty-result guard to prevent publishing the wrong ref if the branch disappears during resolution.

Adds a boolean force input for manual nightly runs. Forced runs resolve and build the active release branch tip with a warning, while scheduled and ordinary manual runs retain the CI-green selection path.

Verdict New comments Fixed Still open
✅ Approved 1 0 0
Finding Where
🟡 Reject an empty SHA before publishing a forced build .github/workflows/nightly.yml:53
Fix with agent prompt
### Issue 1
.github/workflows/nightly.yml:53
**Reject an empty SHA before publishing a forced build**

If the release branch is deleted or renamed between the two remote lookups, `git ls-remote` succeeds with no output. An empty `SHA` makes `actions/checkout` fall back to the workflow's triggering ref, so this can publish main (or the manually selected ref) under the release branch's nightly tags; please fail when the forced lookup returns no commit.

```suggestion
            sha=$(git ls-remote "$REMOTE" "refs/heads/${branch}" | cut -f1)
            [ -n "$sha" ] || { echo "::error::No tip found on ${branch}."; exit 1; }
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
📂 Walkthrough · 1
File Change
.github/workflows/nightly.yml Adds the manual override input and conditional release-tip resolution.

Reviewed d93d5f9 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost 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.

🔵 Tier A · Looks good to merge. Summary

if [ "$FORCE" = "true" ]; then
# Manual override for when the branch is red and the channel still
# needs a build. Ships the tip as-is.
sha=$(git ls-remote "$REMOTE" "refs/heads/${branch}" | cut -f1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reject an empty SHA before publishing a forced build

If the release branch is deleted or renamed between the two remote lookups, git ls-remote succeeds with no output. An empty SHA makes actions/checkout fall back to the workflow's triggering ref, so this can publish main (or the manually selected ref) under the release branch's nightly tags; please fail when the forced lookup returns no commit.

Suggested change
sha=$(git ls-remote "$REMOTE" "refs/heads/${branch}" | cut -f1)
sha=$(git ls-remote "$REMOTE" "refs/heads/${branch}" | cut -f1)
[ -n "$sha" ] || { echo "::error::No tip found on ${branch}."; exit 1; }
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/nightly.yml
Line: 53

Comment:
**Reject an empty SHA before publishing a forced build**

If the release branch is deleted or renamed between the two remote lookups, `git ls-remote` succeeds with no output. An empty `SHA` makes `actions/checkout` fall back to the workflow's triggering ref, so this can publish main (or the manually selected ref) under the release branch's nightly tags; please fail when the forced lookup returns no commit.

```suggestion
            sha=$(git ls-remote "$REMOTE" "refs/heads/${branch}" | cut -f1)
            [ -n "$sha" ] || { echo "::error::No tip found on ${branch}."; exit 1; }
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · error-handling · Reply if this doesn't apply.

@levivannoort
levivannoort merged commit f948f8c into main Sep 30, 2026
9 checks passed
@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[High risk] Nightly build workflow can skip CI checks on release branch.

The PR should not merge until the forced path rejects an empty tip SHA.

Fix All in Claude CodeFindings

  1. P1 Empty tip publishes wrong commit ▶
Fix with agent prompt
### Issue 1
.github/workflows/nightly.yml:53
If the release branch is removed between branch discovery and this lookup, `git ls-remote` returns no SHA without failing. The forced path does not reject the empty value, so checkout falls back to the workflow ref and can publish that commit under the release branch's nightly tags. Reject an empty SHA before checkout.

```suggestion
            sha=$(git ls-remote "$REMOTE" "refs/heads/${branch}" | cut -f1)
            [ -n "$sha" ] || { echo "::error::No tip found for ${branch}."; exit 1; }
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds a manual force input so the nightly workflow can build the active release branch tip without requiring a successful CI push run; scheduled runs retain the existing gate.

  • The forced tip lookup needs the same non-empty SHA protection as the normal path before publication.

Reviews (1) · Last reviewed commit: "ci(nightly): allow forcing a build of th..."

if [ "$FORCE" = "true" ]; then
# Manual override for when the branch is red and the channel still
# needs a build. Ships the tip as-is.
sha=$(git ls-remote "$REMOTE" "refs/heads/${branch}" | cut -f1)

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.

P1 Empty tip publishes wrong commit If the release branch is removed between branch discovery and this lookup, git ls-remote returns no SHA without failing. The forced path does not reject the empty value, so checkout falls back to the workflow ref and can publish that commit under the release branch's nightly tags. Reject an empty SHA before checkout.

Suggested change
sha=$(git ls-remote "$REMOTE" "refs/heads/${branch}" | cut -f1)
sha=$(git ls-remote "$REMOTE" "refs/heads/${branch}" | cut -f1)
[ -n "$sha" ] || { echo "::error::No tip found for ${branch}."; exit 1; }
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/nightly.yml
Line: 53

Comment:
**Empty tip publishes wrong commit** If the release branch is removed between branch discovery and this lookup, `git ls-remote` returns no SHA without failing. The forced path does not reject the empty value, so checkout falls back to the workflow ref and can publish that commit under the release branch's nightly tags. Reject an empty SHA before checkout.

```suggestion
            sha=$(git ls-remote "$REMOTE" "refs/heads/${branch}" | cut -f1)
            [ -n "$sha" ] || { echo "::error::No tip found for ${branch}."; exit 1; }
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code Fix in Codex

@github-actions

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → ci/nightly-force (after).

Metric Before After Change
🚀 Requests/sec 206.26 211.33 ⚪ +2.5%
⏱️ Latency P50 83.4 ms 81.77 ms ⚪ -2%
⏱️ Latency P95 191.13 ms 194.14 ms ⚪ +1.6%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 81.77 194.14 13,395 211.33 +3.02
Account 155.53 281.14 705 11.74 -0.54
TablesDB 76.81 142.16 7,285 118.25 -4.74
Storage 79.39 172.99 3,525 58.53 -6.57
Functions 116.56 245.88 1,880 31.95 +12.9

Top API waits (after)

API request Max wait (ms)
account.prefs.update 420.46
account.name.update 416.1
functions.create 396.61
tablesdb.rows.increment 381.32
storage.files.create 378.32

abnegate added a commit that referenced this pull request Sep 30, 2026
Brings in main's OAuth2 state and nonce validation (#14012), which cloud
needs, along with the realtime origin alignment (#14020), subscriber
target ownership (#14019), GitLab primary email (#14010), impersonation
MFA (#14017), write-only webhook passwords (#14016), chunked-upload
resume ownership (#14014), preview authorize validation (#14013),
nightly forcing (#14015) and scheduled-function enqueue checks (#14011).

The merge had no textual conflicts, and main left composer.json and
composer.lock unchanged. So the lock keeps the branch's database and
async pins.

Main's assertResumeAllowed() in Storage Buckets/Files/Create checks
Input(Database::PERMISSION_UPDATE, ...). utopia-php/database 8 has no
PERMISSION_* constants, so every chunked resume would fail with an
undefined-constant error. It now passes PermissionType::Update, as the
rest of that action already does.

Co-Authored-By: Claude Opus 5.5 <[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