Skip to content

[pr-staging-deploy]: fix race on fast merge, simplify comments, add build error watcher#422

Merged
rorychatt merged 1 commit intomainfrom
feat/staging-bot-reliable-comments
Apr 5, 2026
Merged

[pr-staging-deploy]: fix race on fast merge, simplify comments, add build error watcher#422
rorychatt merged 1 commit intomainfrom
feat/staging-bot-reliable-comments

Conversation

@ArtemLazarchuk
Copy link
Copy Markdown
Collaborator

Summary

  • Race condition fix — before creating Sliplane services, check GitHub API
    that the PR is still open. If it was already merged or closed (fast merge),
    the deploy is skipped silently — no more Branch does not exist /
    Internal server error from Sliplane.
    A short delay (Staging:PreDeployDelayMs, default 1200 ms) is added after
    tearing down old services so a concurrent closed webhook can win the race.

  • Simplified PR comments — removed the old background polling queue that
    blocked all PRs in a single-reader channel (up to 30 min per PR).
    Now: links are posted immediately after service creation; only if the
    Sliplane build later fails is the comment replaced with an error.

  • StagingErrorWatcherBackgroundService — lightweight replacement.
    Runs concurrently per PR (no head-of-line blocking), polls Sliplane events
    every 5 s for up to 20 min, updates the comment only on build failure.

  • Removed PrStagingDeployCommentUpdateQueue,
    PrStagingDeployCommentUpdateBackgroundService,
    SliplaneDeploymentStatusResolver (no longer needed).

Comment format

Case Comment
Deploy OK ### Staging preview + Docs/Samples links
Build failed (async) ### Staging deploy failed + error from Sliplane
PR closed ### Staging removed

…us reporting. Replace PrStagingDeployCommentUpdateQueue and related background service with StagingErrorWatcherQueue and StagingErrorWatcherBackgroundService for improved monitoring of deployment failures. Update GitHubApiClient to fetch pull request merge info, ensuring accurate deployment state checks. Modify PrStagingDeployCommentService to streamline comment updates and error reporting. (#422)
@ArtemLazarchuk ArtemLazarchuk requested a review from rorychatt April 4, 2026 19:53
@ArtemLazarchuk ArtemLazarchuk self-assigned this Apr 4, 2026
@rorychatt rorychatt merged commit 685c7e6 into main Apr 5, 2026
99 checks passed
@rorychatt rorychatt deleted the feat/staging-bot-reliable-comments branch April 5, 2026 16:02
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