Skip to content

fix(jobs): reconcile missing build output callbacks - #14914

Merged
ChiragAgg5k merged 2 commits into
appwrite:mainfrom
ChiragAgg5k:fix/jobs-output-reconciliation
Oct 26, 2026
Merged

ChiragAgg5k merged 2 commits into
appwrite:mainfrom
ChiragAgg5k:fix/jobs-output-reconciliation

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

A deployment can stay building after its job completes because the output-upload callback never arrived. Check the actual build artifact instead of waiting forever for that callback.

BEFORE
job complete -> output callback missing -> stuck building

AFTER
job complete -> output callback missing -> check storage (up to 10s)
                                            |
                         +------------------+------------------+
                         |                  |                  |
                    artifact found     still missing      storage error
                         |                  |                  |
                    normal checks     fail with a         retry completion
                         |            clear message         callback
                       ready

The wait happens outside the deployment lock so other callbacks can still arrive. Completion is marked processed only after handling succeeds. Existing artifact checks and canceled/terminal deployment guards still apply.

This handles future completion callbacks; it does not backfill deployments that are already stuck or fix the underlying sidecar upload failure.

Test Plan

  • 45 deployment unit tests passed, including existing, delayed, missing, and symlink output plus storage errors.
  • Confirmed the delayed-output regression fails when polling is removed, then passes with the fix restored.
  • Targeted PHPStan, Pint, Rector, and git diff --check passed.
  • Unit and worker/API E2E suites run in CI.

Related: appwrite-labs/cloud#6673

@ChiragAgg5k ChiragAgg5k self-assigned this Oct 24, 2026
@ChiragAgg5k
ChiragAgg5k marked this pull request as ready for review October 24, 2026 13:24
@ghost

ghost commented Oct 24, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

No actionable defects found in the changed behavior.

Adds a bounded storage poll for remote build output when a completion callback arrives before its output marker. Successful reconciliation records the output marker and completion events are deduplicated after handling; the new deployment helper is covered with storage polling tests.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 3
File Change
src/Appwrite/Deployment/Output.php Adds a bounded artifact-existence poll that propagates storage errors.
src/Appwrite/Platform/Modules/Functions/Workers/Jobs.php Reconciles missing remote output on completion and records completion events after processing.
tests/unit/Deployment/OutputTest.php Covers immediate, delayed, missing, symlinked, and storage-error output checks.

Reviewed 205be3c · 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 S · Looks good to merge. Summary

@ChiragAgg5k
ChiragAgg5k merged commit b26974e into appwrite:main Oct 26, 2026
67 checks passed
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