Skip to content

Conversation

lucacavallaro
Copy link
Member

Closes CES-1274

Copy link

changeset-bot bot commented Oct 7, 2025

🦋 Changeset detected

Latest commit: 28de110

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
incremental-rollout Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov-commenter
Copy link

codecov-commenter commented Oct 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.12%. Comparing base (8abeb56) to head (28de110).
⚠️ Report is 90 commits behind head on main.

❌ Your project status has failed because the head coverage (44.12%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #975       +/-   ##
===========================================
- Coverage   67.85%   44.12%   -23.74%     
===========================================
  Files          31       40        +9     
  Lines         840     1609      +769     
  Branches      146      184       +38     
===========================================
+ Hits          570      710      +140     
- Misses        258      885      +627     
- Partials       12       14        +2     

see 7 files with indirect coverage changes

🚀 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.

@lucacavallaro lucacavallaro force-pushed the feats/unify-incremental-rollout-apis branch 2 times, most recently from 05aaf0f to 2015895 Compare October 7, 2025 15:16

- name: Swap Staging and Production Slots
uses: pagopa/dx/actions/swap-appsvc-slot@main
uses: pagopa/dx/actions/incremental-rollout@feats/unify-incremental-rollout-apis

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'release-azure-appsvc-v1.yaml' step
Uses Step
uses 'pagopa/dx/actions/incremental-rollout' with ref 'feats/unify-incremental-rollout-apis', not a pinned commit hash
@lucacavallaro lucacavallaro force-pushed the feats/unify-incremental-rollout-apis branch from 2015895 to 28de110 Compare October 7, 2025 15:20
@lucacavallaro lucacavallaro changed the title Refactor swap-appsvc-slot to support different resource types Use the same incremental-rollout action for both App Service and Container Apps Oct 7, 2025
echo "ca_id=$container_app_id" >> $GITHUB_OUTPUT
- name: Check for New Revision Errors and Increment Traffic
uses: pagopa/dx/actions/incremental-rollout@feats/unify-incremental-rollout-apis

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'release-azure-containerapp-v1.yaml' step
Uses Step
uses 'pagopa/dx/actions/incremental-rollout' with ref 'feats/unify-incremental-rollout-apis', not a pinned commit hash
@lucacavallaro lucacavallaro changed the title Use the same incremental-rollout action for both App Service and Container Apps Use the same incremental-rollout script for both appsvc and containerapp Oct 7, 2025
@lucacavallaro lucacavallaro changed the title Use the same incremental-rollout script for both appsvc and containerapp Use the same canary rollout script for both appsvc and containerapp Oct 7, 2025
@lucacavallaro lucacavallaro marked this pull request as ready for review October 7, 2025 15:22
@lucacavallaro lucacavallaro requested a review from a team as a code owner October 7, 2025 15:22
Copy link

@gz-dx-bot gz-dx-bot left a comment

Choose a reason for hiding this comment

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

Haven't tried this, but lgtm.


- name: Swap Staging and Production Slots
uses: pagopa/dx/actions/swap-appsvc-slot@main
uses: pagopa/dx/actions/incremental-rollout@feats/unify-incremental-rollout-apis
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
uses: pagopa/dx/actions/incremental-rollout@feats/unify-incremental-rollout-apis
uses: pagopa/dx/actions/incremental-rollout@main

reminder: return to main before merge

echo "ca_id=$container_app_id" >> $GITHUB_OUTPUT
- name: Check for New Revision Errors and Increment Traffic
uses: pagopa/dx/actions/incremental-rollout@feats/unify-incremental-rollout-apis
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
uses: pagopa/dx/actions/incremental-rollout@feats/unify-incremental-rollout-apis
uses: pagopa/dx/actions/incremental-rollout@main

reminder: return to main before merge

@Krusty93 Krusty93 requested a review from Copilot October 9, 2025 12:38
Copy link
Contributor

@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 refactors the incremental rollout action to support both Azure App Service and Container App deployments by introducing a unified interface with resource-type-specific implementations.

Key changes:

  • Generalized the rollout script to support multiple Azure resource types through a plugin-like architecture
  • Added support for Container App deployments alongside existing App Service functionality
  • Renamed the action from "swap-appsvc-slot" to "incremental-rollout" to reflect its broader scope

Reviewed Changes

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

Show a summary per file
File Description
actions/incremental-rollout/rollout.sh Core script refactored to use resource-type-specific implementations via sourced files
actions/incremental-rollout/azure-appsvc.sh New file containing App Service-specific traffic management functions
actions/incremental-rollout/azure-containerapp.sh New file containing Container App-specific traffic management functions
actions/incremental-rollout/action.yml Updated action interface to accept resource type parameter
actions/incremental-rollout/package.json Renamed package and updated lint script to check all shell files
actions/incremental-rollout/README.md Updated documentation to reflect new resource type parameter and action name
actions/incremental-rollout/CHANGELOG.md Updated title to match renamed action
.github/workflows/release-azure-containerapp-v1.yaml Replaced inline rollout logic with the unified incremental-rollout action
.github/workflows/release-azure-appsvc-v1.yaml Updated to use renamed action with resource type parameter
.changeset/chubby-emus-happen.md Added changeset documenting the rename and Container App support
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment on lines +6 to +9
az containerapp ingress traffic set \
--resource-group "$resource_group_name" \
--name "$containerapp_name" \
--revision-weight "latest=0"
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

The __revert_traffic function sets traffic to latest=0 but should set traffic to 100% for the production revision. This will result in no traffic being routed to any revision, breaking the revert functionality.

Suggested change
az containerapp ingress traffic set \
--resource-group "$resource_group_name" \
--name "$containerapp_name" \
--revision-weight "latest=0"
# Get the current production revision (the one with traffic weight > 0)
local prod_revision=$(az containerapp revision list \
--resource-group "$resource_group_name" \
--name "$containerapp_name" \
--query "[?trafficWeight>0].name" \
--output tsv)
# Set 100% traffic to the production revision
az containerapp ingress traffic set \
--resource-group "$resource_group_name" \
--name "$containerapp_name" \
--revision-weight "${prod_revision}=100"

Copilot uses AI. Check for mistakes.

}

__swap_versions() {
__revert_traffic "$1" "$2"
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

The __swap_versions function calls __revert_traffic which sets traffic to 0% instead of swapping to the new revision. This should set traffic to 100% for the latest revision to complete the rollout.

Suggested change
__revert_traffic "$1" "$2"
__set_traffic "$1" "$2" "100"

Copilot uses AI. Check for mistakes.


- name: Swap Staging and Production Slots
uses: pagopa/dx/actions/swap-appsvc-slot@main
uses: pagopa/dx/actions/incremental-rollout@feats/unify-incremental-rollout-apis
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

Using a feature branch reference in the workflow. This should be updated to use a stable reference like @main or a specific version tag before merging to production.

Suggested change
uses: pagopa/dx/actions/incremental-rollout@feats/unify-incremental-rollout-apis
uses: pagopa/dx/actions/incremental-rollout@main

Copilot uses AI. Check for mistakes.

"incremental-rollout": minor
---

Rename action, add support to containerapp

Choose a reason for hiding this comment

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

it looks like a major since you're changing the input web_app_name to resource_name

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.

5 participants