fix: redeploy full build when a deploy is in error state - #55
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds logic to trigger a full redeploy (instead of a selective one) when any active deploy for a build is in a failed/error state, ensuring services without repository mappings are rebuilt after failures.
- Adds failed deploy detection (ERROR, BUILD_FAILED, DEPLOY_FAILED) before enqueueing build resolution.
- Omits githubRepositoryId from the queue payload to force full redeploy when failures exist.
- Introduces comprehensive tests covering both selective and full redeploy scenarios and edge cases (multiple builds, PR state, deployOnUpdate flag).
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/server/services/github.ts | Adds conditional logic querying failed deploys and adjusts queue payload accordingly. |
| src/server/services/tests/github.test.ts | New tests validating redeploy branching logic across scenarios. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
vigneshrajsb
commented
Oct 15, 2025
| const failedDeploys = await models.Deploy.query() | ||
| .where('buildId', buildId) | ||
| .where('active', true) | ||
| .whereIn('status', [DeployStatus.ERROR, DeployStatus.BUILD_FAILED, DeployStatus.DEPLOY_FAILED]); |
Contributor
Author
There was a problem hiding this comment.
if we add new status that mean error, should be added here. maybe we could refactor how we define and maintain status later
vmelikyan
approved these changes
Oct 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes #9
With selective deploy, when app receives a commit push, we only deploy the services that are configured in the repo with the commit.
if we have docker, aurora-restore types that are not mapped with
githubRepositoryIdindeploystable, we wont rebuild these services on a push.So we add a conditional check to see if any of the active
deployshave an error status before we add thebuildto build queue to either redeploy the full build if there are errored deploys to avoid the gap in workflow