Skip to content

Added error check for canary promote actions #432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

benjaminbob21
Copy link
Contributor

@benjaminbob21 benjaminbob21 commented Jul 8, 2025

This PR ensures that any failed Kubernetes apply operations in canary and blue-green workflows properly abort execution by invoking checkForErrors and includes tests to ensure this works. It also adds a new test manifest and updates related tests to include it.

@benjaminbob21 benjaminbob21 self-assigned this Jul 8, 2025
@benjaminbob21 benjaminbob21 added the bug Something isn't working label Jul 8, 2025
@benjaminbob21 benjaminbob21 marked this pull request as ready for review July 8, 2025 15:36
Copilot

This comment was marked as outdated.

@bosesuneha
Copy link
Member

@benjaminbob21
Copy link
Contributor Author

benjaminbob21 commented Jul 8, 2025

Just to note here, I reverted back to the commit that had some integration errors. The issue is at the https://github.com/Azure/k8s-deploy/pull/432/files#diff-bb3e08b6d71c82cd46d12233b7c37fdb13932d2e9d774bb80eb3b3e646520ca4R281, an empty manifestFiles was being passed. This was not handled well and wasn't detected till the checkForErrors was introduced. PR #425 contains this fix and should be merged before this. This should fix the error. Thank you.

Copilot

This comment was marked as outdated.

@Tatsinnit Tatsinnit requested a review from Copilot July 11, 2025 18:27
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds error checking after Kubernetes apply commands in both canary and blue-green workflows and updates related tests and manifests accordingly.

  • Introduces a new basic-test.yml manifest and adjusts file search tests to include it.
  • Inserts checkForErrors calls after kubectl.apply in SMICanary, PodCanary, and BlueGreen helpers.
  • Enhances tests with shared mock objects and consolidated error scenarios across multiple strategy helpers.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/unit/manifests/basic-test.yml New basic manifest used in unit tests
src/utilities/fileUtils.test.ts Updated expected file list and lengths to include basic-test.yml
src/strategyHelpers/canary/smiCanaryHelper.ts Added checkForErrors after kubectl.apply
src/strategyHelpers/canary/podCanaryHelper.ts Added import and call to checkForErrors after apply
src/strategyHelpers/blueGreen/blueGreenHelper.ts Added checkForErrors after kubectl.apply in deployObjects
Multiple *.test.ts files across canary and blueGreen dirs Refactored tests for shared mocks and added consolidated error checks

Copy link
Member

@Tatsinnit Tatsinnit left a comment

Choose a reason for hiding this comment

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

❤️ Thanks for kind ping for the review of this PR, I've had another Quick Look, and shared some of my observations. Please get review from @bosesuneha and @davidgamero for better e2e understanding.

@benjaminbob21 benjaminbob21 requested a review from bosesuneha July 14, 2025 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants