Skip to content

fix: redeploy full build when a deploy is in error state - #55

Merged
vigneshrajsb merged 1 commit into
mainfrom
deploy-all-on-error
Oct 16, 2025
Merged

fix: redeploy full build when a deploy is in error state#55
vigneshrajsb merged 1 commit into
mainfrom
deploy-all-on-error

Conversation

@vigneshrajsb

Copy link
Copy Markdown
Contributor

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 githubRepositoryId in deploys table, we wont rebuild these services on a push.

So we add a conditional check to see if any of the active deploys have an error status before we add the build to build queue to either redeploy the full build if there are errored deploys to avoid the gap in workflow

@vigneshrajsb
vigneshrajsb requested a review from a team as a code owner October 15, 2025 17:11
@vigneshrajsb
vigneshrajsb requested a review from Copilot October 15, 2025 17:12

Copilot AI left a comment

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.

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.

const failedDeploys = await models.Deploy.query()
.where('buildId', buildId)
.where('active', true)
.whereIn('status', [DeployStatus.ERROR, DeployStatus.BUILD_FAILED, DeployStatus.DEPLOY_FAILED]);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

if we add new status that mean error, should be added here. maybe we could refactor how we define and maintain status later

@vigneshrajsb
vigneshrajsb merged commit 847f581 into main Oct 16, 2025
1 check 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.

Docker services don't deploy if initial deploy has a build failure

3 participants