Skip to content

chore: restart deployment after creating a develop image - #4528

Merged
maheshkutty merged 6 commits into
developfrom
feat.restart_deployment_dev
Jul 25, 2025
Merged

maheshkutty merged 6 commits into
developfrom
feat.restart_deployment_dev

Conversation

@maheshkutty

@maheshkutty maheshkutty commented Jul 24, 2025 •

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

This pull request introduces a new GitHub Action for restarting Kubernetes deployments and integrates it into the development deployment workflow. The main changes include the creation of the custom action and its usage in the workflow configuration.

New GitHub Action for Kubernetes Deployment Restart:

  • .github/actions/restart-deployment/action.yml: Added a custom composite GitHub Action named K8s Deployment Restart. This action allows for restarting deployments in specified Kubernetes namespaces, with support for multiple namespaces and deployments. It configures AWS credentials, updates the kubeconfig, and executes the kubectl rollout restart command for each deployment in the provided namespaces.

Workflow Integration:

  • .github/workflows/prepare-for-dev-deploy.yml: Added two new jobs (restart-k8s-deployment and restart-k8s-deployment-dedicated) to the workflow. These jobs use the new K8s Deployment Restart action to restart specific deployments in predefined namespaces as part of the development deployment process.

What is the related Linear task?

Resolves INT-3811

Please explain the objectives of your changes below

Put down any required details on the broader aspect of your changes. If there are any dependent changes, mandatorily mention them here

Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?

N/A

Any new dependencies introduced with this change?

N/A

Any new generic utility introduced or modified. Please explain the changes.

N/A

Any technical or performance related pointers to consider with the change?

N/A

@coderabbitai review


Developer checklist

  • My code follows the style guidelines of this project

  • No breaking changes are being introduced.

  • All related docs linked with the PR?

  • All changes manually tested?

  • Any documentation changes needed with this change?

  • Is the PR limited to 10 file changes?

  • Is the PR limited to one linear task?

  • Are relevant unit and component test-cases added in new readability format?

Reviewer checklist

  • Is the type of change in the PR title appropriate as per the changes?

  • Verified that there are no credentials or confidential data exposed with the changes.

@maheshkutty
maheshkutty requested a review from a team July 24, 2025 12:34
@coderabbitai

coderabbitai Bot commented Jul 24, 2025 •

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@maheshkutty has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 39 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 1b22842ebeb131325acd914ae62b963c8af3ea4a and 44edf6c.

📒 Files selected for processing (2)
  • .github/actions/restart-deployment/action.yml (1 hunks)
  • .github/workflows/prepare-for-dev-deploy.yml (1 hunks)

Summary by CodeRabbit

  • New Features
    • Introduced a new workflow step to automatically restart specified Kubernetes deployments across multiple namespaces as part of the CI/CD pipeline.
    • Added a custom GitHub Action to streamline deployment restarts in EKS clusters, supporting multiple namespaces and deployments with progress updates.

Walkthrough

A new composite GitHub Action for restarting Kubernetes deployments in EKS clusters was introduced, along with integration of this action into the CI/CD workflow. The workflow now includes a job that triggers a rollout restart for a specified deployment across multiple namespaces after building the transformer image.

Changes

File(s) Change Summary
.github/actions/restart-deployment/action.yml Added a new composite GitHub Action to perform rollout restarts of Kubernetes deployments in EKS.
.github/workflows/prepare-for-dev-deploy.yml Added a new job using the custom action to restart multiple Kubernetes deployments post-image build.

Sequence Diagram(s)

sequenceDiagram
    participant Workflow
    participant RestartAction
    participant AWS
    participant EKS
    participant K8s

    Workflow->>RestartAction: Trigger with inputs (role, region, cluster, namespaces, deployment)
    RestartAction->>AWS: Assume IAM role & configure credentials
    RestartAction->>EKS: Update kubeconfig for cluster/region
    loop For each namespace
        RestartAction->>K8s: kubectl rollout restart deployment (by label)
        RestartAction->>K8s: kubectl rollout status deployment
    end
    RestartAction-->>Workflow: Output completion message
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes


Suggestions for Improvement:

  • Consider parameterizing the deployment label key in the action for broader compatibility beyond app.kubernetes.io/name.
  • Add error handling or rollback logic to gracefully handle failures during rollout restarts in any namespace.
  • Include usage examples and detailed documentation in the action metadata for easier adoption.
  • Optionally, provide a dry-run mode to allow safe testing of the restart process in CI environments without applying changes.

Suggested reviewers

  • sivashanmukh
  • vinayteki95
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat.restart_deployment_dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (3)
.github/actions/restart-deployment/action.yml (2)

24-26: Remove the checkout step to shave ~5-10 s off runtime

The action never reads the repository contents, so actions/checkout@v4 can be safely dropped.
Less I/O, faster workflows.


50-58: Eliminate trailing whitespace to appease YAMLlint

The blank lines at 52 & 57 contain stray spaces, tripping trailing-spaces warnings.

-          
+
.github/workflows/prepare-for-dev-deploy.yml (1)

88-102: Add missing newline at EOF

Keeps POSIX tools & linters quiet.

-          deployment-name: rudder-transformer
+          deployment-name: rudder-transformer
+
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 73262d8 and 88d199153c1f42ee0cb7661e8925f05cd2b0324b.

📒 Files selected for processing (2)
  • .github/actions/restart-deployment/action.yml (1 hunks)
  • .github/workflows/prepare-for-dev-deploy.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/prepare-for-dev-deploy.yml

[error] 102-102: no new line character at the end of file

(new-line-at-end-of-file)

.github/actions/restart-deployment/action.yml

[error] 52-52: trailing spaces

(trailing-spaces)


[error] 57-57: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
.github/workflows/prepare-for-dev-deploy.yml (1)

88-92: Verify that restart-k8s-deployment truly depends on all required image builds

needs: [generate-tag-names, build-transformer-image] omits build-user-transformer-image.
If the restarted deployment consumes the UT image too, the job might run before the image is available.

Please double-check the intended ordering.

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 0

♻️ Duplicate comments (1)
.github/actions/restart-deployment/action.yml (1)

40-42: Add set -euo pipefail for safer script execution
The run-block still starts without Bash strict mode, so silent failures or unset variables can slip through.

 run: |
+        # Fail fast on any error, undefined variable, or pipe failure
+        set -euo pipefail
         # Split comma-separated namespaces and restart deployment in each
🧹 Nitpick comments (2)
.github/actions/restart-deployment/action.yml (2)

51-56: Strip trailing whitespace to satisfy YAML lint

Two lines flagged (51, 56) contain superfluous spaces. Trimming them keeps the Action YAML-lint clean.

-          namespace=$(echo "$namespace" | xargs)␠
+          namespace=$(echo "$namespace" | xargs)
 …
-        fi␠
+        fi

24-24: Pin azure/setup-kubectl to a commit SHA

Using a floating version (v4) leaves you open to unexpected upstream changes. Pinning to a full SHA keeps the workflow reproducible and protects against supply-chain attacks.

Example:

-    - uses: azure/setup-kubectl@v4
+    - uses: azure/[email protected] # or pin to the latest commit SHA
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 88d199153c1f42ee0cb7661e8925f05cd2b0324b and 8eb54419f36f7214c94de2e8d916a36dd33d79ce.

📒 Files selected for processing (1)
  • .github/actions/restart-deployment/action.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/actions/restart-deployment/action.yml

[error] 51-51: trailing spaces

(trailing-spaces)


[error] 56-56: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Code Coverage
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: test_and_publish
  • GitHub Check: UT Tests
  • GitHub Check: Analyze (javascript-typescript)

@codecov

codecov Bot commented Jul 24, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.44%. Comparing base (5d4372a) to head (44edf6c).
Report is 4 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4528   +/-   ##
========================================
  Coverage    91.44%   91.44%           
========================================
  Files          639      639           
  Lines        33774    33774           
  Branches      7978     7985    +7     
========================================
  Hits         30885    30885           
+ Misses        2655     2627   -28     
- Partials       234      262   +28     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 0

♻️ Duplicate comments (1)
.github/actions/restart-deployment/action.yml (1)

39-44: Add set -euo pipefail for safer script execution
We flagged this earlier but it’s still missing. Without strict mode the loop may silently continue when a kubectl command fails, leaving the workflow green while the rollout actually broke.

-      run: |
-        # Split comma-separated namespaces and restart deployment in each
+      run: |
+        # Fail fast on any error, unset variable, or pipe failure
+        set -euo pipefail
+
+        # Split comma-separated namespaces and restart deployment in each
🧹 Nitpick comments (2)
.github/actions/restart-deployment/action.yml (1)

50-57: Strip trailing whitespace to keep YAML-lint happy
Lines 52 and 57 contain only spaces. They do nothing but trigger linter warnings.

-          
-
+          
+
.github/workflows/prepare-for-dev-deploy.yml (1)

101-102: Add a newline at EOF (YAML-lint warning)
YAML-lint flags a missing trailing newline. Cheap to fix and keeps the linter quiet.

-          deployment-name: rudder-transformer,source-transformer,delivery-transformer
+          deployment-name: rudder-transformer,source-transformer,delivery-transformer
+
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8eb54419f36f7214c94de2e8d916a36dd33d79ce and 36f398ca4a6c9f7fc41920c1b84c7164fdbd1a75.

📒 Files selected for processing (2)
  • .github/actions/restart-deployment/action.yml (1 hunks)
  • .github/workflows/prepare-for-dev-deploy.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/actions/restart-deployment/action.yml

[error] 52-52: trailing spaces

(trailing-spaces)


[error] 57-57: trailing spaces

(trailing-spaces)

.github/workflows/prepare-for-dev-deploy.yml

[error] 102-102: no new line character at the end of file

(new-line-at-end-of-file)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Code Coverage
  • GitHub Check: UT Tests
  • GitHub Check: test_and_publish
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
.github/workflows/prepare-for-dev-deploy.yml (1)

88-102: Verify job dependencies
restart-k8s-deployment depends on build-transformer-image but not on build-user-transformer-image. If the “UT” image is also required in the cluster, the restart might pick up a partially updated set of images. Please confirm the dependency matrix.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 0

🧹 Nitpick comments (2)
.github/workflows/prepare-for-dev-deploy.yml (2)

88-102: Consider adding build-user-transformer-image to the dependency list

The restart job currently has:

needs: [generate-tag-names, build-transformer-image]

If any of the restarted deployments rely on the user-transformer image built in build-user-transformer-image, they may pick up an outdated image. Add the job to needs (or justify omission) to guarantee all images are available before the rollout.


102-102: Add a trailing newline

YAML-lint flags the absence of a newline at EOF.
It’s a tiny nit, but keeping files POSIX-friendly avoids noise in future diffs.

 deployment-name: rudder-transformer,source-transformer,delivery-transformer
+
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 36f398ca4a6c9f7fc41920c1b84c7164fdbd1a75 and 1b22842ebeb131325acd914ae62b963c8af3ea4a.

📒 Files selected for processing (1)
  • .github/workflows/prepare-for-dev-deploy.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/prepare-for-dev-deploy.yml

[error] 102-102: no new line character at the end of file

(new-line-at-end-of-file)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Build Transformer Docker Image - PR / Get Changed files
  • GitHub Check: Build Transformer Docker Image - PR / Get SHA information
  • GitHub Check: Build User Transformer Docker Image - PR / Get Changed files
  • GitHub Check: Code Coverage
  • GitHub Check: test_and_publish
  • GitHub Check: UT Tests
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
.github/workflows/prepare-for-dev-deploy.yml (1)

88-102: Confirm the composite action supports comma-separated lists

k8s-namespace and deployment-name are provided as comma-separated strings.
Unless the underlying .github/actions/restart-deployment action explicitly splits on commas, this will be passed as a single literal value, causing only the first namespace/deployment to be restarted or the command to fail.

Please double-check the action’s action.yml implementation (or add a quick unit test) to ensure list handling is correct, or switch to newline/space-separated inputs if required.

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@maheshkutty
maheshkutty requested a review from krishna2020 July 25, 2025 04:49
@maheshkutty
maheshkutty force-pushed the feat.restart_deployment_dev branch from 491bcdb to 44edf6c Compare July 25, 2025 04:49
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@sonarqubecloud

Copy link
Copy Markdown

@maheshkutty
maheshkutty requested a review from koladilip July 25, 2025 07:23
@maheshkutty
maheshkutty merged commit 3384dd1 into develop Jul 25, 2025
@maheshkutty
maheshkutty deleted the feat.restart_deployment_dev branch July 25, 2025 07:41
koladilip added a commit that referenced this pull request Jul 31, 2025
* chore: ai generated docs for airship

* chore: migrate some streaming destination to new test format (#4435)

* chore: migrate some streaming destination to new test format

* chore: rebase to develop

* fix: type

* chore: review comments

* chore: ing-svc workflow takes latest go tests

* chore: restart deployment after creating a develop image (#4528)

* chore: restart deployment after creating a develop image

* fix: review comments

* fix: add dependencies for kubectl

* chore: review comments

* chore: review comments

* chore: add another job for dedicated deployment

* chore: update sku mappings for product viewed event (#4467)

* chore: update sku mappings for product viewed event, fix skipped tests

* chore: remove skip false

---------

Co-authored-by: Mahesh Kutty <[email protected]>

* chore: add checkout step for deployment restart action (#4532)

* chore: auto create ing-svc pr for go-tests

* chore: restructure workflows

* chore: workflow add permissions

* chore: address security and compatibility issues

* refactor: remove unused marketo bulk upload metrics (#4537)

- Remove 13 unused marketo_bulk_upload metrics that were defined but not collected
- These metrics were from old implementation and not actively used
- Reduces Prometheus cardinality and improves performance
- Keeps only actively used marketo metrics: fetch_token, lead_lookup, activity

Fixes INT-3978

* chore: use latest vars for pod restart (#4538)

* chore: gitworkflow version upgrades

* chore: scan push revert to old version

* chore: add lint rules to catch invalid or unresolved imports (#4531)

* feat: onboard postscript destination (#4438)

* feat: onboard postscript destination

* chore: add nwhandler tests

* chore: add comments, update tests, fix properties inconsistencies

* chore: address comments

* chore: add util tests

* feat: onboard postscript destination

* chore: add nwhandler tests

* chore: add comments, update tests, fix properties inconsistencies

* chore: address comments

* chore: add util tests

* chore: address comments

* fix: subscriber updation logic

* chore: add tests for code coverage

* chore: address comments

* chore: address comments, add docs

* chore: remove catch

---------

Co-authored-by: Mahesh Kutty <[email protected]>
Co-authored-by: Mahesh Kutty <[email protected]>

* chore(release): 1.106.0

---------

Co-authored-by: Vinay Teki <[email protected]>
Co-authored-by: Dilip Kola <[email protected]>
Co-authored-by: Manish Kumar <[email protected]>
Co-authored-by: Mahesh Kutty <[email protected]>
Co-authored-by: Yashasvi Bajpai <[email protected]>
Co-authored-by: Mahesh Kutty <[email protected]>
Co-authored-by: GitHub Actions <[email protected]>
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.

4 participants